Download sw.js from trenesky/notesync: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/spaces/trenesky/notesync/resolve/main/sw.js
- Command line
-
hf download hf://spaces/trenesky/notesync/sw.js
-
curl -L -o sw.js https://huggingface.co/spaces/trenesky/notesync/resolve/main/sw.js
462 Bytes
| const CACHE_NAME = "notesync-cache-v1"; | |
| const urlsToCache = [ | |
| "./", | |
| "./index.html", | |
| "./manifest.json", | |
| "./sw.js", | |
| "./icon-192.png", | |
| "./icon-512.png" | |
| ]; | |
| self.addEventListener("install", event => { | |
| event.waitUntil( | |
| caches.open(CACHE_NAME).then(cache => cache.addAll(urlsToCache)) | |
| ); | |
| }); | |
| self.addEventListener("fetch", event => { | |
| event.respondWith( | |
| caches.match(event.request).then(response => response || fetch(event.request)) | |
| ); | |
| }); | |