mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-21 04:14:19 +00:00
51 lines
2.1 KiB
C++
51 lines
2.1 KiB
C++
diff --git a/browser/components/sessionstore/SessionSaver.sys.mjs b/browser/components/sessionstore/SessionSaver.sys.mjs
|
|
index 9141793550f7c7ff6aa63d4c85bf571b4499e2d0..a4ce5de45f13eaa22803083eccb4e48a054fee39 100644
|
|
--- a/browser/components/sessionstore/SessionSaver.sys.mjs
|
|
+++ b/browser/components/sessionstore/SessionSaver.sys.mjs
|
|
@@ -20,6 +20,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|
SessionFile: "resource:///modules/sessionstore/SessionFile.sys.mjs",
|
|
SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs",
|
|
sessionStoreLogger: "resource:///modules/sessionstore/SessionLogger.sys.mjs",
|
|
+ ZenSessionStore: "resource:///modules/zen/ZenSessionManager.sys.mjs",
|
|
});
|
|
|
|
/*
|
|
@@ -250,7 +251,7 @@ var SessionSaverInternal = {
|
|
// Cancel any pending timeouts.
|
|
this.cancel();
|
|
|
|
- if (lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) {
|
|
+ if (false) {
|
|
// Don't save (or even collect) anything in permanent private
|
|
// browsing mode
|
|
|
|
@@ -305,6 +306,7 @@ var SessionSaverInternal = {
|
|
this._maybeClearCookiesAndStorage(state);
|
|
|
|
Glean.sessionRestore.collectData.stopAndAccumulate(timerId);
|
|
+ lazy.ZenSessionStore.saveState(state);
|
|
return this._writeState(state);
|
|
},
|
|
|
|
@@ -372,7 +374,19 @@ var SessionSaverInternal = {
|
|
// Write (atomically) to a session file, using a tmp file. Once the session
|
|
// file is successfully updated, save the time stamp of the last save and
|
|
// notify the observers.
|
|
- return lazy.SessionFile.write(state).then(
|
|
+ let stateToWrite = Cu.cloneInto(state, {});
|
|
+ if (Services.prefs.getBoolPref("zen.session-store.reduce-sessionstore-write-size", true)) {
|
|
+ for (let i = 0; i < stateToWrite.windows.length; i++) {
|
|
+ let win = stateToWrite.windows[i];
|
|
+ if (win.isPopup || win.isTaskbarTab || win.isZenUnsynced) {
|
|
+ continue;
|
|
+ }
|
|
+ win.tabs = [];
|
|
+ win.folders = [];
|
|
+ win.groups = [];
|
|
+ }
|
|
+ }
|
|
+ return lazy.SessionFile.write(stateToWrite).then(
|
|
() => {
|
|
this.updateLastSaveTime();
|
|
if (!lazy.RunState.isRunning) {
|