1importScripts('https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js'); 2importScripts('https://www.gstatic.com/firebasejs/10.13.2/firebase-messaging-compat.js'); 3 4const firebaseConfig = { 5 apiKey: "AIzaSyB7vpJvCXJpRBJxCAQZ5NS7_1G8M-XXc24", 6 authDomain: "operateri.firebaseapp.com", 7 databaseURL: "https://operateri.firebaseio.com", 8 projectId: "operateri", 9 storageBucket: "operateri.firebasestorage.app", 10 messagingSenderId: "789817974766", 11 appId: "1:789817974766:web:42192aba765ab636e238ff" 12}; 13 14 15// https://firebase.google.com/docs/web/setup#config-object 16firebase.initializeApp(firebaseConfig); 17const messaging = firebase.messaging(); 18/*messaging.onBackgroundMessage((payload) => { 19 console.log('[firebase-messaging-sw.js] Primljena poruka u pozadini:', payload); 20 21 const notificationTitle = payload.notification?.title || "Nova obavijest"; 22 const notificationOptions = { 23 body: payload.notification?.body || "Klikni za viÅ¡e informacija", 24 icon: payload.notification?.icon || "/default-icon.png", 25 click_action: payload.notification?.click_action || "/" 26 }; 27 28 self.registration.showNotification(notificationTitle, notificationOptions); 29});*/ 30 31self.addEventListener('notificationclick', event => { 32 event.notification.close(); 33 34 const targetUrl = event.notification.data?.url || '/'; 35 36 event.waitUntil( 37 clients.matchAll({ type: 'window', includeUncontrolled: true }) 38 .then(clientList => { 39 // ako je tab veÄ otvoren, samo ga fokusiraj 40 for (const client of clientList) { 41 if (client.url === targetUrl && 'focus' in client) { 42 return client.focus(); 43 } 44 } 45 // inaÄe otvori novi 46 return clients.openWindow(targetUrl); 47 }) 48 ); 49}); 50 51 52self.addEventListener('message', e => { 53 if (e.data === 'PING_VERSION') { 54 e.source.postMessage({ type: 'PONG_VERSION', build: SW_BUILD }); 55 } 56});
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.