1////í¸ìê´ë ¨ 2//console.log('ìë¹ì¤ì커 ë¡ëë¨...'); 3//self.addEventListener('push', (e) => { 4// const data = e.data.json(); 5// console.log(data); 6// console.log('PUSH ë°ì'); 7// 8// self.registration.showNotification(data.title, { 9// body: 'í¸ì í ì¤í¸ì ëë¤.', 10// icon: 'https://cdn.icon-icons.com/icons2/1482/PNG/512/22website_102116.png', 11// }); 12//}); 13// ìºì ì´ë¦ 14const CACHE_NAME = "cache-v1"; 15 16// ìºì±í íì¼ 17const FILES_TO_CACHE = [ 18 "/offline.html", 19 "/img/favicon-152.png" 20]; 21 22// ìì í íì¼ ìºì± 23self.addEventListener("install", (event) => { 24 event.waitUntil( 25 caches.open(CACHE_NAME).then((cache) => cache.addAll(FILES_TO_CACHE)) 26 ); 27}); 28 29// CACHE_NAMEì´ ë³ê²½ëë©´ ì¤ëë ìºì ìì 30self.addEventListener("activate", (event) => { 31 event.waitUntil( 32 caches.keys().then((keyList) => 33 Promise.all( 34 keyList.map((key) => { 35 if (CACHE_NAME !== key) return caches.delete(key); 36 }) 37 ) 38 ) 39 ); 40}); 41 42// ìì²ì ì¤í¨íë©´ ì¤íë¼ì¸ íì´ì§ íì 43self.addEventListener("fetch", (event) => { 44 if ("navigate" !== event.request.mode) return; 45 46 event.respondWith( 47 fetch(event.request).catch(() => 48 caches 49 .open(CACHE_NAME) 50 .then((cache) => cache.match("/offline.html")) 51 ) 52 ); 53}); 54
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.