moebius#226: Consider blocking top level window data: URIs (part 2/2 without tests)

https://github.com/MoonchildProductions/moebius/pull/226
This commit is contained in:
janekptacijarabaci 2018-04-22 19:03:22 +02:00 committed by Roy Tam
commit 73f89fe562
16 changed files with 194 additions and 66 deletions

View file

@ -21,16 +21,12 @@ function test1() {
// simple data: URI click navigation should be prevented
let TEST_FILE = "file_block_toplevel_data_navigation.html";
let win1 = window.open(TEST_FILE);
var readyStateCheckInterval = setInterval(function() {
let state = win1.document.readyState;
if (state === "interactive" || state === "complete") {
clearInterval(readyStateCheckInterval);
ok(win1.document.body.innerHTML.indexOf("test1:") !== -1,
"toplevel data: URI navigation through click() should be blocked");
win1.close();
test2();
}
}, 200);
setTimeout(function () {
ok(SpecialPowers.wrap(win1).document.body.innerHTML.indexOf("test1:") !== -1,
"toplevel data: URI navigation through click() should be blocked");
win1.close();
test2();
}, 1000);
}
function test2() {