1self.addEventListener("push", (event) => { 2 const data = event.data.json(); 3 4 const options = { 5 body: data.body, 6 icon: data.icon || "/icon.png", 7 badge: "/badge.png", 8 data: { 9 url: data.url || "/", 10 }, 11 }; 12 13 event.waitUntil(self.registration.showNotification(data.title, options)); 14}); 15 16self.addEventListener("notificationclick", (event) => { 17 event.notification.close(); 18 19 event.waitUntil( 20 clients 21 .matchAll({ type: "window", includeUncontrolled: true }) 22 .then((clientList) => { 23 if (clientList.length > 0) { 24 clientList[0].focus(); 25 clientList[0].navigate(event.notification.data.url); 26 } else { 27 clients.openWindow(event.notification.data.url); 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.