@hs-web-team/adblocker-detect
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},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:()=>i});var n=function(e,t,n,o){return new(n||(n=Promise))((function(i,c){function d(e){try{a(o.next(e))}catch(e){c(e)}}function r(e){try{a(o.throw(e))}catch(e){c(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(d,r)}a((o=o.apply(e,t||[])).next())}))};let o=!1;window.hs_hasAdBlocker=o;const i=()=>{return e=void 0,t=void 0,c=function*(){return o=yield n(void 0,void 0,void 0,(function*(){const e=yield n(void 0,void 0,void 0,(function*(){let e=!1;try{yield fetch("https://www3.doubleclick.net",{method:"HEAD",mode:"no-cors",cache:"no-store"})}catch(t){e=!0}return e})),t=yield n(void 0,void 0,void 0,(function*(){const e="hs-bait-notify",t=document.createElement("div");t.id=e;const n=document.createElement("div");return n.classList.add("ads","ad","banner","ad-banner","ad-banner-top"),n.style.width="1px",n.style.height="1px",t.appendChild(n),document.body.appendChild(t),new Promise((t=>{setTimeout((()=>{const n=document.getElementById(e);return t(!n)}),1e3)}))}));return e||t})),window.hs_hasAdBlocker=o,o},new((i=void 0)||(i=Promise))((function(n,o){function d(e){try{a(c.next(e))}catch(e){o(e)}}function r(e){try{a(c.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(d,r)}a((c=c.apply(e,t||[])).next())}));var e,t,i,c};module.exports=t})(); | ||
(()=>{"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})(); |
{ | ||
"name": "@hs-web-team/adblocker-detect", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Script to detect the presence of AdBlockers", | ||
@@ -8,3 +8,3 @@ "repository": "https://github.com/HubSpotWebTeam/adblock-detect", | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
@@ -31,12 +31,12 @@ "browser": { | ||
"devDependencies": { | ||
"@types/node": "^18.15.0", | ||
"@typescript-eslint/eslint-plugin": "^5.54.1", | ||
"@typescript-eslint/parser": "^5.54.1", | ||
"eslint": "^8.36.0", | ||
"ts-loader": "^9.4.2", | ||
"tslib": "^2.5.0", | ||
"typescript": "^4.9.5", | ||
"webpack": "^5.76.1", | ||
"webpack-cli": "^5.0.1" | ||
"@types/node": "^20.10.8", | ||
"@typescript-eslint/eslint-plugin": "^6.18.1", | ||
"@typescript-eslint/parser": "^6.18.1", | ||
"eslint": "^8.56.0", | ||
"ts-loader": "^9.5.1", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.3.3", | ||
"webpack": "^5.89.0", | ||
"webpack-cli": "^5.1.4" | ||
} | ||
} |
4541
-13.44%