-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice-worker.js
1 lines (1 loc) · 1.3 KB
/
service-worker.js
1
!function(){"use strict";const e=["client/Stats.608c084a.js","client/client.8089f854.js","client/index.8259af61.js","client/index.a09284ec.js","client/index.6fe97dda.js","client/index.40d8ef94.js","client/index.5aea8b28.js","client/client.5c0b1900.js"].concat(["service-worker-index.html","exit-button.png","favicon.png","game-complete.png","global.css","great-success.png","logo-192.png","logo-512.png","manifest.json","mult-practice.png"]),t=new Set(e);self.addEventListener("install",t=>{t.waitUntil(caches.open("cache1586804221856").then(t=>t.addAll(e)).then(()=>{self.skipWaiting()}))}),self.addEventListener("activate",e=>{e.waitUntil(caches.keys().then(async e=>{for(const t of e)"cache1586804221856"!==t&&await caches.delete(t);self.clients.claim()}))}),self.addEventListener("fetch",e=>{if("GET"!==e.request.method||e.request.headers.has("range"))return;const n=new URL(e.request.url);n.protocol.startsWith("http")&&(n.hostname===self.location.hostname&&n.port!==self.location.port||(n.host===self.location.host&&t.has(n.pathname)?e.respondWith(caches.match(e.request)):"only-if-cached"!==e.request.cache&&e.respondWith(caches.open("offline1586804221856").then(async t=>{try{const n=await fetch(e.request);return t.put(e.request,n.clone()),n}catch(n){const s=await t.match(e.request);if(s)return s;throw n}}))))})}();