diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index bd6b3b9f..e0bca8f5 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -284,8 +284,8 @@ var TreeStyleTabWindowHelper = { TreeStyleTabUtils.doPatching(FullScreen.toggle, 'FullScreen.toggle', function(aName, aSource) { return eval(aName+' = '+aSource.replace( - '{', - '{ gBrowser.treeStyleTab.onBeforeFullScreenToggle(); ' + 'if (enterFS) {', + 'gBrowser.treeStyleTab.onBeforeFullScreenToggle(enterFS); $&' )); }, 'treeStyleTab'); diff --git a/modules/browser.js b/modules/browser.js index d91f39d2..a571f16b 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -5120,17 +5120,16 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { }).bind(this), 0); }, - onBeforeFullScreenToggle : function TSTBrowser_onBeforeFullScreenToggle() + onBeforeFullScreenToggle : function TSTBrowser_onBeforeFullScreenToggle(aEnterFS) { if (this.position != 'top') { - var isEnteringFullScreenMode = !this.window.fullScreen; // entering to the DOM-fullscreen (ex. YouTube Player) - if (this.document.mozFullScreen && isEnteringFullScreenMode) { + if (this.document.mozFullScreen) { this.setTabbrowserAttribute(this.kDOM_FULLSCREEN_ACTIVATED, true); } else { if (this.document.documentElement.getAttribute(this.kDOM_FULLSCREEN_ACTIVATED) != 'true') { - if (isEnteringFullScreenMode) + if (aEnterFS) this.autoHide.startForFullScreen(); else this.autoHide.endForFullScreen();