Patch to toggleSidebar only when possible.

The function will be removed in the future by changes introduced at https://bugzilla.mozilla.org/show_bug.cgi?id=1123517
This commit is contained in:
YUKI Hiroshi 2015-02-27 10:24:18 +09:00
parent 54b2c981b1
commit 42c24c1628

View File

@ -295,12 +295,14 @@ var TreeStyleTabWindowHelper = {
}, 'treeStyleTab'); }, 'treeStyleTab');
} }
TreeStyleTabUtils.doPatching(window.toggleSidebar, 'window.toggleSidebar', function(aName, aSource) { if ('toggleSidebar' in window) {
return eval(aName+' = '+aSource.replace( TreeStyleTabUtils.doPatching(window.toggleSidebar, 'window.toggleSidebar', function(aName, aSource) {
'{', return eval(aName+' = '+aSource.replace(
'{ gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);' '{',
)); '{ gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);'
}, 'treeStyleTab'); ));
}, 'treeStyleTab');
}
}, },
_splitFunctionNames : function TSTWH__splitFunctionNames(aString) _splitFunctionNames : function TSTWH__splitFunctionNames(aString)
{ {