Source code

Revision control

Copy as Markdown

Other Tools

<head>
<title>frame for storage prevented test</title>
<script type="text/javascript">
task(async function() {
// We shouldn't be able to access storage
await storagePrevented();
// This hash of the URI is set to #nullprincipal by the test if the current page has a null principal,
// and thus attempting to create a dedicated worker will throw
if (location.hash == "#nullprincipal") {
function createWorker() {
return new Promise((resolve, reject) => {
var w;
try {
w = new Worker("workerStoragePrevented.js#outer");
} catch (e) {
ok(true, "Running workers was prevented");
resolve();
}
w.onerror = function() {
ok(true, "Running workers was prevented");
resolve();
}
});
}
await createWorker();
return;
}
// Try to run a worker, which shouldn't be able to access storage
await runWorker("workerStoragePrevented.js#outer");
});
</script>
</head>
<body>
</body>
</html>