1self.addEventListener('push', (event) => { 2 if (!event.data) { 3 return; 4 } 5 6 const payload = event.data.json(); 7 8 const title = payload.title; 9 const body = payload.body || ''; 10 const url = payload.url || 'https://www.trabber.com/'; 11 12 const actions = []; 13 if ('urlMore' in payload && 'more' in payload) { 14 actions.push({ action: payload.urlMore, title: payload.more }); 15 } 16 17 const options = { 18 body: body, 19 tag: url, 20 badge: "./images/push/trabber-badge.png", 21 icon: "./images/push/trabber-ico.png", 22 sound: "./images/push/barajas.mp3", 23 actions: actions, 24 data: { 25 url: url 26 } 27 }; 28 29 event.waitUntil(self.registration.showNotification(title, options)); 30}); 31 32self.addEventListener('notificationclick', (event) => { 33 event.notification.close(); 34 const urlToOpen = event.action || event.notification.data.url || event.notification.tag; 35 event.waitUntil(clients.openWindow(urlToOpen)); 36});
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.