Fuckadblock only recognizes that Adblock is turned off after many refresh on the page

Asked

Viewed 96 times

0

Hello, I’m trying to implement the ebit banner but I’m having problems with adblocks. In my previous question (ebit banner with 404 error and infinite loop with Adblock on) I was able to implement fuckAdBlock to block ads, but it is not recognizing when Adblock is not activated. Only after several refreshes on the page does it work.

This is my code:

document.addEventListener("DOMContentLoaded", function(){
   function adBlockNotDetected() {
     console.log('anuncio NAO bloqueado');
 }

 // Function called if AdBlock is detected
  function adBlockDetected() {
      //>>esta bloqueando mesmo sem o adBlock estar ativo<<
      console.log("Anuncios bloqueados");
  }
  
  if(typeof fuckAdBlock !== 'undefined' || typeof FuckAdBlock !== 'undefined') {     
      adBlockDetected(); 
  } else {     
      var importFAB = document.createElement('script'); 

      importFAB.onload = function() {          
          fuckAdBlock.onDetected(adBlockDetected);
          fuckAdBlock.onNotDetected(adBlockNotDetected);
      }


      importFAB.onerror = function() {        
          adBlockDetected(); 
      }

      importFAB.src = 'https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js'; 
      document.head.appendChild(importFAB);
  }
 });
 </script>

I found a post similar to mine https://stackoverflow.com/questions/45980660/detect-ad-block-script-runs-properly-only-on-hard-reload but when I add the fuckAdBlock.check(loop); he makes a mistake.

document.addEventListener("DOMContentLoaded", function(){ fuckAdBlock.check(loop); }); 

I don’t know if I wrote it right, because I didn’t want to use jQuery....

  • It is detecting "enabled" even without Adblock being enabled?

  • yes. It is always falling into the adBlockDetected() function and only after updating the page several times is it that it recognizes that Adblock is not active

  • which Adblock you are using?

  • https://getadblock.com/ version 3.28.0 , and I’m using Chrome

  • but I deactivated him to take the test, and yet you’re accusing him of being activated.

  • I’ll install it to test, it may not detect, will know

  • is this Adblock that use tb

  • and gave no trouble?

  • I’ll try it again here

  • opens this page and test... open the console to see the messages... works normal

  • Strange Hmmm q, here is still appearing the message of "Blocked Ads" on the console....

  • I’ll try to clear the Adblock and see what the

  • on the test? page even with Adblock disabled?

  • for me works normal when active or disable Adblock.

  • good, then you will see it’s my pc kkkk thing. If there appears normal then I think it should not have problem

  • vc uninstalled? what appeared with it uninstalled?

  • It might be interesting to test in another browser

  • In opera it worked!!!! Then it must be my Christ thing.

  • vlw for help! and sorry for taking your time ^^'

  • Imagine! If you need us.

Show 15 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.