mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 702556 - JS exception "aTabs[0].linkedBrowser is null" in nsSessionStore.js [r=dietrich]
This commit is contained in:
parent
ae077178d1
commit
778415b671
@ -2981,8 +2981,9 @@ SessionStoreService.prototype = {
|
||||
restoreHistory:
|
||||
function sss_restoreHistory(aWindow, aTabs, aTabData, aIdMap, aDocIdentMap) {
|
||||
var _this = this;
|
||||
while (aTabs.length > 0 && (!aTabs[0].linkedBrowser.__SS_tabStillLoading || !aTabs[0].parentNode)) {
|
||||
aTabs.shift(); // this tab got removed before being completely restored
|
||||
// if the tab got removed before being completely restored, then skip it
|
||||
while (aTabs.length > 0 && !(this._canRestoreTabHistory(aTabs[0]))) {
|
||||
aTabs.shift();
|
||||
aTabData.shift();
|
||||
}
|
||||
if (aTabs.length == 0) {
|
||||
@ -3996,6 +3997,20 @@ SessionStoreService.prototype = {
|
||||
!aTabState.userTypedValue);
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if we can restore history into this tab.
|
||||
* This will be false when a tab has been removed (usually between
|
||||
* restoreHistoryPrecursor && restoreHistory) or if the tab is still marked
|
||||
* as loading.
|
||||
*
|
||||
* @param aTab
|
||||
* @returns boolean
|
||||
*/
|
||||
_canRestoreTabHistory: function sss__canRestoreTabHistory(aTab) {
|
||||
return aTab.parentNode && aTab.linkedBrowser &&
|
||||
aTab.linkedBrowser.__SS_tabStillLoading;
|
||||
},
|
||||
|
||||
/**
|
||||
* This is going to take a state as provided at startup (via
|
||||
* nsISessionStartup.state) and split it into 2 parts. The first part
|
||||
|
Loading…
x
Reference in New Issue
Block a user