cdn.pushowl.com
Open in
urlscan Pro
2600:9000:21f3:aa00:7:6365:89c0:93a1
Public Scan
URL:
https://cdn.pushowl.com/latest/sdks/service-worker.js
Submission: On March 24 via manual from GB — Scanned from GB
Submission: On March 24 via manual from GB — Scanned from GB
Form analysis
0 forms found in the DOMText Content
self.PUSHOWL_SERVICE_WORKER_VERSION="2.2";var t,e,i=function(){function t(t){(t=t||{}).poServiceWorkerVersion=self.PUSHOWL_SERVICE_WORKER_VERSION;var e=(new Date).toISOString().split(".")[0];return{event_id:"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})),logger:"cdn-service-worker",platform:"javascript",timestamp:e,extra:t,release:"5b42ce4"}}function e(t){return fetch("https://sentry.io/api/1891871/store/?sentry_version=7&sentry_key=0df575aa94e3419782416c33a46d9dd7",{method:"post",mode:"no-cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}function i(i,n){(n=n||{}).errorDump={str:String(i),stack:i&&i.stack};var r=t(n);return r.exception=function(t){var e=(t.stack||"").split("\n").map((t=>t.trim())).filter((t=>t.startsWith("at"))).map((function(t){var e="",i=0,n=0,r="",a=t.split(/[ ]+/);if("at"===a[0].trim()&&a.length>1){var o="";a.length>2?(e=a[1],o=a[2]):o=a[1];var s=(o=o.replace("(","").replace(")","")).split(":");s.length>1&&(i=s[s.length-1],n=s[s.length-2],r=s.slice(0,s.length-2).join(":"))}return{in_app:!0,function:e,colno:Number(i)||i,lineno:Number(n)||n,filename:r}}));return e.reverse(),{values:[{type:t.name||"Error",value:t.message||String(t),stacktrace:{frames:e}}]}}(i),e(r)}return{log:function(i,n){var r=t(n);return r.message=i,e(r)},logException:i,withErrorReporting:function(t){return function(e){if(!e||!e.waitUntil)throw new Error("withErrorReporting should only be used for handlers that receive ExtendableEvent");try{return t(e)}catch(t){var n=i(t,{eventData:e&&e.data&&e.data.json()});e.waitUntil(n)}}}}}();t=console,e=new class{constructor(t){var{maxNetworkRetries:e}=t;this.maxNetworkRetries=e}payloadTransformation(t){var e=t.title,i=[],n=t.actions;if(n)for(var r=0;r<n.length;r++){var a={action:"action"+r,title:n[r].title};i.push(a)}var o=!("require_interaction"in t)||t.require_interaction,s={body:t.description||"",tag:t.tag||t.id,actions:i,requireInteraction:o,data:t};return["icon","badge","image"].forEach((e=>{t[e]&&(s[e]=t[e])})),{title:e,config:s}}processPush(t){if(this.payload=t.data.json().data,!this.payload||"pushowl"!==this.payload.app)return Promise.resolve();var{title:e,config:i}=this.payloadTransformation(this.payload),n=this.displayNotification(e,i),r=this.payload.delivery_acknowledgement_url,a=this.update(r);return Promise.all([a,n])}displayNotification(t,e){return self.registration.showNotification(t,e)}update(t){var e=1;return new Promise(((i,n)=>{var r=()=>{fetch(t,{method:"POST",headers:{"Content-Type":"text/plain"}}).then((t=>{var n=Math.min(8e3,2**e*1e3);429===t.status&&e++<=this.maxNetworkRetries?setTimeout(r,n):i(t)})).catch((t=>n(t)))};r()}))}openLink(t){t&&clients.matchAll({type:"window"}).then((function(e){for(var i=0;i<e.length;i++){var n=e[i];if(n.url===t&&"focus"in n)return n.focus()}if(clients.openWindow)return clients.openWindow(t)}))}static get version(){return self.PUSHOWL_SERVICE_WORKER_VERSION}}({maxNetworkRetries:5}),self.addEventListener("install",(function(t){t.waitUntil(self.skipWaiting())})),self.addEventListener("activate",(function(t){t.waitUntil(self.clients.claim())})),self.addEventListener("push",i.withErrorReporting((function(t){if(self.Notification&&"granted"===self.Notification.permission){if(!t.data)throw new Error("Empty event data.");var i=e.processPush(t);t.waitUntil(i)}}))),self.addEventListener("notificationclick",(function(t){var n,r,a,o=t.notification,s=o.data;try{n=s.redirect_url,r=s.click_acknowledgement_url,a="body",t.action&&(t.action.includes("action0")?(n=s.actions[0].redirect_url,a="cta1"):t.action.includes("action1")&&(n=s.actions[1].redirect_url,a="cta2"))}catch(t){i.logException(t,o?{notification:{title:o.title,data:o.data,actions:o.actions}}:void 0)}var c=new Promise(((i,r)=>{t.notification.close(),e.openLink(n),i()}));r+="&clicked_component="+a;var l=Promise.all([c,e.update(r)]);t.waitUntil(l)})),self.addEventListener("message",(function(t){var{title:i,config:n}=e.payloadTransformation(t.data);i&&t.waitUntil(e.displayNotification(i,n))})),self.addEventListener("notificationclose",(function(t){t.waitUntil(new Promise(((i,n)=>{var r=t.notification.data.close_acknowledgement_url;e.update(r).then((()=>{i()})).catch((()=>{}))})))})),self.addEventListener("error",(function(e){i.logException(e.error),t.error(e.filename,e.lineno,e.colno,e.message)}));