Bug 1394765 - Remove broken code that attempts to update the initial browser's remoteness based on the homepage.
This code wasn't working properly due to the string check being broken, and if it worked it would be wrong when restoring a session rather than loading the homepage.
MozReview-Commit-ID: 7rEsRcBLg9N
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1237,44 +1237,32 @@ var gBrowserInit = {
// remoteType and sameProcessAsFrameLoader are passed through to
// updateBrowserRemoteness as part of an options object, which itself defaults
// to an empty object. So defaulting them to undefined here will cause the
// default behavior in updateBrowserRemoteness if they don't get set.
let isRemote = gMultiProcessBrowser;
let remoteType;
let sameProcessAsFrameLoader;
- if (window.arguments) {
- let argToLoad = window.arguments[0];
- if (argToLoad instanceof XULElement) {
- // The window's first argument is a tab if and only if we are swapping tabs.
- // We must set the browser's usercontextid before updateBrowserRemoteness(),
- // so that the newly created remote tab child has the correct usercontextid.
- if (argToLoad.hasAttribute("usercontextid")) {
- initBrowser.setAttribute("usercontextid",
- argToLoad.getAttribute("usercontextid"));
- }
-
- let linkedBrowser = argToLoad.linkedBrowser;
- if (linkedBrowser) {
- remoteType = linkedBrowser.remoteType;
- isRemote = remoteType != E10SUtils.NOT_REMOTE;
- sameProcessAsFrameLoader = linkedBrowser.frameLoader;
- }
- } else if (argToLoad instanceof String) {
- // argToLoad is String, so should be a URL.
- remoteType = E10SUtils.getRemoteTypeForURI(argToLoad, gMultiProcessBrowser);
+
+ let tabArgument = window.arguments && window.arguments[0];
+ if (tabArgument instanceof XULElement) {
+ // The window's first argument is a tab if and only if we are swapping tabs.
+ // We must set the browser's usercontextid before updateBrowserRemoteness(),
+ // so that the newly created remote tab child has the correct usercontextid.
+ if (tabArgument.hasAttribute("usercontextid")) {
+ initBrowser.setAttribute("usercontextid",
+ tabArgument.getAttribute("usercontextid"));
+ }
+
+ let linkedBrowser = tabArgument.linkedBrowser;
+ if (linkedBrowser) {
+ remoteType = linkedBrowser.remoteType;
isRemote = remoteType != E10SUtils.NOT_REMOTE;
- } else if (argToLoad instanceof Ci.nsIArray) {
- // argToLoad is nsIArray, so should be an array of URLs, set the remote
- // type for the initial browser to match the first one.
- let urisstring = argToLoad.queryElementAt(0, Ci.nsISupportsString);
- remoteType = E10SUtils.getRemoteTypeForURI(urisstring.data,
- gMultiProcessBrowser);
- isRemote = remoteType != E10SUtils.NOT_REMOTE;
+ sameProcessAsFrameLoader = linkedBrowser.frameLoader;
}
}
gBrowser.updateBrowserRemoteness(initBrowser, isRemote, {
remoteType, sameProcessAsFrameLoader
});
},