PageSourceSearch

https://hak5.org/cdn/shop/t/71/assets/component.age-gate.js?v=178206963185212261781745097028

js hak5.org collected 2026-09-24 08:34:15 UTC 1,332 bytes, 2 lines download raw bytes

1import{disablePageScroll,enablePageScroll}from"vendor.noscroll";import{isbot}from"vendor.isbot";function getAge(birthdate){const today=new Date;let age=today.getFullYear()-birthdate.getFullYear();const m=today.getMonth()-birthdate.getMonth();return(m<0||m===0&&today.getDate()<birthdate.getDate())&&age--,age}class AgeGate extends HTMLElement{#minimumAge=18;#ageGateFormEl=null;#ageGateErrorEl=null;constructor(){super(),this.#ageGateFormEl=this.querySelector("[data-age-gate]"),this.#ageGateErrorEl=this.#ageGateFormEl.querySelector("[data-age-gate-error]"),this.#ageGateFormEl.addEventListener("submit",this.#onFormSubmit.bind(this)),isbot(navigator.userAgent)?this.close():this.style.display===""&&this.open()}open(){disablePageScroll(),this.style.display=""}close(){enablePageScroll(),this.style.display="none"}#onFormSubmit(event){event.preventDefault(),event.stopPropagation();const data=new FormData(event.target),day=data.get("day"),month=data.get("month"),year=data.get("year");if(day===""||month===""||year==="")return;const age=getAge(new Date(year,month,day));age>=this.#minimumAge?(this.close(),sessionStorage.setItem("age-gate",age)):this.#ageGateErrorEl.style.display=""}}customElements.define("age-gate",AgeGate);
2//# sourceMappingURL=/cdn/shop/t/71/assets/component.age-gate.js.map?v=178206963185212261781745097028

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.