UNPKG

@hs-web-team/adblocker-detect

Version:
1 lines 1.04 kB
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{checkAdblock:()=>n});let o=!1;window.hs_hasAdBlocker=o;const n=async()=>(o=await(async()=>{const e=await(async()=>{let e=!1;try{await fetch("https://www3.doubleclick.net",{method:"HEAD",mode:"no-cors",cache:"no-store"})}catch{e=!0}return e})(),t=await(async()=>{const e="hs-bait-notify",t=document.createElement("div");t.id=e;const o=document.createElement("div");return o.classList.add("ads","ad","banner","ad-banner","ad-banner-top"),o.style.width="1px",o.style.height="1px",t.appendChild(o),document.body.appendChild(t),new Promise((t=>{setTimeout((()=>{const o=document.getElementById(e);return t(!o)}),1e3)}))})();return e||t})(),window.hs_hasAdBlocker=o,o);module.exports=t})();