PageSourceSearch

https://trocafigurinhas.app/sw.js

js trocafigurinhas.app collected 2026-10-06 04:47:10 UTC 1,367 bytes, 36 lines download raw bytes

1// Temporary Service Worker shutdown.
2// The previous SW could keep stale SPA HTML/chunks alive in browser caches.
3// This worker installs, clears caches, unregisters itself, and lets all fetches go to network.
4
5self.addEventListener("install", (event) => {
6  self.skipWaiting();
7  event.waitUntil(caches.keys().then((keys) => Promise.all(keys.map((key) => caches.delete(key)))));
8});
9
10self.addEventListener("activate", (event) => {
11  event.waitUntil(
12    (async () => {
13      const keys = await caches.keys();
14      await Promise.all(keys.map((key) => caches.delete(key)));
15      await self.clients.claim();
16      await self.registration.unregister();
17
18      const clients = await self.clients.matchAll({ type: "window", includeUncontrolled: true });
19      const now = Date.now();
20      await Promise.all(
21        clients.map((client) => {
22          try {
23            const url = new URL(client.url);
24            if (url.searchParams.has("_sw_disabled")) return Promise.resolve();
25            url.searchParams.delete("_sw_asset_recovery");
26            url.searchParams.delete("_reload");
27            url.searchParams.set("_sw_disabled", String(now));
28            return client.navigate(url.href).catch(() => undefined);
29          } catch {
30            return Promise.resolve();
31          }
32        }),
33      );
34    })(),
35  );
36});

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.