mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 02:05:42 +00:00
0a8ff0ad85
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35951 --HG-- extra : source : 62f3501af4bc1c0bd1ee1977a28aee04706a6663
28 lines
735 B
JavaScript
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);
|