PageSourceSearch

https://www.tomshardware.com/vite/assets/RegionRedirectBanner/RegionRedirectBanner.ts-C9aGhgr0.js

js tomshardware.com collected 2026-09-24 08:26:53 UTC 2,130 bytes, 1 lines download raw bytes

1const e="SLICE_popup_displayed",t=(e,t,n,r)=>{const a=r.match(/<a [^>]*>(.*?)<\/a>/),o=a?a[1].trim():"";window.dispatchOrQueueAction("freyr.sendEventToFreyr",{name:"elementInteraction",eventObject:{element:{action:e,id:"region-redirect-banner",class:t,name:null,text:o,label:null,container:n,url:document.URL}}})};window.reliableDOMContentLoaded.then((()=>{const n=window.utils,r=document.querySelector(".region_redirect_banner");if(!r)return;const a=r.dataset.currentEdition??"",o=r.dataset.normalisedDomain??"",i=r.dataset.translations??"[]";if(n.getCookieValue(e))return;const s=n.getCookieValue("FTR_Country_Code");if(!s)return;let l=[];try{l=JSON.parse(i)}catch{return}const c=l.find((e=>e.locale===s));if(!c)return;if(s===a)return;if("ES_US"===a&&"US"===s)return;const d=r.querySelector(".region-redirect-banner__text");if(!d)return;const u=document.createElement("template");u.innerHTML=c.translatedText,d.replaceChildren(...Array.from(u.content.childNodes)),d.querySelectorAll("a[href]").forEach((e=>{const t=e.getAttribute("href");t&&(t.startsWith("/http://")||t.startsWith("/https://")?e.setAttribute("href",t.slice(1)):/^\/www\.[^/]+\.[a-z]{2,}(\/|$)/i.test(t)&&e.setAttribute("href",`https://${t.slice(1)}`))})),r.style.removeProperty("display"),t("appear","region_redirect_banner","DIV",c.translatedText);const m=()=>{r.style.display="none"};d.addEventListener("click",(()=>{m();const r=new URL(c.homepageLink.trim(),window.location.origin).href;n.setCookie({name:"FTR_User_Defined_Country_Code",value:c.locale,path:"/",domain:o}),n.setCookie({name:e,value:"true",path:"/",domain:o}),n.setCookie({name:"FTR_User_Defined_Homepage",value:r,path:"/",domain:o}),n.setCookie({name:"FTR_User_Defined_Homepage_Link",value:r,path:"/",domain:o}),n.setCookie({name:"FTR_User_Defined_Homepage_URL",value:r,path:"/",domain:o}),t("click","region-redirect-banner__text","SPAN",c.translatedText)}));const _=r.querySelector(".region-redirect-banner__close");null==_||_.addEventListener("click",(()=>{m(),n.setCookie({name:e,value:"true",path:"/",domain:o}),t("close","region-redirect-banner__close","BUTTON",c.translatedText)}))}));

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.