Open child tabs correctly from the search bar on Firefox 36 and later

This commit is contained in:
Piro / YUKI Hiroshi 2015-03-04 02:39:05 +09:00
parent 3f1dc6563b
commit 1cc22a7460

View File

@ -348,15 +348,14 @@ var TreeStyleTabWindowHelper = {
var searchbar = document.getElementById('searchbar'); var searchbar = document.getElementById('searchbar');
if (searchbar && if (searchbar &&
searchbar.doSearch && searchbar.doSearch &&
searchbar.doSearch.toSource().toSource().indexOf('TreeStyleTabService') < 0) { !searchbar.__treestyletab__original_doSearch) {
TreeStyleTabUtils.doPatching(searchbar.doSearch, 'searchbar.doSearch', function(aName, aSource) { searchbar.__treestyletab__original_doSearch = searchbar.doSearch;
return eval(aName+' = '+aSource.replace( searchbar.doSearch = function(...aArgs) {
/(openUILinkIn\(.+?\);)/, TreeStyleTabService.onBeforeBrowserSearch(aArgs[0]);
'TreeStyleTabService.onBeforeBrowserSearch(arguments[0]);\n' + var retVal = this.__treestyletab__original_doSearch.apply(this, aArgs);
'$1\n' + TreeStyleTabService.stopToOpenChildTab();
'TreeStyleTabService.stopToOpenChildTab();' return retVal;
)); };
}, 'TreeStyleTab');
} }
var goButton = document.getElementById('urlbar-go-button'); var goButton = document.getElementById('urlbar-go-button');