From b2169df5db0e7c0a94e079a392d48db9084a5a79 Mon Sep 17 00:00:00 2001 From: Justin Velluppillai Date: Tue, 6 Jul 2021 05:39:13 +1200 Subject: Handle failed promise by silently ignoring it (#17735) * Handle failed promise by silently ignoring it * rebuilt piwik.js * Remove unnecessary check for .ready - if serviceWorker exists it should be there anyway * rebuilt piwik.js Co-authored-by: tsteur Co-authored-by: justinvelluppillai --- piwik.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'piwik.js') diff --git a/piwik.js b/piwik.js index f636f971a4..582d913424 100644 --- a/piwik.js +++ b/piwik.js @@ -63,7 +63,7 @@ var dm=ba(dl);bF.pushMultiple(dm)})}else{p(function(){var dl=v.findContentNodesW }}var dn="_pkc";ct[dn]=dm;if(J(dl)&&dl!==null&&dl!==false&&String(dl).length){dn="_pkp";ct[dn]=dl}if(!Y(dp)&&!Y(dk)){return}if(Y(dp)){dn="_pks";ct[dn]=dp}if(!Y(dk)){dk=""}dn="_pkn";ct[dn]=dk};this.getEcommerceItems=function(){return JSON.parse(JSON.stringify(c2))};this.addEcommerceItem=function(dp,dk,dm,dl,dn){if(Y(dp)){c2[dp]=[String(dp),dk,dm,dl,dn]}};this.removeEcommerceItem=function(dk){if(Y(dk)){dk=String(dk);delete c2[dk]}};this.clearEcommerceCart=function(){c2={}};this.trackEcommerceOrder=function(dk,dp,dn,dm,dl,dq){b0(dk,dp,dn,dm,dl,dq)};this.trackEcommerceCartUpdate=function(dk){bu(dk)};this.trackRequest=function(dl,dn,dm,dk){ch(function(){var dp=cr(dl,dn,dk);bH(dp,bL,dm)})};this.ping=function(){this.trackRequest("ping=1",null,null,"ping")};this.disableQueueRequest=function(){bF.enabled=false};this.setRequestQueueInterval=function(dk){if(dk<1000){throw new Error("Request queue interval needs to be at least 1000ms")}bF.interval=dk};this.queueRequest=function(dk){ch(function(){var dl=cr(dk); bF.push(dl)})};this.isConsentRequired=function(){return cB};this.getRememberedConsent=function(){var dk=aD(be);if(aD(cN)){if(dk){bZ(be,br,cZ)}return null}if(!dk||dk===0){return null}return dk};this.hasRememberedConsent=function(){return !!this.getRememberedConsent()};this.requireConsent=function(){cB=true;bE=this.hasRememberedConsent();if(!bE){bn=true}x++;b["CoreConsent"+x]={unload:function(){if(!bE){aF()}}}};this.setConsentGiven=function(dl){bE=true;bZ(cN,br,cZ);var dm,dk;for(dm=0;dm1&&ap!=="addTracker"&&ap!=="enableLinkTracking"){ak("The method "+ap+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}av[ap]++}}}}return au}var C=["addTracker","forgetCookieConsentGiven","requireCookieConsent","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setCookieNamePrefix","setCookieSameSite","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setVisitorId","setSiteId","alwaysUseSendBeacon","enableLinkTracking","setCookieConsentGiven","requireConsent","setConsentGiven","disablePerformanceTracking"]; -function ad(aq,ap){var ao=new P(aq,ap);I.push(ao);_paq=c(_paq,C);for(E=0;E<_paq.length;E++){if(_paq[E]){af(_paq[E])}}_paq=new H();t.trigger("TrackerAdded",[ao]);return ao}an(S,"beforeunload",ai,false);an(S,"online",function(){if(J(g.serviceWorker)&&J(g.serviceWorker.ready)){g.serviceWorker.ready.then(function(ao){if(ao&&ao.sync){return ao.sync.register("matomoSync")}})}},false);an(S,"message",function(au){if(!au||!au.origin){return}var aw,ar,ap;var ax=d(au.origin);var at=t.getAsyncTrackers();for(ar=0;ar