gecko-dev/dom/html/test/bug445004-inner.js
Victor Porof 0a8ff0ad85 Bug 1561435 - Format dom/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35951

--HG--
extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
2019-07-05 10:44:55 +02:00

28 lines
735 B
JavaScript

document.domain = "example.org";
function $(str) {
return document.getElementById(str);
}
function hookLoad(str) {
$(str).onload = function() {
window.parent.parent.postMessage("end", "*");
};
window.parent.parent.postMessage("start", "*");
}
window.onload = function() {
hookLoad("w");
$("w").contentWindow.location.href = "test1.example.org.png";
hookLoad("x");
var doc = $("x").contentDocument;
doc.write('<img src="test1.example.org.png">');
doc.close();
};
function doIt() {
hookLoad("y");
$("y").contentWindow.location.href = "example.org.png";
hookLoad("z");
var doc = $("z").contentDocument;
doc.write('<img src="example.org.png">');
doc.close();
}
window.addEventListener("message", doIt);