From 104c46d6aad68d28dd01bc978e471e0c1a335431 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Mon, 5 Sep 2016 14:41:24 +0900 Subject: [PATCH] Don't apply hack multiple times --- content/treestyletab/windowHelperHacks.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/windowHelperHacks.js b/content/treestyletab/windowHelperHacks.js index e886ce95..1f8fd8f6 100644 --- a/content/treestyletab/windowHelperHacks.js +++ b/content/treestyletab/windowHelperHacks.js @@ -533,8 +533,11 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove for (let i = 0, maxi = methods.length; i < maxi; i++) { let method = methods[i]; - if (!(method in LinkyContext.prototype)) continue; + if (!(method in LinkyContext.prototype) || + LinkyContext.prototype['__treestyletab__' + method]) + continue; let orig = LinkyContext.prototype[method]; + LinkyContext.prototype['__treestyletab__' + method] = orig; LinkyContext.prototype[method] = function(...aArgs) { TreeStyleTabService.readyToOpenChildTabNow(null, true); return orig.call(this, ...aArgs);