Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Last active December 13, 2016 10:31
Show Gist options
  • Save jakearchibald/060ae42e4153837b9d9dc61e3053c975 to your computer and use it in GitHub Desktop.
Save jakearchibald/060ae42e4153837b9d9dc61e3053c975 to your computer and use it in GitHub Desktop.
console.log('fetch-event.js executed');
<!DOCTYPE html>
<script>
navigator.serviceWorker.register('sw.js');
</script>
console.log('install-and-fetch.js executed');
console.log('install-event.js executed');
console.log('root-and-fetch.js executed');
console.log('root.js executed');
importScripts('root.js');
importScripts('root-and-fetch.js');
addEventListener('install', () => {
importScripts('install-event.js');
importScripts('install-and-fetch.js');
});
addEventListener('fetch', () => {
importScripts('root-and-fetch.js');
importScripts('install-and-fetch.js');
importScripts('fetch-event.js');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment