After searching Google and Stackoverflow for a few hours I could not find a solution. What I'm trying to do is detect Adblock plus and display a simple message for now.
What I want to do is detect Adblock plus without using a JavaScript file or jQuery. Most of the adblock plus detect scripts they use a file, example "show_ads.js" that is hosted on there own domain with a line it in to set it "adblock = false;"
The problem with using a JavaScript file, users can white list that JavaScript file and it will no longer detect it. What I'm looking for is a JavaScript that loads directly into the HTML that would detect if someone is using ad blocker without the use of a file.
Example Below:
<script type="text/javascript"> // line of code that detects if using ad blocker if so display message </script>
The reason behind doing it this way no ad blocker can white list the JavaScript file on your server. Yes I know there are other methods of getting around this with NoScript addons but I already have a solution for that. I have a great idea that has never been tried and ad blockers cannot block this once I get done with it.
Any suggestions and Examples will be greatly appreciated.
Undetectable AdBlocker. This adblocker blocks ads on youtube, forbes, businessinsider and many other websites while remaining undetected.
9. Adblock Plus — An Open-Source Blocker You Can Trust. Adblock Plus is free and open-source, meaning anyone can view the code and fix bugs. That means you can be certain it doesn't track your data, or infect your device with malware.
ABS works by detecting and comparing locking on individual wheels. Meaning a car or motorcycle that experiences locking on all wheels simultaneously wouldn't trigger ABS. In the event that ABS fails, drivers should pump the brakes manually.
You don't need to have a plugin to detect adblock, simply use this:
<script type="text/javascript"> var adblock = true; </script> <script type="text/javascript" src="adframe.js"></script> <script type="text/javascript"> if(adblock) { //adblock is installed and enabled on this site :-D } </script>
Content of adframe.js:
adblock = false;
Update: Adblock Plus blocks certain requests or hides certain elements based on patterns it already has. One of those patterns is this (in patterns.ini):
[Filter] text=/adframe. hitCount=843 lastHit=1456391595626
which blocks any URL that has /adframe.
in it.
Update 25th august 2018
Adblock plus has changed the way it finds the list and blocks the ads. It has bunch of lists called subscriptions which are used for blocking. For example this one which is the default one:
https://easylist-downloads.adblockplus.org/easylist.txt
You can use the rules on this file to find a file name to use. For example you can use seo-ads.js
P.S for developers: For some reason I couldn't get ABP to block these files on local environment.
P.S: ABP is my favorite ad blocker :-D
Use my plugin "FuckAdBlock", it can very easily detect AdBlock: https://github.com/sitexw/FuckAdBlock
Example :
fuckAdBlock.on(true, function() { alert('AdBlock detected !'); }).on(false, function() { alert('AdBlock is not detected =)'); });
Example online: http://fuckadblock.sitexw.fr/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With