PageSourceSearch

https://www.peninsula.mx/sw-encuestasr.js

js peninsula.mx collected 2026-10-09 01:41:12 UTC 1,218 bytes, 48 lines download raw bytes

1const CACHE_NAME = 'encuestasr-v2';
2
3self.addEventListener('install', () => {
4  self.skipWaiting();
5});
6
7self.addEventListener('activate', (event) => {
8  event.waitUntil(
9    caches.keys().then((keys) =>
10      Promise.all(
11        keys
12          .filter((key) => key !== CACHE_NAME)
13          .map((key) => caches.delete(key))
14      )
15    )
16  );
17  self.clients.claim();
18});
19
20self.addEventListener('fetch', (event) => {
21  const isNavigation = event.request.mode === 'navigate';
22
23  if (isNavigation) {
24    event.respondWith(
25      fetch(event.request)
26        .then((response) => {
27          const clone = response.clone();
28          caches.open(CACHE_NAME).then((cache) => cache.put(event.request, clone));
29          return response;
30        })
31        .catch(() => caches.match(event.request).then((cached) => cached || caches.match('/encuestasr')))
32    );
33    return;
34  }
35
36  event.respondWith(
37    caches.match(event.request).then((cached) => {
38      return (
39        cached ||
40        fetch(event.request).then((response) => {
41          const clone = response.clone();
42          caches.open(CACHE_NAME).then((cache) => cache.put(event.request, clone));
43          return response;
44        })
45      );
46    })
47  );
48});

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.