From c7e4217204d981125d18bab7bb4a45c9ba9c2557 Mon Sep 17 00:00:00 2001 From: Andrey Bochkarev <50177704+octaviusz@users.noreply.github.com> Date: Mon, 13 Jul 2026 14:40:43 +0300 Subject: [PATCH] no-bug: Ignore `zen-empty-tab` in `#isLastTabWindow` (gh-14564) When dragging a tab from the blank window to the main window, the blank window doesn't close because '#isLastTabWindow' considers 'zen-empty-tab' as a normal tab. --- .../components/tabbrowser/content/tabbrowser-js.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index 65a98c74d..3306027ee 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 08b5b56e069d038d72c87355920c4ce8a55ed805..e1a3a18081c7a8153f8d12c187bf4dd522944fcb 100644 +index 08b5b56e069d038d72c87355920c4ce8a55ed805..0e4f57c21d28ccf173d8d1e13e96c2c1f8a79f34 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -511,6 +511,7 @@ @@ -692,6 +692,15 @@ index 08b5b56e069d038d72c87355920c4ce8a55ed805..e1a3a18081c7a8153f8d12c187bf4dd5 return; } +@@ -5776,7 +5973,7 @@ + */ + #isLastTabInWindow(tab) { + for (const otherTab of this.tabs) { +- if (otherTab != tab && otherTab.isOpen && !otherTab.hidden) { ++ if (otherTab != tab && otherTab.isOpen && !otherTab.hidden && !otherTab.hasAttribute("zen-empty-tab")) { + return false; + } + } @@ -5867,7 +6064,7 @@ closeWindowWithLastTab != null ? closeWindowWithLastTab