JAVASCRIPT   31

service-worker

Guest on 7th May 2022 03:53:29 PM

  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.  
  14. importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
  15.  
  16. importScripts(
  17.   "/mvp/res/precache-manifest.dbe4176bd8a5afc1c6a397e455cbf58e.js"
  18. );
  19.  
  20. self.addEventListener('message', (event) => {
  21.   if (event.data && event.data.type === 'SKIP_WAITING') {
  22.     self.skipWaiting();
  23.   }
  24. });
  25.  
  26. workbox.core.clientsClaim();
  27.  
  28. /**
  29.  * The workboxSW.precacheAndRoute() method efficiently caches and responds to
  30.  * requests for URLs in the manifest.
  31.  * See https://goo.gl/S9QRab
  32.  */
  33. self.__precacheManifest = [].concat(self.__precacheManifest || []);
  34. workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
  35.  
  36. workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/mvp/res/index.html"), {
  37.  
  38.   blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
  39. });

Raw Paste


Login or Register to edit or fork this paste. It's free.