From 83de087b0b971054512c6b91156c1d44693a281c Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sun, 25 Jan 2026 12:22:53 +0100 Subject: [PATCH] feat: Dont bring unpinned tabs to new windows if window sync is disabled, b=no-bug, c=no-component --- src/zen/sessionstore/ZenSessionManager.sys.mjs | 4 ++++ src/zen/sessionstore/ZenWindowSync.sys.mjs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zen/sessionstore/ZenSessionManager.sys.mjs b/src/zen/sessionstore/ZenSessionManager.sys.mjs index 350bbfc43..a559ccf2a 100644 --- a/src/zen/sessionstore/ZenSessionManager.sys.mjs +++ b/src/zen/sessionstore/ZenSessionManager.sys.mjs @@ -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 diff --git a/src/zen/sessionstore/ZenWindowSync.sys.mjs b/src/zen/sessionstore/ZenWindowSync.sys.mjs index 59e27f9eb..9e6d5ddad 100644 --- a/src/zen/sessionstore/ZenWindowSync.sys.mjs +++ b/src/zen/sessionstore/ZenWindowSync.sys.mjs @@ -1087,7 +1087,7 @@ class nsZenWindowSync { } tab._zenContentsVisible = true; tab.id = this.#newTabSyncId; - if (isUnsyncedWindow) { + if (isUnsyncedWindow || !lazy.gWindowSyncEnabled) { return; } this.#runOnAllWindows(window, (win) => {