service-worker.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Welcome to your Workbox-powered service worker!
  3. *
  4. * You'll need to register this file in your web app and you should
  5. * disable HTTP caching for this file too.
  6. * See https://goo.gl/nhQhGp
  7. *
  8. * The rest of the code is auto-generated. Please don't update this file
  9. * directly; instead, make changes to your Workbox build configuration
  10. * and re-run your build process.
  11. * See https://goo.gl/2aRDsh
  12. */
  13. importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
  14. importScripts(
  15. "/precache-manifest.f415d1bd39d0d5fc805a5ee834011d3e.js"
  16. );
  17. self.addEventListener('message', (event) => {
  18. if (event.data && event.data.type === 'SKIP_WAITING') {
  19. self.skipWaiting();
  20. }
  21. });
  22. workbox.core.clientsClaim();
  23. /**
  24. * The workboxSW.precacheAndRoute() method efficiently caches and responds to
  25. * requests for URLs in the manifest.
  26. * See https://goo.gl/S9QRab
  27. */
  28. self.__precacheManifest = [].concat(self.__precacheManifest || []);
  29. workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
  30. workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/index.html"), {
  31. blacklist: [/^\/_/,/\/[^\/]+\.[^\/]+$/],
  32. });