I need An Adblock Code that Will Remove HTML When Adblock Detected

smootie79

Power Member
Joined
Oct 11, 2013
Messages
534
Reaction score
584
I use iframes on some of my websites and I was wanting to know if anyone knows a simple tag or code that will remove the iframe or embed when adblock is detected so that way I can have a picture take its place.
 
Found the comment below on https://stackoverflow.com/questions/18180598/ad-blocker-detection-aka-adblock-plus/24111206. Seems like it would be able to solve your issue.

What I've seen in the field is using a background image behind the ad. If adblock isn't active, the ad will be displayed over the background-image (which makes the background-image not viewable). If adblock is active, the ad is blocked, and the user will instead see the background-image.

Code:
<div id="ad-container">
  <img src="../ad/ad.png" id="ad">
</div>
With CSS:

#ad-container {
  background-image: url( http://domain.com/pleasedonotuseadblocker.png );
  height: 200px;
  width: 200px;
}

#ad {
  height: 200px;
  width: 200px;
}
 
Found the comment below on https://stackoverflow.com/questions/18180598/ad-blocker-detection-aka-adblock-plus/24111206. Seems like it would be able to solve your issue.

What I've seen in the field is using a background image behind the ad. If adblock isn't active, the ad will be displayed over the background-image (which makes the background-image not viewable). If adblock is active, the ad is blocked, and the user will instead see the background-image.

Code:
<div id="ad-container">
  <img src="../ad/ad.png" id="ad">
</div>
With CSS:

#ad-container {
  background-image: url( http://domain.com/pleasedonotuseadblocker.png );
  height: 200px;
  width: 200px;
}

#ad {
  height: 200px;
  width: 200px;
}
This won't solve the problem. There is no provision anywhere in that code for detecting adblock. This will work for showing an image hidden behind another image(ad).
In this case it is the adblock that removes the ad. What the OP wants is to remove the iframe(video) if an ad is blocked.
We are not talking about replacing an ad with another image but rather removing another part of the html if the ad is not shown.
Look into the 'display: hidden' css property. You will need some sort of javascript to detect adblock then fire the diplay property if adblock is detected.
 
It’s chaturbate embed code i can’t see to find a way to show it so i might as well find something take iframe away so i can place click here or something
 
It’s chaturbate embed code i can’t see to find a way to show it so i might as well find something take iframe away so i can place click here or something
Just wrap it in a <div> with class name 'hide-chatturbate', then use your JS script that detects adblock to set the css style for the 'hide-chatturbate' class to 'display: hidden'.
 
Just wrap it in a <div> with class name 'hide-chatturbate', then use your JS script that detects adblock to set the css style for the 'hide-chatturbate' class to 'display: hidden'.
I pm you
 
Back
Top