1 2 3 4 5 6 7 8 9 10 11 12 13
<script> async function register(script, scope) { const registration = await navigator.serviceWorker.register( script, {scope: scope}); await new Promise(resolve => registration.installing.addEventListener('statechange', resolve)); } async function initialize() { await register('no-respond-with-service-worker.js', './'); document.title = 'Done'; } initialize(); </script>