-
-
Save jakearchibald/2f0189102b21ac37f132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
Registering service worker… | |
<script> | |
navigator.serviceWorker.register('sw.js'); | |
navigator.serviceWorker.ready.then(() => window.location.reload()); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('fetch', event => { | |
event.respondWith( | |
new Response("Here's a random number " + Math.random()) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment