diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 5ac2d808..78463d67 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1949,6 +1949,7 @@ catch(e) { { var newTabs = []; aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (newTabs.indexOf(aTab) < 0) newTabs.push(aTab); }); newTabs.sort(function(aA, aB) { @@ -1993,7 +1994,11 @@ catch(e) { } var currentTabInfo; - var tabsInfo = Array.slice(aTabs).map(function(aTab) { + var tabsInfo = Array.slice(aTabs) + .filter(function(aTab) { + return aTab.parentNode; // ignore removed tabs + }) + .map(function(aTab) { var webNav = aTab.linkedBrowser.webNavigation; var url = webNav.currentURI.spec; var name = ''; diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index ac4175c5..55516dc4 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2587,6 +2587,7 @@ TreeStyleTabBrowser.prototype = { { this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (aParent) this.attachTabTo(aTab, aParent); else @@ -2600,6 +2601,7 @@ TreeStyleTabBrowser.prototype = { { this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs this.partTab(aTab); this.collapseExpandTab(aTab, false); }, this); @@ -2806,6 +2808,7 @@ TreeStyleTabBrowser.prototype = { var maxIndent = parseInt(aTabs[0].boxObject.height / 2); Array.slice(aTabs).forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (multirow) { indent = Math.min(aLevel * 3, maxIndent); var colors = '-moz-border-top-colors:'+(function(aNum) { @@ -2842,7 +2845,7 @@ TreeStyleTabBrowser.prototype = { this.updateTabsIndentWithDelayTimer = window.setTimeout(function(aSelf) { var tabs = []; aSelf.updateTabsIndentWithDelayTabs.forEach(function(aTab) { - if (tabs.indexOf(aTab) < 0) tabs.push(aTab); + if (tabs.indexOf(aTab) < 0 && aTab.parentNode) tabs.push(aTab); }); aSelf.updateTabsIndentWithDelayTabs = []; aSelf.updateTabsIndent(tabs);