Bug 1016759 - session restore not fully working r=IanN a=Callek for CLOSED TREE BETA_BASE_20150112
authorLemon Juice <michal-ok@o2.pl>
Sat, 03 Jan 2015 04:29:00 +0800
changeset 21392 041dfe66d51ff1a66d29b86ea56b4295f8ea4bed
parent 21391 156340fdb85ed8ecabc17ea19eac5664d33f7790
child 21393 f2d509c63a2a0e2c536f902effd13d2ba5962042
push idunknown
push userunknown
push dateunknown
reviewersIanN, Callek
bugs1016759
Bug 1016759 - session restore not fully working r=IanN a=Callek for CLOSED TREE
suite/common/src/nsSessionStore.js
--- a/suite/common/src/nsSessionStore.js
+++ b/suite/common/src/nsSessionStore.js
@@ -1417,17 +1417,18 @@ SessionStoreService.prototype = {
    */
   _collectTabData: function sss_collectTabData(aTab, aFullData) {
     var tabData = { entries: [] };
     var browser = aTab.linkedBrowser;
 
     if (!browser || !browser.currentURI)
       // can happen when calling this function right after .addTab()
       return tabData;
-    else if (browser.__SS_data) {
+    else if (browser.__SS_data &&
+             browser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE) {
       // use the data to be restored when the tab hasn't been completely loaded
       tabData = browser.__SS_data;
       if (aTab.pinned)
         tabData.pinned = true;
       else
         delete tabData.pinned;
       tabData.hidden = aTab.hidden;
 
@@ -1731,17 +1732,18 @@ SessionStoreService.prototype = {
    * @param aWindow
    *        Window reference
    */
   _updateTextAndScrollData: function sss_updateTextAndScrollData(aWindow) {
     var browsers = aWindow.getBrowser().browsers;
     for (var i = 0; i < browsers.length; i++) {
       try {
         var tabData = this._windows[aWindow.__SSi].tabs[i];
-        if (browsers[i].__SS_data)
+        if (browsers[i].__SS_data &&
+            browsers[i].__SS_restoreState == TAB_STATE_NEEDS_RESTORE)
           continue; // ignore incompletely initialized tabs
         this._updateTextAndScrollDataForTab(aWindow, browsers[i], tabData);
       }
       catch (ex) { debug(ex); } // get as much data as possible, ignore failures (might succeed the next time)
     }
   },
 
   /**