You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, it seems that adblocks are always detected when used in ReactJS even when there are no adblock in place. The code below is copied wholesale from the demo website.
importReactfrom"react";importReactDOMfrom"react-dom";importfuckAdBlockfrom"fuckadblock";classDetectAdBlockextendsReact.Component{// Function called if AdBlock is not detectedadBlockNotDetected=()=>{alert("AdBlock is not enabled");};// Function called if AdBlock is detectedadBlockDetected=()=>{alert("AdBlock is enabled");};detectAdBlock=()=>{// We look at whether FuckAdBlock already exists.if(typeoffuckAdBlock!=="undefined"||typeofFuckAdBlock!=="undefined"){// If this is the case, it means that something tries to usurp are identity// So, considering that it is a detectionthis.adBlockDetected();}else{// Otherwise, you import the script FuckAdBlockvarimportFAB=document.createElement("script");importFAB.onload=function(){// If all goes well, we configure FuckAdBlockfuckAdBlock.onDetected(this.adBlockDetected);fuckAdBlock.onNotDetected(this.adBlockNotDetected);};importFAB.onerror=function(){// If the script does not load (blocked, integrity error, ...)// Then a detection is triggeredthis.adBlockDetected();};importFAB.integrity="sha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w=";importFAB.crossOrigin="anonymous";importFAB.src="https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js";document.head.appendChild(importFAB);}};render(){return(<divid="adblock-wrapper"><buttononClick={this.detectAdBlock}>click me</button></div>);}}constrootElement=document.getElementById("root");ReactDOM.render(<DetectAdBlock/>,rootElement);
The text was updated successfully, but these errors were encountered:
As the title says, it seems that adblocks are always detected when used in ReactJS even when there are no adblock in place. The code below is copied wholesale from the demo website.
Here's the link: https://codesandbox.io/s/64k2rx8w03
The text was updated successfully, but these errors were encountered: