blob: bec24f698278cb662dc25c6c7f4ca0cfc851b25f [file] [log] [blame]
<html>
<body>
<script>
var scope = "/appcache/resources";
var script = "/appcache/service-worker-proxy.js";
async function registerServiceWorker()
{
var registration = await navigator.serviceWorker.register(script, { scope : scope });
await new Promise(resolve => {
if (registration.active)
resolve(registration);
worker = registration.installing;
worker.addEventListener("statechange", () => {
if (worker.state === "activated")
resolve(registration);
});
});
}
</script>
</body>
</html>