Download docs/sw.js from Snapkitty/snapkitty-clojure-lisp-bridge: direct link, hf CLI and curl.
- Browser
- Download file 650 Bytes
-
https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/docs/sw.js
- Command line
-
hf download hf://Snapkitty/snapkitty-clojure-lisp-bridge/docs/sw.js
-
curl -L -o sw.js https://huggingface.co/Snapkitty/snapkitty-clojure-lisp-bridge/resolve/main/docs/sw.js
650 Bytes
| const CACHE = 'snapkitty-sovereign-v1.1' | |
| const CORE = ['/sovereign-emulator/', '/sovereign-emulator/index.html'] | |
| self.addEventListener('install', e => { | |
| self.skipWaiting() | |
| e.waitUntil(caches.open(CACHE).then(c => c.addAll(CORE).catch(() => {}))) | |
| }) | |
| self.addEventListener('activate', e => { | |
| e.waitUntil( | |
| caches.keys().then(keys => | |
| Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k))) | |
| ) | |
| ) | |
| self.clients.claim() | |
| }) | |
| self.addEventListener('fetch', e => { | |
| e.respondWith( | |
| caches.match(e.request).then(r => r || fetch(e.request).catch(() => caches.match('/sovereign-emulator/'))) | |
| ) | |
| }) | |