Bug 1472212 - Handle navigation away from privileged content process in RDM.
Author: J. Ryan Stinnett <jryans@gmail.com>
Now that we are running about:home in the privileged content process, clicking
on a link in Activity Stream while having RDM activated will close the RDM
because a process flip will occur. This causes the following tests to time out
because the RDM has been deactivated:
- devtools/client/responsive.html/test/browser/browser_container_tab.js
- devtools/client/responsive.html/test/browser/browser_preloaded_newtab.js
This patch disables RDM in about:home and will load about:blank instead when
RDM is enabled.
MozReview-Commit-ID: D5EMyfkOM8l
--- a/devtools/client/responsive.html/browser/swap.js
+++ b/devtools/client/responsive.html/browser/swap.js
@@ -97,29 +97,41 @@ function swapToInnerBrowser({ tab, conta
browser.loadURI(uri, options);
});
}
return {
async start() {
// In some cases, such as a preloaded browser used for about:newtab, browser code
- // will force a new frameloader on next navigation to ensure balanced process
- // assignment. If this case will happen here, navigate to about:blank first to get
- // this out of way so that we stay within one process while RDM is open.
- const { newFrameloader } = E10SUtils.shouldLoadURIInBrowser(
- tab.linkedBrowser,
- "about:blank"
+ // will force a new frameloader on next navigation to remote content to ensure
+ // balanced process assignment. If this case will happen here, navigate to
+ // about:blank first to get this out of way so that we stay within one process while
+ // RDM is open. Some process selection rules are specific to remote content, so we
+ // use `http://example.com` as a test for what a remote navigation would cause.
+ const {
+ requiredRemoteType,
+ mustChangeProcess,
+ newFrameloader
+ } = E10SUtils.shouldLoadURIInBrowser(
+ tab.linkedBrowser,
+ "http://example.com"
);
if (newFrameloader) {
debug(`Tab will force a new frameloader on navigation, load about:blank first`);
await loadURIWithNewFrameLoader(tab.linkedBrowser, "about:blank", {
flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
});
}
+ if (mustChangeProcess) {
+ debug(`Tab will force a process flip on navigation, load about:blank first`);
+ gBrowser.updateBrowserRemoteness(tab.linkedBrowser, true, {
+ remoteType: requiredRemoteType,
+ });
+ }
tab.isResponsiveDesignMode = true;
// Hide the browser content temporarily while things move around to avoid displaying
// strange intermediate states.
tab.linkedBrowser.style.visibility = "hidden";
// Freeze navigation temporarily to avoid "blinking" in the location bar.