diff options
author | SpockFan02 <aidanboyle@comcast.net> | 2018-06-06 12:16:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 12:16:28 +0000 |
commit | cf15c230e5345af80da5d02735ea137cf4652f62 (patch) | |
tree | 7a02c3b954c77ca9bab9bd8908101e5033e66de1 /application | |
parent | a421f38160599152cd409e4fabd434a224f78487 (diff) | |
download | UXP-cf15c230e5345af80da5d02735ea137cf4652f62.tar UXP-cf15c230e5345af80da5d02735ea137cf4652f62.tar.gz UXP-cf15c230e5345af80da5d02735ea137cf4652f62.tar.lz UXP-cf15c230e5345af80da5d02735ea137cf4652f62.tar.xz UXP-cf15c230e5345af80da5d02735ea137cf4652f62.zip |
Issue #448: Pale Moon: Include pinned tabs when warning about closing tabs with more than one window
This resolves #448.
Diffstat (limited to 'application')
-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; |