1importScripts("https://www.gstatic.com/firebasejs/10.13.0/firebase-app-compat.js"); 2importScripts("https://www.gstatic.com/firebasejs/10.13.0/firebase-messaging-compat.js"); 3 4const firebaseConfig = { 5 apiKey: "AIzaSyA-e1y3GlplkWhbbHCHFM8LR0EnJjikgVI", 6 authDomain: "nova-firebase-notification.firebaseapp.com", 7 projectId: "nova-firebase-notification", 8 storageBucket: "nova-firebase-notification.appspot.com", 9 messagingSenderId: "545071782166", 10 appId: "1:545071782166:web:e218422fd892807e071837", 11 measurementId: "G-JCHT90YBZJ" 12}; 13 14const app = firebase.initializeApp(firebaseConfig); 15const messaging = firebase.messaging(); 16 17messaging.onBackgroundMessage( function(payload) { 18 19 //self.registration.update(); 20 21 console.log('[firebase-messaging-sw.js] Received background message ', payload); 22 23 let post_url = "https://visaooeste.com.br"; 24 let post_icon = "https://visaooeste.com.br/wp-content/plugins/nova-firebase-notification/assets/images/logo-visao-oeste.jpg"; 25 26 const data = payload.data; 27 28 29 if( data.url !== undefined ) { 30 post_url = data.url; 31 } 32 33 const notificationTitle = data.title; 34 const notificationOptions = { 35 body: data.body, 36 icon: post_icon, 37 data: { 38 url: post_url 39 } 40 }; 41 42 if( data.image !== undefined ) { 43 notificationOptions.image = data.image; 44 } 45 46 if( data.icon !== undefined ) { 47 notificationOptions.icon = data.icon; 48 } 49 50 self.registration.showNotification( 51 notificationTitle, 52 notificationOptions 53 ).then(); 54 55}); 56 57messaging.onMessage( function(payload) { 58 59 console.log('[firebase-messaging-sw.js] Received message ', payload); 60 61 let post_url = "https://visaooeste.com.br"; 62 let post_icon = "https://visaooeste.com.br/wp-content/plugins/nova-firebase-notification/assets/images/logo-visao-oeste.jpg"; 63 64 const data = payload.data; 65 66 67 if( data.url !== undefined ) { 68 post_url = data.url; 69 } 70 71 const notificationTitle = data.title; 72 const notificationOptions = { 73 body: data.body, 74 icon: post_icon, 75 data: { 76 url: post_url 77 } 78 }; 79 80 if( data.image !== undefined ) { 81 notificationOptions.image = data.image; 82 } 83 84 if( data.icon !== undefined ) { 85 notificationOptions.icon = data.icon; 86 } 87 88 self.registration.showNotification( 89 notificationTitle, 90 notificationOptions 91 ).then(); 92 93}); 94 95self.addEventListener('notificationclick', async function(event) { 96 event.notification.close(); 97 event.waitUntil( 98 clients.openWindow(event.notification.data.url).then(), 99 ); 100});
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.