Bug 1226781 - only manually switch remoteness if we were trying to switch remoteness to begin with, r=mconley
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -848,24 +848,29 @@ function _loadURIWithFlags(browser, uri,
uri: uri,
flags: flags,
referrer: referrer ? referrer.spec : null,
referrerPolicy: referrerPolicy,
postData: postData,
});
}
} catch (e) {
- // If anything goes wrong just switch remoteness manually and load the URI.
+ // If anything goes wrong when switching remoteness, just switch remoteness
+ // manually and load the URI.
// We might lose history that way but at least the browser loaded a page.
// This might be necessary if SessionStore wasn't initialized yet i.e.
// when the homepage is a non-remote page.
- Cu.reportError(e);
- gBrowser.updateBrowserRemotenessByURL(browser, uri);
- browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
- postData, null, null);
+ if (mustChangeProcess) {
+ Cu.reportError(e);
+ gBrowser.updateBrowserRemotenessByURL(browser, uri);
+ browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
+ postData, null, null);
+ } else {
+ throw e;
+ }
} finally {
if (browser.userTypedClear) {
browser.userTypedClear--;
}
}
}
// Starts a new load in the browser first switching the browser to the correct