MSN

[]
MSN 0)return e.substring(0,t)}return““}(u.apikey));const p=function(e,t,n,o,i,s,r=g.Alert){if(n){i=i||{};const{apptype:c,audienceMode:a,pagetype:u,pageGenTime:d,bundleInfo:g,deviceFormFactor:h=““,fd_muid:p}=n;i.pageGenTime=d,i.build=g&&g.v,i.appType=c;const f=function(e,t,n){const o=n&&“phone“===n.toLowerCase();return{bingHomepage:“binghomepage“,mmx:“emmx“,edge:“spartan“,edgeChromium:t&&“enterprise“===t?“entnews“:“anaheim“,hybrid:“spartan“,hub:o?“prime_mobile“:“prime“,microsoftNews:“msnews“,office:“entnews“,views:o?“prime_mobile“:“prime“,windowsShell:“windowsshell“}[e]}(c,a,h),w=f||c,b=document.getElementsByTagName(„html“)[0].getAttribute(„lang“);let y=““,v=“muid“;try{window&&window.getCookieConsentRequired&&“function“==typeof window.getCookieConsentRequired&&window.getCookieConsentRequired()||(y=l(„muid“))}catch(e){console.log(„error fetching muid.“)}y||(y=n.aid,v=“aid“);const S={name:“MS.News.Web.AppError“,time:d,ver:“4.0″,iKey:`o:${o}`,data:{baseData:{},baseType:“MS.News.Web.Base“,page:{name:“default“,product:w,type:m(u),content:{category:“standaloneError“}},browser:{clientId:y,clientIdType:v},flight:{id:s},request:{activityId:n.aid,requestId:n.aid,afdMuid:p},locale:{mkt:b},extSchema:{id:e,severity:r,pb:i,message:t}}};return S?JSON.stringify(S):null}return null}(t,e,s,d,n,a,o);if(u&&p){console.error(p),h.push(p);const e=“https://“+r+“/OneCollector/1.0″+function(e){return“?“+Object.keys(e).map((function(t){return t+“=“+encodeURIComponent(e[t])})).join(„&“)}(u);navigator.sendBeacon(e,p)}else console.log(„missing parameters in data-client-settings. „+e)}catch(t){console.log(„error logging the app error. „+e)}}function m(e){let t=e;switch(e){case“windowsshellhp“:t=“dhp“;break;case“video“:t=“watch“}return t}var f;!function(e){e.Adult=“adult“,e.Enterprise=“enterprise“,e.Kids=“kids“}(f||(f={}));function w(){return!(„undefined“==typeof window||!window.document||!window.document.createElement||window.isRenderServiceEnv)}const b=“Authorization“,y=“UserAuthToken“;var v,S;!function(e){e.Presentation=“presentation“}(v||(v={})),function(e){e.Unknown=“Unknown“,e.Portrait=“Portrait“,e.Landscape=“Landscape“}(S||(S={}));var k,A,q,I,x;function C(){var e;return w()?a(document.head.dataset.clientSettings||(null===(e=document.getElementsByClassName(„peregrine-widget-settings“)[0])||void 0===e?void 0:e.getAttribute(„data-client-settings“))):null}function E(e){let t,n=!1;const o=function(){return n||(n=!0,t=e()),t};return o.cache={clear:()=>{n=!1,t=void 0}},o}!function(e){e[e.Undefined=0]=“Undefined“,e[e.Basic=1]=“Basic“,e[e.Advanced=2]=“Advanced“,e[e.Premium=3]=“Premium“}(k||(k={})),function(e){e.Init=“init“,e.Config=“config“,e.Targeted=“targeted“,e.Sticky=“sticky“,e.NoSticky=“no_sticky“,e.Admin=“admin“,e.Forced=“forced“,e.Manual=“manual“}(A||(A={})),function(e){e[e.Unknown=0]=“Unknown“,e[e.NotSignedIn=1]=“NotSignedIn“,e[e.SignedIn=2]=“SignedIn“}(q||(q={})),function(e){e.MSA=“MSA“,e.AAD=“AAD“,e.UNSUPPORTED_SOVEREIGNTY=“UNSUPPORTED_SOVEREIGNTY“}(I||(I={})),function(e){e[e.NonAadAccount=0]=“NonAadAccount“,e[e.AadAccount=1]=“AadAccount“,e[e.Unknown=2]=“Unknown“}(x||(x={}));const T=“currentaccount“,O=E((()=>{const e=l(T,!0),t=e&&a(e),{login_hint:n}=t||{};return n&&t})),_=E((()=>!!l(T)));let N=new class{constructor(){w()?(this.isDebugEnabled=(function(e,t){const n=t.replace(/[[]]/g,“\$&“),o=new RegExp(„[?&]“+n+“(=([^&#]*)|&|#|$)“).exec(e);if(!o)return null;const i=o[2];return decodeURIComponent(i.replace(/+/g,“ „))||““}(window.location.href,“debug“)||““).toLowerCase()in{1:1,true:1},this.isDebugEnabled&&!n.g.TEST_ENV&&(window.webpackRequire=n)):this.isDebugEnabled=!1}getLoggingService(){return null}isDebug(){return this.isDebugEnabled}setDebug(e){this.isDebugEnabled=e}setTags(e){}log(e,t){this.isDebug()&&console.info(e)}logError(e){console.error(e)}logCallback(e){this.isDebug()&&console.info(e())}logObjects(…e){this.isDebug()&&console.log(…e)}logSingleObject(e,t){this.isDebug()&&console.log(e)}};let R,P=new class extends class{constructor(e){this.storage=e}get supported(){return!!this.storage}getItem(e){if(this.supported)return this.storage.getItem(e)}getObject(e,t){const n=this.getItem(e);if(null!=n){const e=a(n);if(null!=e)return e}return t}key(e){if(this.supported&&e>=0)return this.storage.key(e)}keys(){return this.supported?Object.keys(this.storage):[]}setObject(e,t){void 0!==t?this.setItem(e,JSON.stringify(t)):this.removeItem(e)}removeObject(e){const t=this.removeItem(e);if(null!=t)return a(t)}setItem(e,t){if(this.supported)try{this.storage.setItem(e,t)}catch(e){N.logError(e)}}get length(){if(this.supported)return this.storage.length}removeItem(e){if(this.supported){const t=this.getItem(e);return this.storage.removeItem(e),t}}removeSubstringKeys(e){if(!this.supported||!e)return;const t=[];for(let n=0;no)return i}}return n}function B(){return W=W||void 0===W&&P.getObject(U)||null,W}!function(e){e.NotAvailable=“notAvailable“,e.Expired=“expired“,e.Valid=“valid“}(F||(F={}));class J{constructor(e,t){if(this.url=new URL(e.href),this.innerHeight=e.innerHeight,this.devicePixelRatio=e.devicePixelRatio,this.canUseCssGrid=e.canUseCssGrid,this.requestId=e.requestId,this.cookie=e.cookie,this.referer=e.referer,this.userAgent=e.userAgent,this.oneServiceHeaders=function(e){try{if(e)return JSON.parse(e)}catch(e){}}(e.oneServiceHeaders)||{},this.isPssrMode=t,t){const e=$(„OSATE“,this.cookie),t=!!e&&“1″===e,n=$(„OSAT“,this.cookie);if(t&&n||!e&&!n)return this.msalAuthReady=!0,void(n&&(this.oneServiceHeaders.Authorization=`Bearer ${n}`));this.msalAuthReady=!1,this.pssrRejectedReason=e&&!t?“interactiveLogin“:e&&!n?“missOSAT“:“missOSATE“}}static getInstance(){return n.g.TEST_ENV&&!J._instance&&V({href:“http://localhost:8080/“,innerHeight:768,devicePixelRatio:1,canUseCssGrid:!1,requestId:“0″,cookie:““,userAgent:““,referer:““,oneServiceHeaders:““}),J._instance||V({href:“http://localhost:8080/“,innerHeight:0,devicePixelRatio:0,canUseCssGrid:!1,requestId:“0″,cookie:““,userAgent:““,referer:““,oneServiceHeaders:““}),J._instance}static resetInstance(e,t=!1){return J._instance=new J(e,t),J._instance}}function $(e,t){if(t&&e){const n=new RegExp(„\b“+e+“\s*=\s*([^;]*)“,“i“).exec(t);return n&&n.length>1?n[1]:null}return null}J._instance=null;const V=J.resetInstance,z=()=>J.getInstance();function X(){try{return localStorage}catch(e){return null}}const K=“uxlogin“,Y=“uxlogout“,Z=“uxedit“,Q=E((()=>{const e=X();return e&&“1″===e.getItem(K)||w()&&location.search&&location.search.includes(„uxlogin=1“)}));const ee=E((()=>{const e=function(){try{return sessionStorage}catch(e){return null}}();return e&&!!e.getItem(Y)}));const te=E((()=>{const e=X();return e&&“1″===e.getItem(Z)}));const ne=E((()=>{const e=X(),t=!M(„prg-noredirect“)&&(e&&“1″===e.getItem(„useRedirect“)||function(){const e=document.head.dataset.clientSettings||““,{browser:t}=a(e)||{},{browserType:n=““}=t||{};return!!/safari/i.test(n)}());return t}));const oe={newsAndInterests:1,windowsNewsbar:1,windowsNewsPlus:1,winWidgets:1,windowsShell:1,windowsShellV2:1,distribution:1,superApp:1,gaming:1},ie={edgeChromium:1},se=E((()=>(w()&&C()||{}).apptype)),re=E((()=>ae()&&(O()||!l(„ace“)))),ce=E((()=>w()&&!(se()in oe)&&!M(„prg-nodualauth“))),ae=E((()=>ce()&&!(se()in ie)));E((()=>ce()&&(!(se()in ie)||!_()))),E((()=>ce()&&!me()));function ue(){return me()}function le(e){return de(e)&&(M(„prg-ntp-uat“)||M(„prg-ntp-uat-nf“))}function de(e){return!(„edgeChromium“!=se()||e!=f.Adult&&e!=f.Kids||!l(„at“)&&!l(„lt“))}E((()=>{const e=(w()?window.location.host:z().url.host).toLowerCase().endsWith(„.cn“);return ce()&&(!e||e&&M(„prg-enable-zhcn“))}));function ge(){const e=H;if(e)return N.log(„dual-auth: tryGet1SAuthToken returned live tokens“),e;const t=G();if(t)return N.log(`dual-auth: tryGet1SAuthToken returned cached tokens that are ${j()}`),t;N.log(„dual-auth: tryGet1SAuthToken returned empty tokens“)}function he(e){const t={};if(e){const n=se();“windowsShell“===n||“windowsShellV2″===n?t[y]=e:t[b]=`Bearer ${e}`}return t}function pe(e){const t={};return e&&(t[y]=e),t}function me(){return ae()&&Q()||re()&&(re()&&!Q()&&O()&&(„expired“==j()||te())||ee()||ne())}var fe;!function(e){e.GLOBAL=“GLOBAL“,e.GCC_MODERATE=“GCC_MODERATE“}(fe||(fe={}));let we,be;var ye,ve,Se;be=ye||(w()?window:{}),Se=()=>{let e;return{promise:new Promise((t=>e=t)),resolver:e}},we=be[ve=“authHeaderPromiseParts“]||(be[ve]=Se());const ke=document.head.attributes[„data-info“].value;let Ae;if(ke){const e=ke.split(„;“).find((e=>e.startsWith(„f:“)));e&&(Ae=e.substring(2),Ae.indexOf(„1sw-pcsreturnhp“)>-1&&p(„PCS returned. Executing inline JS.“,8e4,{customMessage:location.href},g.NoAlert))}(new class{constructor(){this.childCookieName=“child“,this.domInfo=document.head.dataset.info}init(e=null){this.clientSettings=e||C(),this.authCookieName=window._authCookieName||““,this.bundle=window._webWorkerBundle||““;const t=this.buildWebWorkerUrl(),n=window.webWorker=new Worker(t,{name:“web-worker“}),o=window.webWorkerMessages=[];n.onmessage=e=>{o.push(e.data)};const i=window.webWorkerErrors=[];if(n.onerror=e=>{i.push(e)},window.chrome){const e=this.getAudienceMode(this.clientSettings),t=window.webWorker&&window.chrome&&window.chrome.ntpSettingsPrivate;if(t&&“function“==typeof t.getPref&&(t.getPref(„ntp.news_feed_display“,(e=>{e&&e.value&&n.postMessage({id:“FeedDisplaySetting“,type:“command“,payload:e.value})})),t.getPref(„ntp.layout_mode“,(e=>{e&&e.value&&n.postMessage({id:“LayoutModeSetting“,type:“command“,payload:e.value})})),t.getPref(„ntp.user_nurturing“,(e=>{let t=!1;e&&e.value&&e.value.length&&(t=this.getSingleColRequest(e.value)),n.postMessage({id:“RenderSingleColumn“,type:“command“,payload:t})}))),e===f.Enterprise&&this.clientSettings.browser&&“edgeChromium“===this.clientSettings.browser.browserType&&parseInt(this.clientSettings.browser.version)>=87&&this.getEnterpriseAccessToken().then((e=>{e&&n.postMessage({id:“AuthTokenEnterprise“,type:“command“,payload:he(e)})})),e!==f.Adult&&e!==f.Enterprise||this.sendPageConfiguration(),le(e)){const e=l(„lt“)||l(„at“);n.postMessage({id:“AuthHeaders“,type:“command“,payload:pe(e)})}}ue()&&we.promise.then((e=>n.postMessage({id:“AuthHeaders“,type:“command“,payload:e||{}})))}buildWebWorkerUrl(e=null){return(this.bundle||““)+“#“+this.qsFromDocument()+this.qsFromCookies()+this.qsFromDataAttribute(e||this.clientSettings)+this.qsMisc()+this.qsAuth(e||this.clientSettings)+this.qsFromUrl()+this.qsFromServiceWorker()+this.qsSelectedPivot()+this.qsXboxXToken()}qs(e,t,n){return e?t+“=“+(n||e)+“&“:““}qsFromDocument(){var e;return this.qs(document.getElementsByTagName(„html“)[0].getAttribute(„lang“),“lang“)+this.qs(encodeURIComponent(window.location.href),“adsReferer“)+this.qs(null===(e=w()?window.devicePixelRatio:z().devicePixelRatio)||void 0===e?void 0:e.toString(),“devicePixelRatio“)}qsFromServiceWorker(){if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return““;const e=navigator.serviceWorker.controller;if(„activated“!==e.state||!e.scriptURL)return““;if(e.scriptURL){const t=new URL(e.scriptURL).searchParams.toString();return t?“&“+t+“&“:““}return““}qsFromCookies(){return this.qs(d(this.authCookieName),“aace“,“1″)+this.qs(d(„muid“),“muid“)+this.qs(d(this.childCookieName),“child“)+this.qs(d(„cbypass“),“cbypass“)+this.qs(this.cookieBannerConsentRequired().toString(),“ccRequired“)+this.qs(d(„ecasession“),“ecasession“)+this.qs(d(„TOptOut“),“browserOptOut“)}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.ocid,“ocid“)+this.qs(e.os,“os“)+this.qs(JSON.stringify(e.locale),“locale“)+this.qs(e.geo_lat,“lat“)+this.qs(e.geo_long,“long“)+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.qs(t,“dataInfo“)}qsSelectedPivot(){const e=“selectedPivot“;let t;try{const n=X();n&&(t=n.getItem(e))}catch(e){console.log(„Error getting pivot id from local storage. „+e)}return this.qs(t,e)}qsXboxXToken(){const e=“xboxXTokenId“;let t;try{const n=X();n&&(t=n.getItem(e))}catch(e){console.log(„Error getting xbox XToken from local storage. „+e)}return this.qs(t,e)}appendWpoFlightsToInfo(e,t){const n=this.getWpoFlightsFromLocalStorage(e);if(n&&n.length){const e=“;“,o=t.split(e);for(let e=0;ee.id))}}catch(e){console.warn(`Error getting wpo flights from ls for ${o} Error:${e}`)}return null}getHighestCbid(e,t){try{const n=X(),o=parseInt(e),i=parseInt(JSON.parse(n.getItem(`cbid_${t||““}`)));let s;if(o&&!isNaN(o)&&i&&!isNaN(i)&&(s=o>i?o:i),s=s||o||i,s)return window._cbid=s.toString()}catch(e){console.log(„Error getting highest CBID“+e)}}getAudienceMode(e){X();const t=l(this.authCookieName),n=l(this.childCookieName),{child:o}=t&&JSON.parse(t)||{};return t&&(1===o||n)?“kids“:e.audienceMode||f.Adult}sendPageConfiguration(){const e=this.clientSettings.pagetype;if(e){const t=l&&l(„pglt-edgeChromium-„+e);if(t)return void window.webWorker.postMessage({id:“PageConfiguration“,type:“command“,payload:t})}window.webWorker.postMessage({id:“PageConfiguration“,type:“command“,payload:!1})}qsFromDataAttribute(e){let t,n;const o=X();if(o){const i=JSON.parse(o.getItem(„shd_“+e.pagetype)||null);i&&i.clientSettings&&i.info&&(t=Object.assign(Object.assign({},i.clientSettings),{bundleInfo:e.bundleInfo}),n=i.info)}return(!t||!n||e.pageGenTime>=t.pageGenTime)&&(t=e,n=this.domInfo),t.audienceMode=this.getAudienceMode(t),this.qsFromDataAttributeHelper(t,n)}qsFromUrl(){const e=location.search;return e&&e.length?e.substring(1,e.length):““}getEnterpriseAccessToken(){return new Promise((e=>{window.chrome&&window.chrome.authPrivate?window.chrome.authPrivate.getPrimaryAccountInfo((t=>{t&&“GCC_MODERATE“!==t.region_scope||e(„“);const n={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(n,(t=>{t.is_success?e(t.access_token):e(„“)}))})):e(„“)}))}qsMisc(){return this.qs(performance.timeOrigin&&performance.timeOrigin.toString(),“mainTimeOrigin“)}qsAuth(e){let t=this.qs(re()&&“1″,“disableWWAuth“);if(!le(e&&e.audienceMode)&&!ue()){const e=ae()&&ge()||{};t+=this.qs(encodeURIComponent(JSON.stringify(he(e.accessToken))),“authHeaders“)}return“edgeChromium“==se()&&M(„prg-ntp-uat-nf“)&&(t+=this.qs(„1″,“acf“)),t}getSingleColRequest(e){const t=“render_single_column“,n=“feed_layout“;let o,i;for(const s of e){const{key:e,value:r}=s;e===t?o=r:e===n&&(i=r)}return“boolean“==typeof o?o:!!i&&(i&&“single“===i.type)}cookieBannerConsentRequired(){const e=null!=document.getElementById(„consent-banner-container“)&&null===l(„MSCC“),t=null!=document.getElementById(„onetrust-sdk“)&&null===l(„eupubconsent-v2“);return e||t}}).init(),function(e=[„vendors“,“common“,“microsoft“],t=“Error when loading bundle(s): „,n=5e5,o,i){(„visible“===document.visibilityState?Promise.resolve():new Promise((e=>{document.addEventListener(„visibilitychange“,(()=>{„visible“===document.visibilityState&&e()}))}))).then((()=>{setTimeout((()=>{const n=window.webpackJsonp;if(n){const s=n.length,r=e.length+1;if(s{t.length&&t[0][0]&&e.splice(e.indexOf(t[0][0]),1)}))}p(t+e.toString(),20202,{}),i&&i(o,{customMessage:e.toString()})}}}),n)}))}();const qe=’n n msn_logon n n n n n n ‘,Ie=300;function xe(){return document.body.querySelector(„entry-point“)||document.body.querySelector(„entry-point-hp-mobile“)}!function(){if(!((null==Ae?void 0:Ae.indexOf(„prg-hp-nsl“))>=0)){class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:“open“})}connectedCallback(){const e=document.createElement(„style“);e.innerHTML=’n :host {n font-family: Segoe UI, Segoe UI Midlevel, Segoe WP, Arial, sans-serif !important;n display: flex;n height: 100vh;n width: 100vw;n position: fixed;n background: #e0e0e0;n top: 0;n left: 0;n justify-content: center;n color: #000;n z-index: 99999;n }n .container {n display: flex;n margin-top: 200px;n flex-direction: column;n user-select: none;n -moz-user-select: none;n -webkit-user-select: none;n -ms-user-select: none;n align-items: center;n }n .logo {n margin: 0 0 15px;n font-size: 38px;n letter-spacing: 2px;n word-spacing: -5px;n opacity: 1;n }n .logo svg {n color: #000;n display: inline-block;n height: 35px;n position: relative;n top: 3px;n }n .loading-bar {n display: block;n height: 2px;n width: 100px;n background: #fff;n overflow: hidden;n border-radius: 2px;n }n .loading-bar:before {n content: „“;n display: block;n height: 2px;n width: 40px;n background: #000;n left: -20px;n position: relative;n animation: loading-bar 1.5s infinite;n }n @keyframes loading-bar {n 0 {n left: -20px;n }n 50% {n left: 80px;n }n 100% {n left: -20px;n }n }n ‘;const t=`n

n ${qe} msnn n n `,n=document.createElement(„div“);n.className=“container“,n.innerHTML=t,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(n)}}customElements.get(„msn-hp-loading-indicator“)||customElements.define(„msn-hp-loading-indicator“,t),setTimeout((()=>{xe()||function(){const t=document.body;if(t)e();else{const n=new MutationObserver((function(){t&&(n.disconnect(),e())}));n.observe(document.documentElement,{childList:!0})}}()}),Ie)}function e(){const e=document.createElement(„msn-hp-loading-indicator“);e.id=“loader“,document.body.appendChild(e);const t=new MutationObserver((function(){xe()&&(t.disconnect(),document.body.querySelector(„msn-hp-loading-indicator“).remove())}));t.observe(document.body,{childList:!0})}}()}(); ]]>

{t=o,s=e}),window._idbConfigOpenPromise=(()=>{try{const d=o.open(„wwConfigs“,1);return new Promise((o,c)=>{d.onerror=(()=>{c(new Error(„Config IDB preload open failure: „+d.error))}),d.onsuccess=(()=>{r[n+“open-End“]=performance.now();const c=d.result;o(c),r[n+“getAllObjects-Start“]=performance.now();const a=c.transaction(e,“readonly“).objectStore(e).openCursor();a.onsuccess=function(){const o=this.result;o?(i[o.key]=o.value,o.continue()):(r[n+“getAllObjects-End“]=performance.now(),t())},a.onerror=(()=>{s(new Error(„Config IDB preload read failure“))})}),d.onupgradeneeded=(()=>{d.result.createObjectStore(e)})})}catch(o){return Promise.reject(new Error(„Config IDB preload open failure: „+o))}})()}preloadConfigIDB(); ]]>

Source

Leave a Comment