1
|
|
|
importScripts('https://www.gstatic.com/firebasejs/6.6.1/firebase-app.js'),importScripts('https://www.gstatic.com/firebasejs/6.6.1/firebase-messaging.js'),importScripts('https://www.pushmix.co.uk/js/analytics-helper.js'),firebase.initializeApp({apiKey:'AIzaSyDvNBVsjhdUZPr1BD51tHtUCx-CidaTqKY',authDomain:'pushmix-216113.firebaseapp.com',projectId:'pushmix-216113',messagingSenderId:'542277997339'});const messaging=firebase.messaging();messaging.setBackgroundMessageHandler(function(a){var b=a.data.title,c={body:a.data.body,icon:a.data.icon,badge:a.data.badge,tag:'push-notification-tag'};return a.data.hasOwnProperty('image')&&(c.image=a.data.image),a.data.hasOwnProperty('urls')&&(c.data=JSON.parse(a.data.urls)),c.data.hasOwnProperty('gaTrackingId')?sendAnalyticsEvent('notification-view','web notification',c.data.gaTrackingId):c.data.gaTrackingId=null,a.data.hasOwnProperty('actions')&&'actions'in Notification.prototype&&(c.actions=JSON.parse(a.data.actions)),self.registration.showNotification(b,c)}),self.addEventListener('notificationclick',function(a){var b=a.notification.data.default_url,c='notification-click';if(a.action)switch(a.action){case'action-one':b=new URL(a.notification.data.action_url_one,self.location.origin).href,c=a.notification.actions[0].title;break;case'action-two':b=a.notification.data.action_url_two,c=a.notification.actions[1].title;}if(a.notification.close(),!1!==b){var d=clients.matchAll({type:'window',includeUncontrolled:!0}).then(function(f){for(var h,g=0;g<f.length;g++)if(h=f[g],h.url===b&&'focus'in h)return h.focus();if(clients.openWindow)return clients.openWindow(b)}),e=Promise.all([sendAnalyticsEvent(c,'web notification',a.notification.data.gaTrackingId),d]);a.waitUntil(e)}}); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.