feat: Fixed windows not initializing when window sync is disabled, b=closes #11999, p=#12015

This commit is contained in:
mr. m
2026-01-25 12:12:56 +01:00
committed by GitHub
parent 956841a76e
commit 5dea28a3cb
3 changed files with 7 additions and 4 deletions

View File

@@ -345,7 +345,7 @@ export class nsZenSessionManager {
saveState(state) {
let windows = state?.windows || [];
windows = windows.filter((win) => this.#isWindowSaveable(win));
if (!windows.length || !lazy.gWindowSyncEnabled) {
if (!windows.length) {
// Don't save (or even collect) anything in permanent private
// browsing mode. We also don't want to save if there are no windows.
return;
@@ -525,7 +525,7 @@ export class nsZenSessionManager {
* Whether this new window is being restored from a closed window.
*/
restoreNewWindow(aWindow, SessionStoreInternal, fromClosedWindow = false) {
if (aWindow.gZenWorkspaces?.privateWindowOrDisabled || !lazy.gWindowSyncEnabled) {
if (aWindow.gZenWorkspaces?.privateWindowOrDisabled) {
return;
}
this.log("Restoring new window with Zen session data");

View File

@@ -140,7 +140,7 @@ class nsZenWindowSync {
}
init() {
if (!lazy.gWindowSyncEnabled || this.#initialized) {
if (this.#initialized) {
return;
}
this.#initialized = true;
@@ -309,6 +309,9 @@ class nsZenWindowSync {
) {
return;
}
if (!lazy.gWindowSyncEnabled && !UNSYNCED_WINDOW_EVENTS.includes(aEvent.type)) {
return;
}
if (INSTANT_EVENTS.includes(aEvent.type)) {
this.#handleNextEvent(aEvent);
return;

View File

@@ -20,7 +20,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.18.1b",
"displayVersion": "1.18.2b",
"github": {
"repo": "zen-browser/desktop"
},