Browse files

making browser-action icon open blog view when on a new-tab page

  • Loading branch information...
1 parent 743c855 commit 7d6f1fa4555f6048fc6ee9b4c441a476900b6f06 @kragen committed May 16, 2011
Showing with 6 additions and 2 deletions.
  1. +1 −1 README.md
  2. +5 −1 yamemex.html
View
2 README.md
@@ -55,6 +55,7 @@ DONE
- tagging: Twitter-like, #hashtags in the blog view are links to
filtered views that show only things tagged with that hashtag.
- smoothly animating open annotation popup
+- making browser-action icon open blog view when on a new-tab page
BUGS
----
@@ -143,7 +144,6 @@ TODO (possibly)
lot easier when we can just copy the object being edited and then
see if anything about it has changed, and not send a message if not.
- automatically snarf publication date off the page
-- make icon do something when on a new-tab page
- storing original date for annotations so they stay in order (perhaps
linked from latest date)
- make annotation pane not fade when keyboard focus is in it
View
6 yamemex.html
@@ -1,7 +1,11 @@
<script src="db.js"></script>
<script>
chrome.browserAction.onClicked.addListener(function(tab) {
- chrome.tabs.sendRequest(tab.id, {openAnnotationWindow: 'please'});
+ if (tab.url === 'chrome://newtab/') {
+ chrome.tabs.create({url: chrome.extension.getURL('blog.html')});
+ } else {
+ chrome.tabs.sendRequest(tab.id, {openAnnotationWindow: 'please'});
+ }
});
function getAnnotation(url, callback) {

0 comments on commit 7d6f1fa

Please sign in to comment.