1
0
Fork 0
firefox/dom/security/test/csp/file_service_worker.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

21 lines
509 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Bug 1208559 - ServiceWorker registration not governed by CSP</title>
</head>
<body>
<script>
function finish(status) {
window.parent.postMessage({result: status}, "*");
}
const promises = [
navigator.serviceWorker.ready,
navigator.serviceWorker.register("file_service_worker.js", { scope: "." })
];
Promise.race(promises).then(finish.bind(null, 'allowed'),
finish.bind(null, 'blocked'));
</script>
</body>
</html>