mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-03 09:48:38 +02:00
65 lines
1.5 KiB
HTML
65 lines
1.5 KiB
HTML
<html>
|
|
<head>
|
|
<title></title>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function startCleanWorker() {
|
|
var worker = new Worker("cleanWorker.js");
|
|
|
|
worker.onmessage = function(event) {
|
|
if (event.data == "success") {
|
|
window.parent.postMessage("success:blocked importScripts('evilWorker.js')", "*");
|
|
} else {
|
|
window.parent.postMessage("failure:failed to block importScripts('evilWorker.js')", "*");
|
|
}
|
|
window.parent.postMessage("finish", "*");
|
|
};
|
|
|
|
worker.onerror = function() {
|
|
window.parent.postmessage("failure:failed to load cleanWorker.js", "*");
|
|
window.parent.postMessage("finish", "*");
|
|
};
|
|
|
|
worker.postMessage("");
|
|
}
|
|
|
|
function startEvilWorker() {
|
|
var worker = new Worker("evilWorker.js");
|
|
|
|
worker.onmessage = function() {
|
|
window.parent.postMessage("failure:failed to block evilWorker.js", "*");
|
|
startUnwantedWorker();
|
|
};
|
|
|
|
worker.onerror = function() {
|
|
window.parent.postMessage("success:blocked evilWorker.js", "*");
|
|
startUnwantedWorker();
|
|
};
|
|
|
|
worker.postMessage("");
|
|
}
|
|
|
|
function startUnwantedWorker() {
|
|
var worker = new Worker("unwantedWorker.js");
|
|
|
|
worker.onmessage = function() {
|
|
window.parent.postMessage("failure:failed to block unwantedWorker.js", "*");
|
|
startCleanWorker();
|
|
};
|
|
|
|
worker.onerror = function() {
|
|
window.parent.postMessage("success:blocked unwantedWorker.js", "*");
|
|
startCleanWorker();
|
|
};
|
|
|
|
worker.postMessage("");
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body onload="startEvilWorker()">
|
|
</body>
|
|
</html>
|