From 1ac943ca7aa3f4bcb51f08f4475de1e0c8eaa458 Mon Sep 17 00:00:00 2001 From: Alex Kovar Date: Mon, 27 Sep 2010 18:12:32 -0500 Subject: simplified bookmarklet handling --- bookmarks.js | 15 +++++++-------- 1 file 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(); -- cgit v1.2.3