IBM Cloud Docs

March 29, 2021


0?r.shift():null);i&&i(e.data.response)}else if(o.commandToClient)switch(o.commandToClient){case”enableDebug”:window.akamServiceWorkerDebug||(window.akamServiceWorkerDebug=!0,aka3pmLog(“Setup script debug enabled via service worker message”),p());break;case”boomerangMQ”:o.payload&&(window.BOOMR_mq=window.BOOMR_mq||[]).push(o.payload)}aka3pmLog(“akam-sw message: “+JSON.stringify(e.data))});var t=function(e){return new Promise(function(n){var r,o;r=e.command,o=n,a.has(r)||a.set(r,[]),a.get(r).push(o),navigator.serviceWorker.controller&&(e.isAka3pm=!0,navigator.serviceWorker.controller.postMessage(e))})},c=function(e){return t({command:”navTiming”,navTiming:e})},s=null,m={},d=function(){var e=i;return s&&(e+=”?othersw=”+encodeURIComponent(s)),function(e,n){return new Promise(function(r,i){aka3pmLog(“Registering service worker with URL: “+e),navigator.serviceWorker.register(e,n).then(function(e){aka3pmLog(“ServiceWorker registration successful with scope: “,e.scope),r(e),o(1)}).catch(function(e){aka3pmLog(“ServiceWorker registration failed: “,e),o(0),i(e)})})}(e,m)},g=ServiceWorkerContainer.prototype.register;if(ServiceWorkerContainer.prototype.register=function(n,r){return n.includes(i)?g.call(this,n,r):(aka3pmLog(“Overriding registration of service worker for: “+n),s=new URL(n,window.location.href),m=r,navigator.serviceWorker.controller?new Promise(function(n,r){var o=navigator.serviceWorker.controller.scriptURL;if(o.includes(i)){var a=encodeURIComponent(s);o.includes(a)?(aka3pmLog(“Cancelling registration as we already integrate other SW: “+s),navigator.serviceWorker.getRegistration().then(function(e){n(e)})):e.then(function(){aka3pmLog(“Unregistering existing 3pm service worker”),navigator.serviceWorker.getRegistration().then(function(e){e.unregister().then(function(){return d()}).then(function(e){n(e)}).catch(function(e){r(e)})})})}else aka3pmLog(“Cancelling registration as we already have akam-sw.js installed”),navigator.serviceWorker.getRegistration().then(function(e){n(e)})}):g.call(this,n,r))},navigator.serviceWorker.controller){var u=navigator.serviceWorker.controller.scriptURL;u.includes(“/akam-sw.js”)||u.includes(“/akam-sw-preprod.js”)||u.includes(“/threepm-sw.js”)||(aka3pmLog(“Detected existing service worker. Removing and re-adding inside akam-sw.js”),s=new URL(u,window.location.href),e.then(function(){navigator.serviceWorker.getRegistration().then(function(e){m={scope:e.scope},e.unregister(),d()})}))}else e.then(function(){window.akamServiceWorkerPreprod&&(i=”/akam-sw-preprod.js”),d()});if(window.performance){var w=window.performance.timing,l=w.responseEnd-w.responseStart;c(l)}e.then(function(){t({command:”pageLoad”})});var k=!1;function p(){window.akamServiceWorkerDebug&&!k&&(k=!0,aka3pmLog(“Initializing debug functions at window scope”),window.aka3pmInjectSwPolicy=function(e){return t({command:”updatePolicy”,policy:e})},window.aka3pmDisableInjectedPolicy=function(){return t({command:”disableInjectedPolicy”})},window.aka3pmDeleteInjectedPolicy=function(){return t({command:”deleteInjectedPolicy”})},window.aka3pmGetStateAsync=function(){return t({command:”getState”})},window.aka3pmDumpState=function(){aka3pmGetStateAsync().then(function(e){aka3pmLog(JSON.stringify(e,null,”t”))})},window.aka3pmInjectTiming=function(e){return c(e)},window.aka3pmUpdatePolicyFromNetwork=function(){return t({command:”pullPolicyFromNetwork”})})}p()}}();]]> IBM Cloud Docs>> 0) + (counter++ + “__”);};WeakMap.prototype = {set: function(key, value) {var entry = key[this.name];if (entry && entry[0] === key) {entry[1] = value;}else {try {if (!Object.isFrozen(key)) {defineProperty(key, this.name, {value: [ key, value ],writable: true});}} catch(e) {console.error(e.track);console.error(e);}}return this;},get: function(key) {var entry;return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;},”delete”: function(key) {var entry = key[this.name];if (!entry || entry[0] !== key) return false;entry[0] = entry[1] = undefined;return true;},has: function(key) {var entry = key[this.name];if (!entry) return false;return entry[0] === key;}};window.WeakMap = WeakMap;})();}]]>0)try{var r=e.substr(n,e.length-n).split(“:”).splice(0,5).join(“:”);e=””.concat(e.substr(0,n)).concat(r)}catch(t){console.warn(“unable to parse crn in url”)}var a=c(t.hash).replace(//$/,””),o=t.hostname;return””.concat(o,”/”).concat(e).concat(a)}(t);return!n||!n[r]||e>n[r]}var u={optimizely:2,segment:1};return function(t,e){var n=window,r=(t=t||{}).analyticsScriptIntegrity,i=t.analyticsScriptOrigin,c=”public/2972860641/s/bluemix”,s=”ef9LICVsrqu2CFppQ4s4ecbHOz1w1dVk”,m=function(t,e){var n=window,r=n[t];r&&r.push||(r=[],n[t]=r),r.methods=e,r.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);return e.unshift(t),r.push(e),r}};for(var a=0;a 0)if(e&&”performance”in e&&e.performance&&”function”==typeof e.performance.setResourceTimingBufferSize)e.performance.setResourceTimingBufferSize();!function(){if(BOOMR=e.BOOMR||{},BOOMR.plugins=BOOMR.plugins||{},!BOOMR.plugins.AK){var n=””==”true”?1:0,t=””,a=”y67tq4timf3bcydbi4fq-f-4992769d5-clientnsv4-s.akamaihd.net”,i={“ak.v”:”31″,”ak.cp”:”909476″,”ak.ai”:parseInt(“492561″,10),”ak.ol”:”0″,”ak.cr”:18,”ak.ipv”:4,”ak.proto”:”h2″,”ak.rid”:”5f12606″,”ak.r”:40040,”ak.a2″:n,”ak.m”:””,”ak.n”:”essl”,”ak.bpcip”:”199.191.56.0″,”ak.cport”:44564,”ak.gh”:”23.206.193.165″,”ak.quicv”:””,”ak.tlsv”:”tls1.3″,”ak.0rtt”:””,”ak.csrc”:”-“,”ak.acc”:””,”ak.t”:”1616987915″,”ak.ak”:”hOBiQwZUYzCg5VSAfCLimQ==6PVMtVHcT3yhkT6rfXQo4pJtzc+hZ1KVfW6Mk2AP1YHLujnDdRGoPtROORtoKmp8Hm6f3riZYSfjnRKaBh88BEi03bb1+IcGIlzor7Yca09LDg48Q8EDlcNLlx6WmMlm4ipfFjsh0iXdVM6/xGVhqLGNcE6zA2EAYoKOqK5ajMAHFYSb3lyDVYKeYICYh9d6dtqc/KLn4d0fpc0DXJ8vMPApBx2a7paTlkAvfhSOez+K68Zl5qMlXRPMQI5maBrauMbXrvVdovWUwXeGHSOanmdSmF+VU4sgvD+S2tDlaSZ1/OrmPGJKqJYusZCHNUYlu4HCwaQFVkItSuD8O848osvZoxPCmNMT0Q/zjGKfFmFf3f+BAEnCj44nW8z5bizer5Y8w3VjqTEKwPmchY/OghHU2Br6WY7LvzfmSXk2/L4=”,”ak.pv”:”156″,”ak.dpoabenc”:””};if(“”!==t)i[“ak.ruds”]=t;var o={i:!1,av:function(n){var t=”http.initiator”;if(n&&(!n[t]||”spa_hard”===n[t]))i[“ak.feo”]=void 0!==e.aFeoApplied?1:0,BOOMR.addVar(i)},rv:function(){var e=[“ak.bpcip”,”ak.cport”,”ak.cr”,”ak.csrc”,”ak.gh”,”ak.ipv”,”ak.m”,”ak.n”,”ak.ol”,”ak.proto”,”ak.quicv”,”ak.tlsv”,”ak.0rtt”,”ak.r”,”ak.acc”,”ak.t”];BOOMR.removeVar(e)}};BOOMR.plugins.AK={akVars:i,akDNSPreFetchDomain:a,init:function(){if(!o.i){var e=BOOMR.subscribe;e(“before_beacon”,o.av,null,null),e(“onbeacon”,o.rv,null,null),o.i=!0}return this},is_complete:function(){return!0}}}}()}(window);]]>

Source