From 5048bdd325084c2e116435d902ca0d5e39b9948f Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Sat, 31 Dec 2016 14:36:28 +0300 Subject: [PATCH] Don't touch already closed tab in toggleContextTabPrivate() (#237) --- bootstrap.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 0b4b557..0c2a032 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -2540,9 +2540,7 @@ var privateTab = { gBrowser.moveTabTo(dupTab, pos); if(tab.selected) gBrowser.selectedTab = dupTab; - window.setTimeout(function(tab) { - gBrowser.removeTab(tab); - }, 0, tab); + gBrowser.removeTab(tab); tab = dupTab; // Duplicated tab will be reloaded anyway autoReload = stopLoading = false; @@ -2578,12 +2576,14 @@ var privateTab = { browser.stop(); } } - if(tab.selected) { // Only for hotkey + window.setTimeout(function() { + if(!tab.selected) // Only for hotkey + return; this.updateTabContext(window); this.updateTabTooltip(window); if("TabScope" in window && "_updateTitle" in window.TabScope && window.TabScope._tab) window.TabScope._updateTitle(); - } + }.bind(this), 0); }, cmdAttr: "privateTab-command",