1const CACHE_NAME = "beat-tap-neon-v5"; 2const APP_SHELL = ["/", "/manifest.webmanifest", "/manus-storage/just-as-i-am_b621d72c.mp3", "/manus-storage/album-just-as-i-am_f4c97cca.png"]; 3 4self.addEventListener("install", (event) => { 5 event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(APP_SHELL))); 6 self.skipWaiting(); 7}); 8 9self.addEventListener("activate", (event) => { 10 event.waitUntil(caches.keys().then((keys) => Promise.all(keys.filter((key) => key !== CACHE_NAME).map((key) => caches.delete(key))))); 11 self.clients.claim(); 12}); 13 14self.addEventListener("fetch", (event) => { 15 if (event.request.method !== "GET") return; 16 const requestUrl = new URL(event.request.url); 17 if (requestUrl.pathname.startsWith("/@vite/") || requestUrl.pathname.startsWith("/src/") || requestUrl.searchParams.has("t")) { 18 event.respondWith(fetch(event.request)); 19 return; 20 } 21 event.respondWith(caches.match(event.request).then((cached) => cached || fetch(event.request).then((response) => { 22 if (response.ok && new URL(event.request.url).origin === self.location.origin) { 23 const copy = response.clone(); 24 void caches.open(CACHE_NAME).then((cache) => cache.put(event.request, copy)); 25 } 26 return response; 27 }).catch(() => caches.match("/")))); 28});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.