Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Last active January 19, 2016 06:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakearchibald/2f0189102b21ac37f132 to your computer and use it in GitHub Desktop.
Save jakearchibald/2f0189102b21ac37f132 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
Registering service worker…
<script>
navigator.serviceWorker.register('sw.js');
navigator.serviceWorker.ready.then(() => window.location.reload());
</script>
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