diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-06-06 14:54:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 14:54:19 +0200 |
commit | fde9b452139c9fa7cee2ceac6ecf9745af4f36ef (patch) | |
tree | 3ee3be8ad4b94a4118d7daec467c1c11637d8714 | |
parent | 00dee2f05b854d8f36747ac8459417012bb7a61f (diff) | |
parent | cf15c230e5345af80da5d02735ea137cf4652f62 (diff) | |
download | UXP-fde9b452139c9fa7cee2ceac6ecf9745af4f36ef.tar UXP-fde9b452139c9fa7cee2ceac6ecf9745af4f36ef.tar.gz UXP-fde9b452139c9fa7cee2ceac6ecf9745af4f36ef.tar.lz UXP-fde9b452139c9fa7cee2ceac6ecf9745af4f36ef.tar.xz UXP-fde9b452139c9fa7cee2ceac6ecf9745af4f36ef.zip |
Merge pull request #458 from SpockMan02/patch-3
Issue #448: Pale Moon: Include pinned tabs when warning about closing…
-rw-r--r-- | application/palemoon/base/content/tabbrowser.xml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 12319a62b..78e348d8c 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -1669,8 +1669,22 @@ var tabsToClose; switch (aCloseTabs) { case this.closingTabsEnum.ALL: - tabsToClose = this.tabs.length - this._removingTabs.length - - gBrowser._numPinnedTabs; + // If there are multiple windows, pinned tabs will be closed, so + // we warn about them, too; if there is just one window, pinned + // tabs should come back on restart, so exclude them from warning. + var numberOfWindows = 0; + var browserEnum = Services.wm.getEnumerator("navigator:browser"); + while (browserEnum.hasMoreElements() && numberOfWindows < 2) { + numberOfWindows++; + browserEnum.getNext(); + } + if (numberOfWindows > 1) { + tabsToClose = this.tabs.length - this._removingTabs.length + } + else { + tabsToClose = this.tabs.length - this._removingTabs.length - + gBrowser._numPinnedTabs; + } break; case this.closingTabsEnum.OTHER: tabsToClose = this.visibleTabs.length - 1 - gBrowser._numPinnedTabs; |