1'use strict'; 2 3self.addEventListener('install', () => { 4 self.skipWaiting(); 5}); 6 7self.addEventListener('activate', (event) => { 8 event.waitUntil( 9 (async () => { 10 try { 11 await self.registration.unregister(); 12 } catch (e) { 13 console.warn('Failed to unregister the service worker:', e); 14 } 15 16 try { 17 const clients = await self.clients.matchAll({ 18 type: 'window', 19 }); 20 // Reload clients to ensure they are not using the old service worker. 21 clients.forEach((client) => { 22 if (client.url && 'navigate' in client) { 23 client.navigate(client.url); 24 } 25 }); 26 } catch (e) { 27 console.warn('Failed to navigate some service worker clients:', e); 28 } 29 })() 30 ); 31});
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.