feat: Dont bring unpinned tabs to new windows if window sync is disabled, b=no-bug, c=no-component

This commit is contained in:
mr. m
2026-01-25 12:22:53 +01:00
parent 5dea28a3cb
commit 83de087b0b
2 changed files with 5 additions and 1 deletions

View File

@@ -543,6 +543,10 @@ export class nsZenSessionManager {
this.#restoreWindowData(newWindow);
}
newWindow.tabs = this.#filterUnusedTabs(newWindow.tabs || []);
if (!lazy.gWindowSyncEnabled) {
// Don't bring over any unpinned tabs if window sync is disabled.
newWindow.tabs = newWindow.tabs.filter((tab) => tab.pinned);
}
// These are window-specific from the previous window state that
// we don't want to restore into the new window. Otherwise, new

View File

@@ -1087,7 +1087,7 @@ class nsZenWindowSync {
}
tab._zenContentsVisible = true;
tab.id = this.#newTabSyncId;
if (isUnsyncedWindow) {
if (isUnsyncedWindow || !lazy.gWindowSyncEnabled) {
return;
}
this.#runOnAllWindows(window, (win) => {