Download sw.js from DevForML/lean_diet: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/spaces/DevForML/lean_diet/resolve/main/sw.js
- Command line
-
hf download hf://spaces/DevForML/lean_diet/sw.js
-
curl -L -o sw.js https://huggingface.co/spaces/DevForML/lean_diet/resolve/main/sw.js
559 Bytes
| const CACHE="lean-cut-react-v1";const ASSETS=["./","./index.html","./app.js","./styles.css","./manifest.webmanifest","./icon.svg"];self.addEventListener("install",e=>e.waitUntil(caches.open(CACHE).then(c=>c.addAll(ASSETS)).then(()=>self.skipWaiting())));self.addEventListener("activate",e=>e.waitUntil(self.clients.claim()));self.addEventListener("fetch",e=>e.respondWith(caches.match(e.request).then(r=>r||fetch(e.request).then(res=>{const c=res.clone();caches.open(CACHE).then(x=>x.put(e.request,c));return res}).catch(()=>caches.match("./index.html"))))) | |