sitexw / FuckAdBlock

Detects ad blockers (AdBlock, ...)
fuckadblock.sitexw.fr
MIT License
1.89k stars 257 forks source link

Not working with Firefox 46 on Linux #54

Closed MESWEB closed 7 years ago

MESWEB commented 8 years ago

This script not working. I have Firefox 46 with uBlock and I see "AdBlock is not enabled" on test page.

sitexw commented 8 years ago

You have Adblock or Adblock Plus ?

MESWEB commented 8 years ago

uBlock

sitexw commented 8 years ago

It's normal, they deliberately disable detection on my page...

fuckadblock.sitexw.fr#@#.pub_300x250
MESWEB commented 8 years ago

So where can I try this script online?

sitexw commented 8 years ago

You can return to http://fuckadblock.sitexw.fr/, the example now works.

To be exact, uBlock replaces "fuckadblock.js" by another faulty script, which makes the detection impossible. The solution is to use the attribute "integrity" of the "script" tag that matters FuckAdBlock. Here is an example :

<script src="//cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.js" integrity="sha384-8+ntjBhuf/Wf410gZ73ZRUggs/IUF495g5ld6wTBwjbTYW7MhoSMLh6YfDCBxnMA" crossorigin="anonymous"></script>

Now, if the script is compromised, it create an error that causes a positive detection.

For more information on the attribute "integrity", go here: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity

And the sha384 to easily create a script, go here: https://www.srihash.org/

MESWEB commented 8 years ago

So can You explain me how blocker mods recognize this script? By name or content? If I change script name that's not help?

sitexw commented 8 years ago

Yes, you can change the name, this will help. But I think that the "integrity" attribute is one of the best solutions, because it validates the authenticity of FuckAdBlock (this method will default recommended in V4).

MESWEB commented 8 years ago

So what about blocking loading script by mods?

Daijobou commented 7 years ago

I think you can close this issue. :)

integrity is a nice feature. Thanks for the hint.