1importScripts('https://www.gstatic.com/firebasejs/8.3.2/firebase-app.js'); 2importScripts('https://www.gstatic.com/firebasejs/8.3.2/firebase-messaging.js'); 3 4firebase.initializeApp({ 5 apiKey: "AIzaSyDboPXQng1sO_B72QiT4MFCEmnEqj2_Vng", 6 authDomain: "sponsr-1596726779286.firebaseapp.com", 7 projectId: "sponsr-1596726779286", 8 storageBucket: "sponsr-1596726779286.appspot.com", 9 messagingSenderId: "368441975986", 10 appId: "1:368441975986:web:744eff3006ab556ad415ab" 11}); 12 13const messaging = firebase.messaging(); 14 15messaging.setBackgroundMessageHandler(function(payload) { 16 payload.data.data = JSON.parse(JSON.stringify(payload.data)); 17 return self.registration.showNotification(payload.data.title, payload.data); 18}); 19 20self.addEventListener('notificationclick', function(event) { 21 const target = event.notification.data.click_action || '/'; 22 event.notification.close(); 23 // This looks to see if the current is already open and focuses if it is 24 event.waitUntil(clients.matchAll({ 25 type: 'window', 26 includeUncontrolled: true 27 }).then(function(clientList) { 28 // clientList always is empty?! 29 for (var i = 0; i < clientList.length; i++) { 30 var client = clientList[i]; 31 if (client.url === target && 'focus' in client) { 32 return client.focus(); 33 } 34 } 35 36 return clients.openWindow(target); 37 })); 38});
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.