PageSourceSearch

https://static.foxnews.com/static/isa/app/lib/xid.js

js foxnews.com collected 2026-10-01 09:12:22 UTC 4,925 bytes, 2 lines download raw bytes

1/*! updated; 09-28-2026 03:58 PM **/
2(d=>{let i={fn:"foxnews",fb:"foxbusiness"},n="fxn_cstore__wv_xid";var e;d.FNC&&!d.FNC.xid&&((e=new class{constructor(){this.initialized||(this.env=this.getEnv(),this.domain=this.getDomain(),this.bu=this.getBusinessUnit(),this.isFN="foxnews"===this.getBusinessUnit(),this.isWebview=this.isAppMode(),this.xid_path=`https://${this.env}.${this.domain}.com/xid`,this.xid_event_path="https://prod.pyxis.atp.fox/pyxis/submit",this.xid_event_partial=`https://${"www"!==this.env?"dev":"prod"}.pyxis.atp.fox`,this.xid_value=null,this.initialized=!1,d.FNC=d.FNC||{},d.FNC.xid=d.FNC.xid||{},d.FNC.xidMethods=d.FNC.xidMethods||{})}xidReady(e){e=new CustomEvent("xidReady",{detail:{xid:e}});d.dispatchEvent(e)}getEnv(){var e=d.location.hostname.split(".")[0];return e.includes("dev")?"dev":e.includes("stage")?"stage":"my"===e?"www":"static"===e?"static":e}getBusinessUnit(){var e=new URLSearchParams(d.location.search).get("site"),t=this.getDomain();return i[e]||t}getDomain(){var e=d.location.host.split(".");return 0<e.length?e[e.length-2]:"foxnews"}getDeviceType(){let e="desktop",t=d.outerWidth;return t<768?e="mobile":t<1024&&(e="tablet"),e}fetchXid(){let i={method:"POST",headers:{"Content-Type":"application/json;"}};var e={},t=this.getXid();return t&&(e.xid=t),i.body=JSON.stringify(e),new d.Promise((t,e)=>{fetch(this.xid_path,i).then(e=>{e.status;t(e.ok?e.json().catch(()=>null):null)}).catch(e=>{console.error("Error occured fetching XID:",e),t(null)})})}fireXidEvent(e){let i={method:"POST",headers:{"Content-Type":"application/json;"},body:JSON.stringify(e)};return new d.Promise((t,e)=>{fetch(this.xid_event_path,i).then(e=>{e.status;t(e.ok?e.json():null)}).catch(e=>{console.error("Error occured firing XID event:",e)})})}getCookie(e){var i=e+"=",n=document.cookie.split(";");for(let t=0;t<n.length;t++){let e=n[t];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(i))return decodeURIComponent(e.substring(i.length,e.length))}return null}deleteCookie(e,t={path:"/"}){var{path:t,domain:i}=t;let n=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path="+t;i&&(n+="; domain="+i),document.cookie=n}getLocalItem(t){t=localStorage.getItem(t);try{return JSON.parse(t)}catch(e){return t||null}}getXid(){return this.isWebview&&(this.deleteCookie("xid",{path:"/",domain:".foxnews.com"}),this.getCookie(n)||this.getLocalItem(n))||this.getCookie("xid")}getEventData(){var e,t=(d.FNC||{}).anon||{},i=this.getLocalItem("ajs_user_traits")||{},n=JSON.parse(this.getCookie("__leap_props"))||{},s="function"==typeof t.anon_fpid?t.anon_fpid():this.getLocalItem("anon_fpid"),t="function"==typeof t.persist_fpid?t.persist_fpid():this.getLocalItem("persist_fpid"),o={dcg_profile_id:i.dcg_profile_id||"",last_anonymous_id:i.lastAnonymousProfileId||"",last_known_profile_id:i.lastKnownProfileId||"",ajs_user_id:this.getCookie("ajs_user_id")||"",lastknownprofileid:n.lastKnownId||"",anon_fpid:s||"",segment_anonymous_id:this.getCookie("ajs_anonymous_id")||"",xid:this.xid_value||"",persist_fpid:t||"",userProfileId:n.userProfileId||"",lastAnonymousProfileId:n.lastAnonymousProfileId||"",persistAnonId:n.persistAnonId||""};for(e in o)""!==o[e]&&null!=o[e]||delete o[e];i={data:{boi:o,event_type:"view",origin_bu:""+this.bu,xid:this.xid_value,us_privacy:this.getCookie("usprivacy"),device_type:this.getDeviceType()},origin:"xf:profile_sdk",scheme:"default_web"};return this.isFN&&(s={originBu:this.bu,deviceType:this.getDeviceType()},Object.assign(i,s)),this.isFN&&(i.baseUrl=this.xid_event_partial,i.xid=this.xid_value),i}init(){this.initialized||(this.isFN&&!this.isWebview?this.handleProfileXID():this.handleOldXID())}handleProfileXID(){let e=()=>"function"==typeof d.FNC.xidMethods?.getXid&&"function"==typeof d.FNC.xidMethods?.submitXidEvent&&(d.FNC.xidMethods.getXid().then(e=>{this.processXID(e,e=>d.FNC.xidMethods.submitXidEvent(e))}).catch(()=>{this.processXID(null)}),!0),t=()=>{e()||console.error("Global Profile SDK methods getXid and/or submitXidEvent are not defined."),d.removeEventListener("foxProfileMethodsReady",t)};d.addEventListener("foxProfileMethodsReady",t),e()&&d.removeEventListener("foxProfileMethodsReady",t)}handleOldXID(){this.fetchXid().then((e={})=>{this.processXID(e,e=>this.fireXidEvent(e))})}processXID(e,t){e?(e=e.xid||"",this.xid_value=e,this.xidReady(e),t(this.getEventData()).then(e=>{this.initialized=!0,this.initializeFennec()})):(this.xid_value="",this.xidReady(""))}initializeFennec(){var e=d.FNC.fennec||{},t=d.FNC.FennecInstance;e.initialized||"function"!=typeof e.runFennecInject?!e.initialized&&t&&"function"==typeof t.initFennec&&(t.initFennec(),d.FNC.fennec=d.FNC.fennec||{_INITIALIZED:!0}):e.runFennecInject()}
2isAppMode(){var e=document.querySelector("body"),e=!!e&&e.classList.contains("app-mode"),t=new URLSearchParams(d.location.search).get("mode");return e||"app"===t||!!this.getCookie(n)||!!this.getLocalItem(n)}}).init(),d.FNC.xid=e)})(window);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.