From a57ca2cf3f38e3b5aa4aa851059d96a3b3cd5ac2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 24 Aug 2013 20:57:55 +0900 Subject: [PATCH] update open bookmarks in new tab --- _keysnail.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index f91efe0..887978d 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -20,16 +20,24 @@ ext.add("open-bookmarks-in-new-tab", function(){ getService(Ci.nsIXULAppInfo).version)) { return; } - // window.whereToOpenLink = function(e, ib, ia){ return "tab"; }; + window.whereToOpenLink = function(e, ib, ia){ return "tab"; }; + + + // I cannot fully understand what happen but keysnail emit error + // *after* initialization of firefox finished successfully and I assured + // that new tabs open as I expect when clicking bookmarks, for example, + // when I try to tweet using the twitter keysnail plugin, with error + // message saying like "whereToOpenLink is not defined.". + // if no modifier key pressed open in new tab. - var whereToOpenLink_org = window.whereToOpenLink; - eval('window.whereToOpenLink = ' + whereToOpenLink_org.toString() - .replace('{', - '{ if(!e || ' + - '(!e.ctrlKey && !e.shiftKey && !e.metaKey && ' + - '!(e.altKKey && !ignoreAlt))) ' + - 'return "tab";') - ); + // var whereToOpenLink_org = window.whereToOpenLink; + // eval('window.whereToOpenLink = ' + whereToOpenLink_org.toString() + // .replace('{', + // '{ if(!e || ' + + // '(!e.ctrlKey && !e.shiftKey && !e.metaKey && ' + + // '!(e.altKKey && !ignoreAlt))) ' + + // 'return "tab";') + // ); }, "open in new tab"); ext.exec("open-bookmarks-in-new-tab");