1self.addEventListener('push', function(event) { 2 if (event.data) { 3 const data = event.data.json(); 4 const options = { 5 body: data.body, 6 icon: data.icon || '/favicon.ico', 7 badge: data.badge || '/favicon.ico', 8 image: data.image || null, 9 tag: data.tag, 10 requireInteraction: !!data.require_interaction, 11 silent: !!data.silent, 12 renotify: !!data.renotify, 13 data: { 14 url: data.url || '/' 15 } 16 }; 17 18 event.waitUntil( 19 self.registration.showNotification(data.title || 'Notification', options) 20 ); 21 } 22}); 23 24self.addEventListener('notificationclick', function(event) { 25 event.notification.close(); 26 27 if (event.notification.data && event.notification.data.url) { 28 event.waitUntil( 29 clients.openWindow(event.notification.data.url) 30 ); 31 } 32});
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.