| 1 |
/* global self */ |
| 2 |
|
| 3 |
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting |
| 4 |
self.addEventListener( 'install', function ( event ) { |
| 5 |
event.waitUntil( self.skipWaiting() ); |
| 6 |
} ); |
| 7 |
|
| 8 |
// https://developer.mozilla.org/en-US/docs/Web/API/Clients/claim |
| 9 |
self.addEventListener( 'activate', function ( event ) { |
| 10 |
event.waitUntil( self.clients.claim() ); |
| 11 |
} ); |
| 12 |
|
| 13 |
// Necessary for Chrome to show the install button. |
| 14 |
self.addEventListener( 'fetch', function () {} ); |
| 15 |
|