1// sw.js 2 3self.addEventListener('install', () => { 4 // Skip over the "waiting" lifecycle state, to ensure that our 5 // new service worker is activated immediately, even if there's 6 // another tab open controlled by our older service worker code. 7 self.skipWaiting(); 8}); 9 10self.addEventListener('activate', () => { 11 // Optional: Get a list of all the current open windows/tabs under 12 // our service worker's control, and force them to reload. 13 // This can "unbreak" any open windows/tabs as soon as the new 14 // service worker activates, rather than users having to manually reload. 15 self.clients 16 .matchAll({ 17 type: 'window', 18 }) 19 .then((windowClients) => { 20 windowClients.forEach((windowClient) => { 21 windowClient.navigate(windowClient.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.