Skip to content

Commit f7453ac

Browse files
committed
Fix closing tab count for all edge cases
1 parent 4e2dfd8 commit f7453ac

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/browser/base/content/browser-js.patch

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
2-
index 05f6aec3dac31231e15cb316f6e06d66ee87bea9..3bbbe8553777056798ea9ddce1744a8e48848a37 100644
2+
index 05f6aec3dac31231e15cb316f6e06d66ee87bea9..6f0a50684dc3aae6b22fce14aa7f855e8e06136a 100644
33
--- a/browser/base/content/browser.js
44
+++ b/browser/base/content/browser.js
55
@@ -29,6 +29,7 @@ ChromeUtils.defineESModuleGetters(this, {
@@ -19,6 +19,33 @@ index 05f6aec3dac31231e15cb316f6e06d66ee87bea9..3bbbe8553777056798ea9ddce1744a8e
1919
PictureInPicture.updateUrlbarToggle(gBrowser.selectedBrowser);
2020

2121
if (!gMultiProcessBrowser) {
22+
@@ -4302,7 +4305,7 @@ function warnAboutClosingWindow() {
23+
24+
if (!isPBWindow && !toolbar.visible) {
25+
return gBrowser.warnAboutClosingTabs(
26+
- gBrowser.openTabs.length,
27+
+ gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
28+
gBrowser.closingTabsEnum.ALL
29+
);
30+
}
31+
@@ -4342,7 +4345,7 @@ function warnAboutClosingWindow() {
32+
return (
33+
isPBWindow ||
34+
gBrowser.warnAboutClosingTabs(
35+
- gBrowser.openTabs.length,
36+
+ gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
37+
gBrowser.closingTabsEnum.ALL
38+
)
39+
);
40+
@@ -4367,7 +4370,7 @@ function warnAboutClosingWindow() {
41+
AppConstants.platform != "macosx" ||
42+
isPBWindow ||
43+
gBrowser.warnAboutClosingTabs(
44+
- gBrowser.openTabs.length,
45+
+ gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
46+
gBrowser.closingTabsEnum.ALL
47+
)
48+
);
2249
@@ -4630,7 +4633,7 @@ function switchToTabHavingURI(
2350
ignoreQueryString || replaceQueryString,
2451
ignoreFragmentWhenComparing

0 commit comments

Comments
 (0)