fix: Fixed empty windows appearing when using the window.open JS API, b=closes #8958, c=workspaces

This commit is contained in:
mr. m
2025-06-14 14:08:11 +02:00
parent a3f1733fd4
commit 8e799a678f
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index d5aa64842a35c6697263c63fd3a0571b64b01344..031b384c848fd391f84ed1e6d4f991f3287e37a4 100644
index d5aa64842a35c6697263c63fd3a0571b64b01344..48d8465f1a4d593ec6d4bff2bd7a83f44116506b 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -413,11 +413,41 @@
@@ -357,7 +357,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..031b384c848fd391f84ed1e6d4f991f3
// to remove the old selected tab.
if (tabToSelect) {
let leftoverTab = this.selectedTab;
+ if (this._hasAlreadyInitializedZenSessionStore) {
+ if (this._hasAlreadyInitializedZenSessionStore || !gZenWorkspaces.workspaceEnabled) {
this.selectedTab = tabToSelect;
this.removeTab(leftoverTab);
+ } else {

View File

@@ -913,7 +913,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async selectStartPage() {
if (gZenUIManager.testingEnabled || !this.workspaceEnabled) {
if (!this.workspaceEnabled) {
return;
}
await this.promiseInitialized;
@@ -1015,7 +1015,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
handleInitialTab(tab, isEmpty) {
if (gZenUIManager.testingEnabled) {
if (gZenUIManager.testingEnabled || !this.workspaceEnabled) {
return;
}
// note: We cant access `gZenVerticalTabsManager._canReplaceNewTab` this early