diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index af58c941f6f0..4c4d48578e29 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -1140,19 +1140,14 @@ SessionStoreService.prototype = { * Store all session data for a window * @param aWindow * Window reference - * @param aPinnedOnly - * Bool collect pinned tabs only */ - _saveWindowHistory: function sss_saveWindowHistory(aWindow, aPinnedOnly) { + _saveWindowHistory: function sss_saveWindowHistory(aWindow) { var tabbrowser = aWindow.gBrowser; var tabs = tabbrowser.tabs; var tabsData = this._windows[aWindow.__SSi].tabs = []; - for (var i = 0; i < tabs.length; i++) { - if (aPinnedOnly && !tabs[i].pinned) - break; + for (var i = 0; i < tabs.length; i++) tabsData.push(this._collectTabData(tabs[i])); - } this._windows[aWindow.__SSi].selected = tabbrowser.mTabBox.selectedIndex + 1; }, @@ -1440,15 +1435,16 @@ SessionStoreService.prototype = { */ _updateTextAndScrollData: function sss_updateTextAndScrollData(aWindow) { var browsers = aWindow.gBrowser.browsers; - this._windows[aWindow.__SSi].tabs.forEach(function (tabData, i) { - if (browsers[i].__SS_data && - browsers[i].__SS_data._tabStillLoading) - return; // ignore incompletely initialized tabs + for (var i = 0; i < browsers.length; i++) { try { + var tabData = this._windows[aWindow.__SSi].tabs[i]; + if (browsers[i].__SS_data && + browsers[i].__SS_data._tabStillLoading) + 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) - }, this); + } }, /** @@ -1773,7 +1769,7 @@ SessionStoreService.prototype = { if (!this._isWindowLoaded(aWindow)) // window data is still in _statesToRestore return; if (aUpdateAll || this._dirtyWindows[aWindow.__SSi] || aWindow == activeWindow) { - this._collectWindowData(aWindow, aPinnedOnly); + this._collectWindowData(aWindow); } else { // always update the window features (whose change alone never triggers a save operation) this._updateWindowFeatures(aWindow); @@ -1861,12 +1857,12 @@ SessionStoreService.prototype = { return { windows: total }; }, - _collectWindowData: function sss_collectWindowData(aWindow, aPinnedOnly) { + _collectWindowData: function sss_collectWindowData(aWindow) { if (!this._isWindowLoaded(aWindow)) return; // update the internal state data for this window - this._saveWindowHistory(aWindow, aPinnedOnly); + this._saveWindowHistory(aWindow); this._updateTextAndScrollData(aWindow); this._updateCookieHosts(aWindow); this._updateWindowFeatures(aWindow);