mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-28 07:45:09 +00:00
64 lines
2.3 KiB
C++
64 lines
2.3 KiB
C++
diff --git a/browser/components/sessionstore/SessionStartup.sys.mjs b/browser/components/sessionstore/SessionStartup.sys.mjs
|
|
index 86600ffb5178599ab23270a964064ca657a3283f..70d7b5c7d69d3700475d663b595052264c67d351 100644
|
|
--- a/browser/components/sessionstore/SessionStartup.sys.mjs
|
|
+++ b/browser/components/sessionstore/SessionStartup.sys.mjs
|
|
@@ -40,6 +40,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|
StartupPerformance:
|
|
"resource:///modules/sessionstore/StartupPerformance.sys.mjs",
|
|
sessionStoreLogger: "resource:///modules/sessionstore/SessionLogger.sys.mjs",
|
|
+ ZenSessionStore: "resource:///modules/zen/ZenSessionManager.sys.mjs",
|
|
});
|
|
|
|
const STATE_RUNNING_STR = "running";
|
|
@@ -85,7 +86,7 @@ export var SessionStartup = {
|
|
}
|
|
|
|
// do not need to initialize anything in auto-started private browsing sessions
|
|
- if (lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) {
|
|
+ if (false) {
|
|
this._initialized = true;
|
|
gOnceInitializedDeferred.resolve();
|
|
return;
|
|
@@ -179,6 +180,8 @@ export var SessionStartup = {
|
|
this._initialState = parsed;
|
|
}
|
|
|
|
+ this._initialState = lazy.ZenSessionStore.onFileRead(this._initialState);
|
|
+
|
|
if (this._initialState == null) {
|
|
// No valid session found.
|
|
this._sessionType = this.NO_SESSION;
|
|
@@ -276,6 +279,8 @@ export var SessionStartup = {
|
|
`Previous shutdown ok? ${this._previousSessionCrashed}, reason: ${previousSessionCrashedReason}`
|
|
);
|
|
|
|
+ lazy.ZenSessionStore.onCrashCheckpoints(this._initialState);
|
|
+
|
|
Services.obs.addObserver(this, "sessionstore-windows-restored", true);
|
|
|
|
if (this.sessionType == this.NO_SESSION) {
|
|
@@ -336,12 +341,7 @@ export var SessionStartup = {
|
|
isAutomaticRestoreEnabled() {
|
|
if (this._resumeSessionEnabled === null) {
|
|
this._resumeSessionEnabled =
|
|
- !lazy.PrivateBrowsingUtils.permanentPrivateBrowsing &&
|
|
- (Services.prefs.getBoolPref(
|
|
- "browser.sessionstore.resume_session_once"
|
|
- ) ||
|
|
- Services.prefs.getIntPref("browser.startup.page") ==
|
|
- BROWSER_STARTUP_RESUME_SESSION);
|
|
+ true;
|
|
}
|
|
|
|
return this._resumeSessionEnabled;
|
|
@@ -354,8 +354,7 @@ export var SessionStartup = {
|
|
*/
|
|
willRestore() {
|
|
return (
|
|
- this.sessionType == this.RECOVER_SESSION ||
|
|
- this.sessionType == this.RESUME_SESSION
|
|
+ true
|
|
);
|
|
},
|
|
|