Last active
February 14, 2016 20:39
-
-
Save deanhume/3376be9fb5cf745ba95d to your computer and use it in GitHub Desktop.
Service Worker Toolbox Boilerplate
This file contains hidden or 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
(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