From 2f51f152652847caaefb091f8d5177b3358ad401 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sat, 8 Feb 2014 17:56:43 +0900 Subject: [PATCH] Open tabs as children, from the "search by" in the context menu. (#655) It worked in old versions, but killed by changes of Firefox itself. --- content/treestyletab/windowHelper.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index cbb97956..a7a638d9 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -159,14 +159,23 @@ var TreeStyleTabWindowHelper = { ) ); - if ('BrowserSearch' in window && - 'loadSearch' in BrowserSearch) { - eval('BrowserSearch.loadSearch = '+ - BrowserSearch.loadSearch.toSource().replace( - 'openLinkIn(', - 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' - ) - ); + if ('BrowserSearch' in window) { + if ('_loadSearch' in BrowserSearch) { + eval('BrowserSearch._loadSearch = '+ + BrowserSearch._loadSearch.toSource().replace( + 'openLinkIn(', + 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' + ) + ); + } + else if ('loadSearch' in BrowserSearch) { // Firefox 24 and olders + eval('BrowserSearch.loadSearch = '+ + BrowserSearch.loadSearch.toSource().replace( + 'openLinkIn(', + 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0], useNewTab); $&' + ) + ); + } } let (functions = [