1/* eslint-disable no-undef */ 2importScripts('https://www.gstatic.com/firebasejs/10.12.0/firebase-app-compat.js'); 3importScripts('https://www.gstatic.com/firebasejs/10.12.0/firebase-messaging-compat.js'); 4 5firebase.initializeApp({ 6 apiKey: 'AIzaSyD1HwwiYYKL5fRyzsmUUgBFuJ49nD9_Mpo', 7 authDomain: 'cari-b7eab.firebaseapp.com', 8 projectId: 'cari-b7eab', 9 storageBucket: 'cari-b7eab.appspot.com', 10 messagingSenderId: '712286895977', 11 appId: '1:712286895977:web:1f25bedc71e944256347f8', 12}); 13 14const messaging = firebase.messaging(); 15 16messaging.onBackgroundMessage((payload) => { 17 const { title, body, image } = payload.notification || {}; 18 const data = payload.data || {}; 19 20 self.registration.showNotification(title || 'Cari.ge', { 21 body: body || '', 22 icon: '/images/cari-website-logo.png', 23 image: image || undefined, 24 badge: '/images/cari-website-logo.png', 25 data: { click_url: data.click_url || '/' }, 26 tag: data.type || 'default', 27 }); 28}); 29 30self.addEventListener('notificationclick', (event) => { 31 event.notification.close(); 32 const url = event.notification.data?.click_url || '/'; 33 const fullUrl = url.startsWith('http') ? url : `https://cari.ge${url}`; 34 35 event.waitUntil( 36 clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => { 37 for (const client of clientList) { 38 if (client.url.includes('cari.ge') && 'focus' in client) { 39 client.focus(); 40 client.navigate(fullUrl); 41 return; 42 } 43 } 44 return clients.openWindow(fullUrl); 45 }) 46 ); 47});
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.