Bug 1639095 - Re-remove allowLinkedWebInFileUriProcess r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D78457
This commit is contained in:
Paul Bone 2020-09-02 03:43:41 +00:00
Родитель ab59636fca
Коммит 387c5f9ad3
2 изменённых файлов: 2 добавлений и 41 удалений

Просмотреть файл

@ -218,21 +218,13 @@ add_task(async function test_enabled() {
// should succeed.
info("ENABLED -- FILE -- raw URI load");
let resp = await postFrom(FILE_DUMMY, PRINT_POSTDATA);
if (SpecialPowers.useRemoteSubframes) {
ok(E10SUtils.isWebRemoteType(resp.remoteType), "process switch");
} else {
is(resp.remoteType, E10SUtils.FILE_REMOTE_TYPE, "No process switch");
}
ok(E10SUtils.isWebRemoteType(resp.remoteType), "process switch");
is(resp.location, PRINT_POSTDATA, "correct location");
is(resp.body, "initialRemoteType=file", "correct POST body");
info("ENABLED -- FILE -- 307-redirect URI load");
let resp307 = await postFrom(FILE_DUMMY, add307(PRINT_POSTDATA));
if (SpecialPowers.useRemoteSubframes) {
ok(E10SUtils.isWebRemoteType(resp307.remoteType), "process switch");
} else {
is(resp307.remoteType, E10SUtils.FILE_REMOTE_TYPE, "No process switch");
}
ok(E10SUtils.isWebRemoteType(resp307.remoteType), "process switch");
is(resp307.location, PRINT_POSTDATA, "correct location");
is(resp307.body, "initialRemoteType=file", "correct POST body");

Просмотреть файл

@ -271,37 +271,6 @@ function validatedWebRemoteType(
return aPreferredRemoteType;
}
if (
aPreferredRemoteType == FILE_REMOTE_TYPE &&
!aRemoteSubframes &&
!aIsWorker
) {
E10SUtils.log().debug("checking allowLinkedWebInFileUriProcess");
if (!aCurrentUri) {
E10SUtils.log().debug("No aCurrentUri");
return FILE_REMOTE_TYPE;
}
// If aCurrentUri is passed then we should only allow FILE_REMOTE_TYPE
// when it is same origin as target or the current URI is already a
// file:// URI.
if (aCurrentUri.scheme == "file" || aCurrentUri.spec == "about:blank") {
return FILE_REMOTE_TYPE;
}
try {
// checkSameOriginURI throws when not same origin.
// todo: if you intend to update CheckSameOriginURI to log the error to the
// console you also need to update the 'aFromPrivateWindow' argument.
sm.checkSameOriginURI(aCurrentUri, aTargetUri, false, false);
E10SUtils.log().debug("Next URL is same origin");
return FILE_REMOTE_TYPE;
} catch (e) {
E10SUtils.log().debug("Leaving same origin");
return WEB_REMOTE_TYPE;
}
}
return WEB_REMOTE_TYPE;
}