[tbb-commits] [tor-browser/tor-browser-38.6.1esr-6.0-1] Bug 18170: After update, only changelog tab shown

gk at torproject.org gk at torproject.org
Thu Feb 18 08:48:51 UTC 2016


commit 7c8b836e87bc2e5251ff085d48114d61678544d3
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Wed Feb 3 15:22:12 2016 -0500

    Bug 18170: After update, only changelog tab shown
    
    When in permanent private browsing mode, always return false
    for isAutomaticRestoreEnabled. This ensures that there will
    not be any confusion inside nsBrowserContentHandler.defaultArgs
    as to whether a one time session restore will occur.
    
    Also, for consistency and in case someone looks at the pref,
    avoid setting browser.sessionstore.resume_session = true during
    browser shutdown.
    
    This bug occurred when staging was not used during the update
    process. On Windows it always occurred because staging is not
    used even when it should be (see #18292).
---
 browser/components/nsBrowserGlue.js                 | 4 +++-
 browser/components/sessionstore/SessionStore.jsm    | 5 ++++-
 browser/components/sessionstore/nsSessionStartup.js | 4 ++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
index 61e070f..20fefe6 100644
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -226,7 +226,9 @@ BrowserGlue.prototype = {
     if (!this._saveSession && !aForce)
       return;
 
-    Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
+    if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
+      Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
+    }
 
     // This method can be called via [NSApplication terminate:] on Mac, which
     // ends up causing prefs not to be flushed to disk, so we need to do that
diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm
index 64017f7..3b963bf 100644
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -1165,7 +1165,10 @@ let SessionStoreInternal = {
    */
   onQuitApplication: function ssi_onQuitApplication(aData) {
     if (aData == "restart") {
-      this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
+      if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
+        this._prefBranch.setBoolPref("sessionstore.resume_session_once", true);
+      }
+
       // The browser:purge-session-history notification fires after the
       // quit-application notification so unregister the
       // browser:purge-session-history notification to prevent clearing
diff --git a/browser/components/sessionstore/nsSessionStartup.js b/browser/components/sessionstore/nsSessionStartup.js
index 7c09a61..faf7863 100644
--- a/browser/components/sessionstore/nsSessionStartup.js
+++ b/browser/components/sessionstore/nsSessionStartup.js
@@ -291,6 +291,10 @@ SessionStartup.prototype = {
    * @returns bool
    */
   isAutomaticRestoreEnabled: function () {
+    if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
+      return false;
+    }
+
     return Services.prefs.getBoolPref("browser.sessionstore.resume_session_once") ||
            Services.prefs.getIntPref("browser.startup.page") == BROWSER_STARTUP_RESUME_SESSION;
   },



More information about the tbb-commits mailing list