diff options
| author | Alex Kovar | 2010-09-27 18:12:32 -0500 |
|---|---|---|
| committer | Alex Kovar | 2010-09-27 18:12:32 -0500 |
| commit | 1ac943ca7aa3f4bcb51f08f4475de1e0c8eaa458 (patch) | |
| tree | 36faca32ce2e2f3e7e7fa3c7b0e433108267fc56 /bookmarks.js | |
| parent | 60ffade9df3f46fca1bf31dc77e46ad9873a9cdf (diff) | |
| download | vimium-1ac943ca7aa3f4bcb51f08f4475de1e0c8eaa458.tar.bz2 | |
simplified bookmarklet handling
Diffstat (limited to 'bookmarks.js')
| -rw-r--r-- | bookmarks.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bookmarks.js b/bookmarks.js index ad57e1bf..faa82148 100644 --- a/bookmarks.js +++ b/bookmarks.js @@ -84,16 +84,15 @@ function activateBookmarkFindMode() { var bookmarksFound = BookmarkMode.bookmarksFound; if(bookmarksFound && bookmarksFound.length>0) { var url = bookmarksFound[0].url - if(url.indexOf("javascript:")===0) { - eval(url.substr(11, url.length)) + var isABookmarklet = function(url) { + return url.indexOf("javascript:")===0 + } + + if(!BookmarkMode.newTab || isABookmarklet(url)) { + window.location=url } else { - if(BookmarkMode.newTab) { - window.open(url) - } - else { - window.location=url - } + window.open(url) } BookmarkMode.disable(); |
