sitexw / fuckadblock Goto Github PK
View Code? Open in Web Editor NEWDetects ad blockers (AdBlock, ...)
Home Page: fuckadblock.sitexw.fr
License: MIT License
Detects ad blockers (AdBlock, ...)
Home Page: fuckadblock.sitexw.fr
License: MIT License
FuckAdBlock doesn't detect Adblock Plus on IOS 9.1.
Adblock Plus has introduce new filters that disable generic hiding or blocking rules for a given website whilst leaving site-specific rules intact.
https://adblockplus.org/development-builds/new-filter-options-generichide-and-genericblock
Hello,
Thanks so much for this plugin, it's really awesome for detecting ad blockers!
I've written a bookmarklet that injects your detector on a page, and unfortunately I've ran into pages that don't seem to have detection working. Here's the code for the bookmarklet:
javascript:(function() { var fuckAdBlock = false; var el=document.createElement('script');el.type='text/javascript';el.src='http://box.en.io/temp/blockadblock.js';document.getElementsByTagName('head')[0].appendChild(el); setTimeout(function() { myBlockAdBlock = new FuckAdBlock({ checkOnLoad: true, debug: true }); myBlockAdBlock.check(); }, 1000); })();
I'm running Adblock Plus on Chrome on OSX Yosemite.
Here's an example of it working on www.thedailybeast.com:
[FuckAdBlock][setOption] The option "debug" he was assigned to "true"
blockadblock.js:57 [FuckAdBlock][check] An audit was requested with a loop
blockadblock.js:57 [FuckAdBlock][_creatBait] Bait has been created
blockadblock.js:57 [FuckAdBlock][check] A check is in progress ...
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (1/5 ~1ms) was conducted and detection is positive
blockadblock.js:57 [FuckAdBlock][_stopLoop] A loop has been stopped
blockadblock.js:57 [FuckAdBlock][_destroyBait] Bait has been removed
blockadblock.js:57 [FuckAdBlock][emitEvent] An event with a positive detection was called
But here it is failing on about.com:
[FuckAdBlock][setOption] The option "debug" he was assigned to "true"
blockadblock.js:57 [FuckAdBlock][check] An audit was requested with a loop
blockadblock.js:57 [FuckAdBlock][_creatBait] Bait has been created
blockadblock.js:57 [FuckAdBlock][check] A check is in progress ...
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (1/5 ~1ms) was conducted and detection is negative
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (2/5 ~51ms) was conducted and detection is negative
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (3/5 ~101ms) was conducted and detection is negative
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (4/5 ~151ms) was conducted and detection is negative
blockadblock.js:57 [FuckAdBlock][_checkBait] A check (5/5 ~201ms) was conducted and detection is negative
blockadblock.js:57 [FuckAdBlock][_stopLoop] A loop has been stopped
blockadblock.js:57 [FuckAdBlock][_destroyBait] Bait has been removed
blockadblock.js:57 [FuckAdBlock][emitEvent] An event with a negative detection was called
Do you have any idea why the detection might not be working on about.com?
thanks!
hi, i found false positive problem in firefox with adblockplus extension.
I have the following code:
<script type="text/javascript" src="blockadblock.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<form method="POST" id="myform" action="http://example.com" data-ajax="false" target="_blank">
<input name="email" type="text"><input id="submit" type="submit" value="submit"></form>
<script>
function adBlockNotDetected() {
alert('AdBlock is not enabled');
}
function adBlockDetected() {
alert('AdBlock is enabled');
}
jQuery(function() {
jQuery('#myform').on('submit', function(e) {
e.preventDefault();
var d = new Date();
alert('Step 1');
if(typeof blockAdBlock === 'undefined') {
adBlockDetected();
alert('Step 2');
} else {
blockAdBlock.onDetected(adBlockDetected);
blockAdBlock.onNotDetected(adBlockNotDetected);
alert('Step 3');
}
alert('Step 4');
});
});
</script>
The idea is to check if ads are blocked upon form submit. The jQuery form submit hook seems to work just fine -- var d = new Date()
; executes as expected. Furthermore, alert('Step 1');
alert('Step 3');
and alert('Step 4');
execute as expected. However, the code after that does not execute (i.e. the ad block checking and related alerts)... and I'm not sure why. What is baffling is, the following works just fine -- it shows the proper alerts as expected:
<script type="text/javascript" src="blockadblock.js"></script><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
function adBlockNotDetected() {
alert('AdBlock is not enabled');
}
function adBlockDetected() {
alert('AdBlock is enabled');
}
jQuery(function() {
if(typeof blockAdBlock === 'undefined') {
adBlockDetected();
} else {
blockAdBlock.onDetected(adBlockDetected);
blockAdBlock.onNotDetected(adBlockNotDetected);
}
});
</script>
What is going on? Why isn't the first block of code working? Thanks!
Please add it :3
Firefox has a tracking protection feature that seems to have recently started blocking things like Google Adsense, Analytics, etc. It's based on Disconnect's blocklist. AFAIK, Firefox is the only major browser that actually blocks requests based on this setting, whereas other browsers only send the DNT header.
Would it be within the scope of this project to also detect "Do Not Track" for Firefox users? Detection should be easy:
if(navigator.userAgent.toLowerCase().indexOf('firefox') !== -1 && navigator.doNotTrack){
// DNT enabled
}
FuckAdBlock doesn't seem to pick up on Firefox DNT blocking. I've got it installed at http://proxyrox.com if you want to test - should display a big "Ad Blocking Software Detected" when blocking is detected.
FuckAdBlock, including the latest beta, cannot detect Google Chrome Disconnect:
https://chrome.google.com/webstore/detail/disconnect/jeoacafpbcihiomhlakheieifhpjdfeo?utm_source=chrome-app-launcher-info-dialog
I'd like to use this on my production site, but having profanity in the name makes it something I can't justify putting in our production code. Would you consider renaming it in the future?
They will simply add a filter to allow elements while blocking the advertiser in their "Easy list filter", even with javascript they will allow it or block it either or to bypass it. I tried many methods and the only was they cannot stop directly is by redirecting your site to a random free domain and checking if a ad blocker exist's then redirect it back to your domain and encoding it in the URL what the results were and the decide if you want to block the URL. The only problem with that is if the visitor do disable ad block on your domain when they go to the random free domain you created ad block is not disabled and it will detect it. They have very simple filters that will disable any detection on a domain that has a anti ad block on it. Once they add the random free URL to their Easy list you can change it to a new free URL. After awhile they will start removing the older URL's and then your reuse your old free URL's for detection. So if I didn't make since sorry, but the only way I have found to 100% block ad blockers is by my method above but it will effect users that do whitelist your domain.
First, great work! One of the simplest implementations I've seen. Recently I discovered that the script does not seem to detect Ghostery (https://www.ghostery.com/try-us/download-add-on/). Any thoughts on how to detect it?
Not sure, if that's an issue for those who plan to use it, but still worth mentioning.
Workaround I see is to request(and insert to page) content async way from JS in function called when adblock is not found, but this conflicts with progressive enhancement and can be kind of harmful (everyone has JS, right?).
tnx in advance ...
The script works, this is a major moral issue – if the user uses AdBlock to block unwanted content from running on their system, it is not morally acceptable to force them to accept content (like it’s being done here)
This is a moral and philosophical issue, not a technical one.
Hi, where can I find some useful baits? I don't have any ADs on website but I have facebbok like-box and when you get more filters in AdBlock I have empty space with AntiSocial AdBlock filter. Screenshots without
and with AdBlock.
But I don't want common bait because it blocks this like-box also when you have "just AdBlock".
callback in fuckAdBlock.on true, ()=>{}
is not called on lazy loaded elements
I copy and pasted the code. I don't know why it keeps saying adblock is detected when it is not.
Hi
I've tested this against the IOS 9 beta and I don't think it works.
I used this Adblocking-extension:
I know some of the appeal of FuckAdBlock surely comes from the straightforward name, but I'd like to point out that it's harder for sites to use FuckAdBlock because of the name. No sane website would use it for fear of users finding references to it while browsing around in the source.
Perhaps a different name is in order at some point?
Hello,
this JS library now blocking in Chrome, it's began about month ago
Having issues with a site using your "nice" script. Getting a bunch of error messages in Firefox' console saying:
The resource at "..." was blocked because tracking protection is enabled.
Obviosly, your script is not blocked, because the page is complaining about an (imaginary) adblocker. Now, the direct question: Do I have to install an Adblocker to protect me from your crazy script, if it even complains on a Firefox without any extensions installed?
(Btw, I can understand the purpose of not having ads blocked on a page, but providing scripts blocking a built-in tracking protection is not acceptable in any way in a post-Snowden age.)
they added a generic filter
I added "fuckadblock.js" and some javascript code from README.md to my application and got this:
Uncaught TypeError: fns[i] is not a function
How to stop blocking script by any Block like uBlock:
||site.coml$inline-script,first-party
Hey guys, so I'm testing this on Chrome with the standard AdBlock extension from https://getadblock.com/. Using your test page, if I pause the ad blocker before loading the page and then un-pause it after loading has finished, clicking on the "Check Again" button tells me that AdBlock is not enabled.
Is this a known issue or is it something new? Thanks
Hello everyone, I am currently working on the V4 FuckAdBlock.
A beta is scheduled for this week. She also solve the problem of not detecting AdBlock via the DOM.
If you have ideas for other features that could be added, made me know here.
Thank you.
I am having some users receiving false positives in Chrome. I've debugged on one of their machines and I can see that the bait div is being added to the DOM but the offsetHeight and clientHeight are 0 causing the detection to be true.
Any ideas here?
Thank you very much =)
Hello
Is this script ready to use in production?
Is it used by a company already?
Hello I catch you about unknown evasion again enabled AdBlock. I know now you are liar because you have given many German newspapers website like Bild.de, Suedkurier.de and more Why do you ruin my German newspapers websites. I will hold you if I have time to kill to fuckadblock. Bye bye
And you're really bad munderer again AdBlockers :(
I think it isn't right behaviour because we need to configure it after loading anyway.
I was reading arstechnica this morning and noticed it was loading a fork of this library with no attribution. A huge company like Condé Nast should know better than to use a library without proper attribution. Especially considering how much they complain about people reading their website for free.
@veeracs should not have removed the attribution at the top of the main library file. Considering you recently made sitexw/BlockAdBlock he should either start using that or provide proper attribution in his fork.
I would suggest you update your LICENSE file to make the copyright based on your name and e-mail address. I will post in the Ars Forums to try to get them to use sitexw/BlockAdBlock with proper attribution.
the problem if you add the website to white list or a page to white list adblock still detected as enabled
(disable for this website.. or disable for this page only) adblock still detected as enabled
you should disable adblock completely (disable everywhere) to be detected as not enabled
AdBlockers are awesome, stop infecting the web with invasive, annoying ads!
This script not working. I have Firefox 46 with uBlock and I see "AdBlock is not enabled" on test page.
Please fix this, if you do than website creators will be very happy.
Hello
Could you please update your file to blocks AdsBypasser script,
You can find this script in the following link:
https://greasyfork.org/en/scripts/4881-adsbypasser
Easylist has been adding this exception rule to a lot of domains:
@@||domain.com^$elemhide
Which effectively renders FuckAdBlock useless.
Please, try to work on a fix for this issue.
P.S. Here's the Easylist text which has all the rules and exceptions in it:
Script recognize sometimes AdBlock is enabled when we click ref link but Opera have disabled blocking ads. But I tested this on Waterfox and Chrome and script working fine. So please update code for new Opera.
Popular mobile & tablet browser with build in adblock
https://play.google.com/store/apps/details?id=com.UCMobile.intl
I have testest FuckAdBlock version 3 in production case. Version 3 working in Chrome and Firefox. (version 4 not working in firefox with adblockplus, more not tested). Internet Explorer 11 working only in development mode. I use your original source.
In development mode I get this in IE11:
[FuckAdBlock][setOption] The option "debug" he was assigned to "true"
[FuckAdBlock][on] A type of event "detected" was added
[FuckAdBlock][on] A type of event "notDetected" was added
[FuckAdBlock][onload->eventCallback] A check loading is launched
[FuckAdBlock][_creatBait] Bait has been created
[FuckAdBlock][check] An audit was requested with a loop
[FuckAdBlock][check] A check is in progress ...
[FuckAdBlock][_checkBait] A check (1/5 ~1ms) was conducted and detection is negative
[FuckAdBlock][_checkBait] A check (2/5 ~51ms) was conducted and detection is negative
[FuckAdBlock][_checkBait] A check (3/5 ~101ms) was conducted and detection is negative
[FuckAdBlock][_checkBait] A check (4/5 ~151ms) was conducted and detection is negative
[FuckAdBlock][_checkBait] A check (5/5 ~201ms) was conducted and detection is negative
[FuckAdBlock][_stopLoop] A loop has been stopped
[FuckAdBlock][_destroyBait] Bait has been removed
[FuckAdBlock][emitEvent] An event with a negative detection was called
[FuckAdBlock][emitEvent] Call function 1/1
[FuckAdBlock][clearEvent] The event list has been cleared
Now I set in your html a advertise-code directly after body-tag. I my case this line:
<script type="text/javascript">adscale_slot_id="*****";</script><script type="text/javascript" src="http://js.adscale.de/getads.js"></script>
the result is only this:
[FuckAdBlock][setOption] The option "debug" he was assigned to "true"
[FuckAdBlock][on] A type of event "detected" was added
[FuckAdBlock][on] A type of event "notDetected" was added
Its stop working. :(
EDIT: I refreshed the side many times (in IE11) and found out, that its for one advertise not working, for few another avertise its working fine. The reason:
window.addEventListener('load', function() { console.log("All resources finished loading!"); }, false);
its not called. The most cases its not working, is googleads-banner.
EDIT2: I think there are maybe advertise iframes that never ending loading? The problem have nothing todo with this plugin-code. I can shrink the problem to
window.addEventListener('load', function() {console.log('loaded');}, false);
this console.log only show very rare. For most (90%) this log is not loaded. So maybe add a timer, as fallback?
AdBlocker is blocking the page from loading the .JS file with FuckAdBlock. The error message in the browser's console: "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT"
Is there anyway around this?
Checking this v4 version for detecting iOS9 ad blockers, realized that basically, the XMLHttpRequest never changes to status 4, it's stopped after status 1.
Is not throwing an exception either, meaning that "detected" event is not triggered.
Hallo dear Develops.
Your project is not working when using uBlock Origin instead of AdBlock and/or AdBlock Plus.
Your current build, V4 (http://fuckadblock.sitexw.fr/beta/) shows only "Checking...". Nothing else happens. :(
Just wondering.. is having a 404 in the console for the "bait" file just a side-effect of using this?
GET https://mydomain.com/ad/banner/_adsense_/_adserver/_adview_.ad.json?adzone=top&adsize=300x250&advid=20019925 404 (Not Found)
I tried actually creating a adview.ad.json file at that location and when I do then this script acts as though adblock is enabled by default
You need a triple equals here:
https://github.com/sitexw/FuckAdBlock/blob/master/fuckadblock.js#L148
and in the lines below it.
:)
Please, allow es6 import
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.