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