From f9b1508e9c66b6c2000e850b20fd0bf52e5aff42 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Mon, 5 Sep 2016 16:32:28 +0900 Subject: [PATCH] Reduce use of eval() --- content/treestyletab/windowHelperHacks.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js index 6a402727..c101891f 100644 --- a/content/treestyletab/windowHelperHacks.js +++ b/content/treestyletab/windowHelperHacks.js @@ -571,13 +571,13 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove // https://addons.mozilla.org/firefox/addon/instaclick/ if ('instaclick' in window && 'contentAreaClick2' in window.instaclick && - TreeStyleTabUtils.getTreePref('compatibility.InstaClick')) { - eval('instaclick.contentAreaClick2 = '+ - instaclick.contentAreaClick2.toSource().replace( - 'gBrowser.loadOneTab(', - 'TreeStyleTabService.readyToOpenChildTab(); $&' - ) - ); + TreeStyleTabUtils.getTreePref('compatibility.InstaClick') && + !instaclick.__treestyletab__contentAreaClick2) { + instaclick.__treestyletab__contentAreaClick2 = instaclick.contentAreaClick2; + instaclick.contentAreaClick2 = function(...aArgs) { + TreeStyleTabService.readyToOpenChildTabNow(); + return this.__treestyletab__contentAreaClick2(...aArgs); + }; } // Duplicate This Tab