1importScripts('https://www.gstatic.com/firebasejs/10.7.1/firebase-app-compat.js'); 2importScripts('https://www.gstatic.com/firebasejs/10.7.1/firebase-messaging-compat.js'); 3 4firebase.initializeApp({ 5 apiKey: "AIzaSyAUN_X1cD8kHHudyIJ922vPJZVxsh1jzZI", 6 authDomain: "exie-7ccc3.firebaseapp.com", 7 projectId: "exie-7ccc3", 8 storageBucket: "exie-7ccc3.firebasestorage.app", 9 messagingSenderId: "338680996787", 10 appId: "1:338680996787:web:c011e99756c8dd24f021c6", 11 measurementId: "G-7752C7BF64" 12}); 13 14const messaging = firebase.messaging(); 15 16messaging.onBackgroundMessage((payload) => { 17 console.log('[firebase-messaging-sw.js] Received background message ', payload); 18 19 if (payload.data) { 20 const notificationTitle = payload.data.title || 'Nuova notifica'; 21 const notificationOptions = { 22 body: payload.data.body || '', 23 icon: '/favicon.ico', 24 image: payload.data.ext2 || undefined, 25 data: { 26 url: payload.data.ext 27 } 28 }; 29 30 self.registration.showNotification(notificationTitle, notificationOptions); 31 } 32}); 33 34self.addEventListener('notificationclick', (event) => { 35 event.notification.close(); 36 const urlToOpen = event.notification.data ? event.notification.data.url : null; 37 38 if (urlToOpen) { 39 event.waitUntil( 40 clients.matchAll({ type: 'window', includeUncontrolled: true }).then((windowClients) => { 41 for (let i = 0; i < windowClients.length; i++) { 42 const client = windowClients[i]; 43 if (client.url === urlToOpen && 'focus' in client) { 44 return client.focus(); 45 } 46 } 47 if (clients.openWindow) { 48 return clients.openWindow(urlToOpen); 49 } 50 }) 51 ); 52 } 53});
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.