1importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js'); 2importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js'); 3 4firebase.initializeApp({ 5 messagingSenderId: '948189380720' 6}); 7var messaging = firebase.messaging(); 8console.log("service-worker init"); 9// If you would like to customize notifications that are received in the 10// background (Web app is closed or not in browser focus) then you should 11// implement this optional method. 12// [START background_handler] 13messaging.setBackgroundMessageHandler(function (payload) { 14 console.log('[firebase-messaging-sw.js] Received background message ', payload); 15 // Customize notification here 16 var notificationTitle = 'Background Message Title'; 17 var notificationOptions = { 18 body: 'Background Message body.', 19 icon: '/firebase-logo.png' 20 }; 21 22 return self.registration.showNotification(notificationTitle, 23 notificationOptions); 24}); 25// [END background_handler] 26 27self.addEventListener('fetch', function (event) { 28 29})
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.