diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index 28e92c31..6bf2ad74 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -75,8 +75,12 @@ var TreeStyleTabWindowHelper = { var strip = this.service.getTabStrip(aObserver) || gBrowser.mStrip // fallback to the default strip, for Tab Mix Plus; - if (aObserver.tabContainer && - aObserver.tabContainer.tabbrowser == aObserver) { // Firefox 4.0 or later + // Firefox 4.0 or later + if ( + aObserver.tabContainer && + aObserver.tabContainer.tabbrowser == aObserver && + this.service.isGecko2 // tabbar.tabbrowser can be defined by addons like Tab Mix Plus. + ) { aObserver = aObserver.tabContainer; } diff --git a/modules/browser.js b/modules/browser.js index 3d4632cf..cc494329 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -974,6 +974,9 @@ TreeStyleTabBrowser.prototype = { scrollFrame = d.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-frame') || d.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'scroll-tabs-frame'); newTabBox = d.getAnonymousElementByAttribute(b.mTabContainer, 'id', 'tabs-newbutton-box'); + let newTabButton = document.getElementById('new-tab-button'); + if (newTabButton && newTabButton.parentNode == b.tabContainer._container) + newTabBox = newTabButton; tabBarMode = this.getPref('extensions.tabmix.tabBarMode'); } @@ -1017,7 +1020,8 @@ TreeStyleTabBrowser.prototype = { d.getAnonymousNodes(scrollFrame)[0].removeAttribute('flex'); scrollFrame.parentNode.orient = scrollFrame.orient = 'vertical'; - newTabBox.orient = 'horizontal'; + if (newTabBox) + newTabBox.orient = 'horizontal'; if (tabBarMode == 2) this.setPref('extensions.tabmix.tabBarMode', 1); } @@ -1105,7 +1109,8 @@ TreeStyleTabBrowser.prototype = { d.getAnonymousNodes(scrollFrame)[0].setAttribute('flex', 1); scrollFrame.parentNode.orient = scrollFrame.orient = 'horizontal'; - newTabBox.orient = 'vertical'; + if (newTabBox) + newTabBox.orient = 'vertical'; } if (toolboxContainer)