diff --git a/browser/components/sessionstore/ContentRestore.jsm b/browser/components/sessionstore/ContentRestore.jsm index 1ff31406575b..f2cf9cc0a710 100644 --- a/browser/components/sessionstore/ContentRestore.jsm +++ b/browser/components/sessionstore/ContentRestore.jsm @@ -123,7 +123,7 @@ ContentRestoreInternal.prototype = { * non-zero) is passed through to all the callbacks. If a load in the tab * is started while it is pending, the appropriate callbacks are called. */ - restoreHistory(epoch, tabData, callbacks) { + restoreHistory(epoch, tabData, loadArguments, callbacks) { this._tabData = tabData; this._epoch = epoch; @@ -133,11 +133,13 @@ ContentRestoreInternal.prototype = { // Make sure currentURI is set so that switch-to-tab works before the tab is // restored. We'll reset this to about:blank when we try to restore the tab - // to ensure that docshell doeesn't get confused. + // to ensure that docshell doeesn't get confused. Don't bother doing this if + // we're restoring immediately due to a process switch. It just causes the + // URL bar to be temporarily blank. let activeIndex = tabData.index - 1; let activePageData = tabData.entries[activeIndex] || {}; let uri = activePageData.url || null; - if (uri) { + if (uri && !loadArguments) { webNavigation.setCurrentURI(Utils.makeURI(uri)); } @@ -191,8 +193,11 @@ ContentRestoreInternal.prototype = { // Reset the current URI to about:blank. We changed it above for // switch-to-tab, but now it must go back to the correct value before the - // load happens. - webNavigation.setCurrentURI(Utils.makeURI("about:blank")); + // load happens. Don't bother doing this if we're restoring immediately + // due to a process switch. + if (!loadArguments) { + webNavigation.setCurrentURI(Utils.makeURI("about:blank")); + } try { if (loadArguments) { diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 7dea211a4d82..44654f2ee277 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -2689,7 +2689,7 @@ let SessionStoreInternal = { }); browser.messageManager.sendAsyncMessage("SessionStore:restoreHistory", - {tabData: tabData, epoch: epoch}); + {tabData: tabData, epoch: epoch, loadArguments}); // Restore tab attributes. if ("attributes" in tabData) { diff --git a/browser/components/sessionstore/content/content-sessionStore.js b/browser/components/sessionstore/content/content-sessionStore.js index b48547ed1b8a..16b95cf30585 100644 --- a/browser/components/sessionstore/content/content-sessionStore.js +++ b/browser/components/sessionstore/content/content-sessionStore.js @@ -132,8 +132,8 @@ let MessageListener = { } }, - restoreHistory({epoch, tabData}) { - gContentRestore.restoreHistory(epoch, tabData, { + restoreHistory({epoch, tabData, loadArguments}) { + gContentRestore.restoreHistory(epoch, tabData, loadArguments, { onReload() { // Inform SessionStore.jsm about the reload. It will send // restoreTabContent in response.