Skip to content

Instantly share code, notes, and snippets.

@deanhume
Last active February 14, 2016 20:39
Show Gist options
  • Save deanhume/3376be9fb5cf745ba95d to your computer and use it in GitHub Desktop.
Save deanhume/3376be9fb5cf745ba95d to your computer and use it in GitHub Desktop.
Service Worker Toolbox Boilerplate
(global => {
'use strict';
// Load the sw-toolbox library.
importScripts('/bower_components/sw-toolbox/sw-toolbox.js');
// Ensure that our service worker takes control of the page as soon as possible.
global.addEventListener('install', event => event.waitUntil(global.skipWaiting()));
global.addEventListener('activate', event => event.waitUntil(global.clients.claim()));
})(self);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment