service-worker.js 445 B

12345678910111213141516
  1. // service worker for PWA (progressive web app)
  2. self.addEventListener('install', (event) => {
  3. // console.log('👷', 'install', event);
  4. self.skipWaiting();
  5. });
  6. self.addEventListener('activate', (event) => {
  7. // console.log('👷', 'activate', event);
  8. return self.clients.claim();
  9. });
  10. self.addEventListener('fetch', function (event) {
  11. // console.log('👷', 'fetch', event);
  12. event.respondWith(fetch(event.request));
  13. });