From 42c24c1628f76a71919be333c475d69f36fcc619 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Fri, 27 Feb 2015 10:24:18 +0900 Subject: [PATCH] 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 --- content/treestyletab/windowHelper.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index ec930664..08175c40 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -295,12 +295,14 @@ var TreeStyleTabWindowHelper = { }, 'treeStyleTab'); } - TreeStyleTabUtils.doPatching(window.toggleSidebar, 'window.toggleSidebar', function(aName, aSource) { - return eval(aName+' = '+aSource.replace( - '{', - '{ gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);' - )); - }, 'treeStyleTab'); + if ('toggleSidebar' in window) { + TreeStyleTabUtils.doPatching(window.toggleSidebar, 'window.toggleSidebar', function(aName, aSource) { + return eval(aName+' = '+aSource.replace( + '{', + '{ gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);' + )); + }, 'treeStyleTab'); + } }, _splitFunctionNames : function TSTWH__splitFunctionNames(aString) {