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
--- 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