1// public/service_worker.js (The Poison Pill) 2 3self.addEventListener('install', () => { 4 // Install immediately, don't wait 5 self.skipWaiting(); 6}); 7 8self.addEventListener('activate', () => { 9 console.log("deactivate") 10 // Immediately unregister this SW 11 self.registration.unregister() 12 .then(() => { 13 // Once unregistered, grab all clients (tabs) 14 return self.clients.matchAll(); 15 }) 16 .then((clients) => { 17 clients.forEach(client => { 18 // Force the page to navigate/reload. 19 // This ensures the browser loads the page fresh, 20 // free from this SW's control, allowing the NEW sw.js to take over. 21 client.navigate(client.url); 22 }); 23 }); 24});
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.