1/* Firebase Cloud Messaging service worker (web push). 2 * Config is passed as query params at registration time (see FcmService). */ 3importScripts('https://www.gstatic.com/firebasejs/12.15.0/firebase-app-compat.js'); 4importScripts('https://www.gstatic.com/firebasejs/12.15.0/firebase-messaging-compat.js'); 5 6const params = new URLSearchParams(location.search); 7 8firebase.initializeApp({ 9 apiKey: params.get('apiKey'), 10 projectId: params.get('projectId'), 11 messagingSenderId: params.get('messagingSenderId'), 12 appId: params.get('appId'), 13}); 14 15const messaging = firebase.messaging(); 16 17messaging.onBackgroundMessage((payload) => { 18 const n = payload.notification || {}; 19 self.registration.showNotification(n.title || '', { 20 body: n.body || '', 21 icon: n.icon || undefined, 22 data: payload.data || {}, 23 }); 24});
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.