Bug 1364483 - Take customizemode attribute into account when saving tabs to disk. r?mikedeboer draft
authorMatheus Longaray <mlongaray@hp.com>
Mon, 15 May 2017 13:21:54 -0300
changeset 577919 3bc506de6dc66ee795e69a61699dd2424625d13d
parent 577862 0f4df67c5f162e00d6f52825badf468aefbfba19
child 628625 cddaef99133dd563b7b93a5a33fe5411b33c8568
push id58825
push userbmo:mlongaray@hp.com
push dateMon, 15 May 2017 16:24:03 +0000
reviewersmikedeboer
bugs1364483
milestone55.0a1
Bug 1364483 - Take customizemode attribute into account when saving tabs to disk. r?mikedeboer This patch adds customizemode attribute data validation when saving tabs to disk. MozReview-Commit-ID: 2GFXpApi0iQ
browser/components/sessionstore/SessionStore.jsm
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -4258,19 +4258,22 @@ var SessionStoreInternal = {
    * session state to disk. This method is very similar to _shouldSaveTabState,
    * however, "about:blank" and "about:newtab" tabs will still be saved to disk.
    *
    * @param aTabState
    *        The current tab state
    * @returns boolean
    */
   _shouldSaveTab: function ssi_shouldSaveTab(aTabState) {
-    // If the tab has one of the following transient about: history entry,
-    // then we don't actually want to write this tab's data to disk.
+    // If the tab has one of the following transient about: history entry, no
+    // userTypedValue, and no customizemode attribute, then we don't actually
+    // want to write this tab's data to disk.
     return aTabState.userTypedValue ||
+           (aTabState.attributes &&
+            aTabState.attributes.customizemode == "true") ||
            (aTabState.entries.length &&
             !(aTabState.entries[0].url == "about:printpreview" ||
               aTabState.entries[0].url == "about:privatebrowsing"));
   },
 
   /**
    * This is going to take a state as provided at startup (via
    * nsISessionStartup.state) and split it into 2 parts. The first part