Bug 1081856: Allow javascript urls to load in any process. r=mconley

--HG--
extra : rebase_source : 6c4e534d1fce84baaeff5abb08573dd1c0cb492d
This commit is contained in:
Dave Townsend 2015-02-18 10:59:10 -08:00
parent fab8ec0afd
commit 7f897fc9f4
3 changed files with 16 additions and 0 deletions

View File

@ -484,6 +484,7 @@ skip-if = e10s # Bug 1100687 - test directly manipulates content (content.docume
[browser_e10s_switchbrowser.js]
[browser_e10s_about_process.js]
[browser_e10s_chrome_process.js]
[browser_e10s_javascript.js]
[browser_blockHPKP.js]
skip-if = e10s # bug 1100687 - test directly manipulates content (content.document.getElementById)
[browser_mcb_redirect.js]

View File

@ -0,0 +1,11 @@
const CHROME_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
const CONTENT_PROCESS = Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
add_task(function*() {
let url = "javascript:dosomething()";
ok(E10SUtils.canLoadURIInProcess(url, CHROME_PROCESS),
"Check URL in chrome process.");
ok(E10SUtils.canLoadURIInProcess(url, CONTENT_PROCESS),
"Check URL in content process.");
});

View File

@ -30,6 +30,10 @@ this.E10SUtils = {
if (!aURL)
aURL = "about:blank";
// Javascript urls can load in any process, they apply to the current document
if (aURL.startsWith("javascript:"))
return true;
let processIsRemote = aProcess == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
let canLoadRemote = true;