Skip to content

Instantly share code, notes, and snippets.

@FesterCluck
Created August 16, 2017 18:30
Show Gist options
  • Save FesterCluck/24455c01fe913c677f2749c94a630eed to your computer and use it in GitHub Desktop.
Save FesterCluck/24455c01fe913c677f2749c94a630eed to your computer and use it in GitHub Desktop.
serviceworker logger
self.addEventListener('install', event => {
event.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', event => {
console.log(event.request); event.respondWith(fetch(event.request));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment