Sorting by

×

MSN


MSN {window.webWorkerMessages.push(e.data)},window.webWorkerErrors=[],window.webWorker.onerror=e=>{window.webWorkerErrors.push(e)},window.chrome){const e=window.webWorker&&window.chrome&&window.chrome.ntpSettingsPrivate;e&&”function”==typeof e.getPref&&e.getPref(“ntp.news_feed_display”,e=>{e&&e.value&&window.webWorker.postMessage({id:”FeedDisplaySetting”,type:”command”,payload:e.value})}),”enterprise”===this.clientSettings.audienceMode&&this.clientSettings.browser&&”edgeChromium”===this.clientSettings.browser.browserType&&parseInt(this.clientSettings.browser.version)>=87&&this.getAccessToken().then(e=>{e&&window.webWorker.postMessage({id:”AuthToken”,type:”command”,payload:e})})}}buildWebWorkerUrl(e=null){return(this.bundle||””)+”#”+this.qsFromDocument()+this.qsFromCookies()+this.qsFromDataAttribute(e||this.clientSettings)+this.qsMisc()+this.qsFromUrl()}qs(e,t,o){return e?t+”=”+(o||e)+”&”:””}qsFromDocument(){return this.qs(document.getElementsByTagName(“html”)[0].getAttribute(“lang”),”lang”)}qsFromCookies(){return this.qs(Object(i.b)(this.authCookieName),”aace”,”1″)+this.qs(Object(i.b)(“muid”),”muid”)+this.qs(Object(i.b)(this.childCookieName),”child”)+this.qs(Object(i.b)(“cbypass”),”cbypass”)}qsFromDataAttributeHelper(e,t){return e&&e.featureFlags&&e.featureFlags.wpoEnabled&&(t=this.appendWpoFlightsToInfo(e,t)),this.qs(e.pcsInfo&&e.pcsInfo.env||e.env,”env”)+this.qs(e.aid,”aid”)+this.qs(e.apptype,”apptype”)+this.qs(e.pagetype,”pagetype”)+this.qs(e.audienceMode,”audienceMode”)+this.qs(e.configIndexDocId,”configIndexDocId”)+this.qs(e.deviceFormFactor,”deviceFormFactor”)+this.qs(e.domain,”domain”)+this.qs(e.configRootUrl,”configRootUrl”)+this.qs(this.getHighestCbid(e.cbid,e.apptype),”cbid”)+this.qs(e.os,”os”)+this.qs(JSON.stringify(e.locale),”locale”)+this.qs(e.geo_lat,”lat”)+this.qs(e.geo_long,”long”)+(“dhp”===e.pagetype||”ntp”===e.pagetype?this.qs(Object(i.b)(this.WeaSpartanHomeLocCookie),this.WeaSpartanHomeLocCookie)+this.qs(Object(i.b)(this.WeaSpartanDetectLocSetting),this.WeaSpartanDetectLocSetting):this.qs(Object(i.b)(this.WeaHomeLocCookie),this.WeaHomeLocCookie)+this.qs(Object(i.b)(this.WeaDetectLocSetting),this.WeaDetectLocSetting))+this.qs(JSON.stringify(e.featureFlags),”featureFlags”)+this.qs(JSON.stringify(e.browser),”browser”)+this.qs(JSON.stringify(e.servicesEndpoints),”servicesEndpoints”)+this.qs(e.bundleInfo&&e.bundleInfo.v||””,”buildVersion”)+this.buildArtifactHashes(e)+this.qs(t,”dataInfo”)}appendWpoFlightsToInfo(e,t){const o=this.getWpoFlightsFromLocalStorage(e);if(o&&o.length){const e=”;”,i=t.split(e);for(let e=0;ee.id)}}catch(e){console.warn(`Error getting wpo flights from ls for ${i} Error:${e}`)}return null}buildArtifactHashes(e){let t;try{const{locale:o={},bundleInfo:i={},audienceMode:s,pagetype:r,apptype:a}=e,{hash:c,configsHash:l,locConfigsHash:u}=i;if(!c||!l||!u)return””;t=this.qs(c,”bundleHash”)+this.qs(l,”configHash”)+this.qs(u,”locHash”);const h=`config_hash_${s}_${o.language}_${o.market}_${r}_${a}`,d=Object(n.a)().getItem(h);if(d){const{bundleHash:e,configHash:o,locHash:i}=JSON.parse(d)||{};e&&o&&i&&(t+=this.qs(e,”lastBundleHash”)+this.qs(o,”lastConfigHash”)+this.qs(i,”lastLocHash”))}return t}catch(e){console.error(“Error getting config hashes from ls: “+e)}return t}getHighestCbid(e,t){try{const o=Object(n.a)(),i=parseInt(e),s=parseInt(JSON.parse(o.getItem(“cbid_”+(t||””))));let r;if(i&&!isNaN(i)&&s&&!isNaN(s)&&(r=i>s?i:s),r=r||i||s,r)return window._cbid=r.toString()}catch(e){console.log(“Error getting highest CBID”+e)}}getAudienceMode(e){const t=Object(n.a)();return Object(i.b)(this.authCookieName)&&Object(i.b)(this.childCookieName)?”kids”:”enterprise”===e.audienceMode&&t&&t.getItem(“forceConsumer”)?”adult”:e.audienceMode||”adult”}qsFromDataAttribute(e){let t,o;const i=Object(n.a)();if(i){let n=JSON.parse(i.getItem(“shd_”+e.pagetype)||null);if(n&&n.clientSettings&&n.info)t=n.clientSettings,o=n.info;else if(n=JSON.parse(i.getItem(“ac_shd”)||null),n){const i=n[e.pagetype];i&&i.clientSettings&&i.info&&(t=i.clientSettings,o=i.info)}}return(!t||!o||e.pageGenTime>=t.pageGenTime)&&(t=e,o=this.domInfo),t.audienceMode=this.getAudienceMode(t),this.qsFromDataAttributeHelper(t,o)}qsFromUrl(){const e=location.search;return e&&e.length?e.substring(1,e.length):””}getAccessToken(){return new Promise(e=>{window.chrome&&window.chrome.authPrivate?window.chrome.authPrivate.getPrimaryAccountInfo(t=>{t&&”GCC_MODERATE”!==t.region_scope||e(“”);const o={account_id:t.account_id,account_type:t.account_type,client_id:”d7b530a4-7680-4c23-a8bf-c52c121d2e87″,scope_or_resource:”https://enterprisenews.microsoft.com”};window.chrome.authPrivate.acquireAccessTokenSilently(o,t=>{t.is_success?e(t.access_token):e(“”)})}):e(“”)})}qsMisc(){return this.qs(performance.timeOrigin&&performance.timeOrigin.toString(),”mainTimeOrigin”)}}).init()},YBLW:function(e,t,o){“use strict”;let i;function n(e){if(!e)return null;if(!i){const e=document.cookie.split(“; “);i={};const t=e&&e.length;for(let o=0;o

Source