diff options
| author | Alex Kovar | 2010-09-27 10:49:07 -0500 |
|---|---|---|
| committer | Alex Kovar | 2010-09-27 10:49:07 -0500 |
| commit | b2f3db6fe2a3ff8887c5961b868bebf530c4cfaf (patch) | |
| tree | 3de617ec25f2de85b2b23b329d533c9ae21d4ec8 | |
| parent | 4d5039abc7e9ded987a48583415f2cbf29931ada (diff) | |
| download | vimium-b2f3db6fe2a3ff8887c5961b868bebf530c4cfaf.tar.bz2 | |
added bookmarklet support to bookmark mode
| -rw-r--r-- | bookmarks.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/bookmarks.js b/bookmarks.js index 476e28ac..ad57e1bf 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -84,14 +84,19 @@ function activateBookmarkFindMode() { var bookmarksFound = BookmarkMode.bookmarksFound; if(bookmarksFound && bookmarksFound.length>0) { var url = bookmarksFound[0].url - if(BookmarkMode.newTab) { - BookmarkMode.disable(); - window.open(url) + if(url.indexOf("javascript:")===0) { + eval(url.substr(11, url.length)) } else { - BookmarkMode.disable(); - window.location=url + if(BookmarkMode.newTab) { + window.open(url) + } + else { + window.location=url + } } + + BookmarkMode.disable(); } } @@ -115,6 +120,8 @@ function activateBookmarkFindMode() { } BookmarkMode.finder.find(BookmarkMode.getQueryString()) + event.stopPropagation(); + event.preventDefault(); }, keyUp: function(event) { // shift key will toggle between new tab/same tab |
