From 18639ccbeaa0b1cca103d9af8d4243cd30a6ec11 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sat, 15 Sep 2012 12:32:58 +0900 Subject: [PATCH] Don't override BrowserReloadOrDuplicate, BrowserForward, BrowserBack, and gotoHistoryIndex anymore --- content/treestyletab/windowHelper.js | 47 +++++----------------------- modules/window.js | 11 +++---- 2 files changed, 11 insertions(+), 47 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index 89128eeb..b7c66bc6 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -263,46 +263,13 @@ var TreeStyleTabWindowHelper = { } } - let (functions = this._splitFunctionNames()) { - for (let i = 0, maxi = functions.length; i < maxi; i++) - { - let func = functions[i]; - let source = this._getFunctionSource(func); - if (!source || !/^\(?function (gotoHistoryIndex|BrowserForward|BrowserBack)/.test(source)) - continue; - eval(func+' = '+source.replace( - /((?:openUILinkIn|duplicateTabIn)\()/g, - 'TreeStyleTabService.onBeforeOpenLink(where); $1' - )); - } - } - - let (functions = this._splitFunctionNames()) { - for (let i = 0, maxi = functions.length; i < maxi; i++) - { - let func = functions[i]; - let source = this._getFunctionSource(func); - if (!source || !/^\(?function (BrowserReloadOrDuplicate)/.test(source)) - continue; - eval(func+' = '+source.replace( - /((?:openUILinkIn|duplicateTabIn)\([^\)]+\))/g, - '(TreeStyleTabService.onBeforeTabReloadOrDuplicate(where), $&)' - )); - } + if (window.duplicateTabIn) { + eval('window.duplicateTabIn = '+ + window.duplicateTabIn.toSource().replace( + '{', + '{ gBrowser.treeStyleTab.onBeforeTabDuplicate(aTab, where); ' + ) + ); } let (functions = this._splitFunctionNames(