Closed ale5000-git closed 7 years ago
Why ? Is it being detected on your side ?
Can you provide a use-case where it's being used by a website ?
If you go here and refresh the page you see "AdBlock is enabled". Sometimes it doesn't appears on first run.
Yes, I already saw that and the script being used is also a CSS bait which is easy to patch. Let me show you.
(function(){
var test = document.createElement('div');
test.innerHTML = ' ';
test.className = 'adsbox';
document.body.appendChild(test);
window.setTimeout(function() {
if (test.offsetHeight === 0) {
document.body.classList.add('adblock');
}
test.remove();
}, 100);
})();
As you can see it's checking whether a class named adsbox
is created or not. If created, then ads are allowed or if not, adblocker is on, that's the logic.
adsbox
is a class name which was taken from Easylist and can be easily changed too, so patching it globally won't help as the webmasters will use another class and it can go on, so patching globally won't work as you expect.
This is why I asked a use-case, what you provided is the proof-of-concept on that github.io domain.
Currently I haven't found a site that use it, but I will report if I will found it. I just opened the issue just in case it could be patched globally, if it isn't possible feel free to close the issue.
@Dibbyo456: You should open a separate issue.
@ale5000-git it's not actually a uBlock detection issue, so I thought asking it here would be ok.
It's not needed globally but that will be decided by @jspenguin2017 if such a case comes by.
What I'm saying is it would be futile to create a global patch for something that will not work as these classes can be changed as variables, so just report the websites and they will be patched.
@Dibbyo456 That's a third-party ad playing, report it to Easylist first and if they don't block it then on uAssets and gorhill will block it.
Incase if you want to block it yourself ||vzaar.com^$third-party
, also don't hijack issues like this again, open a separate issue with relevant details.
@Dibbyo456 Do not ask off topic questions here, that looks like an ad more than something else, you should report it to EasyList.
I don't think we can really make this generic, as they can easily change the test element. This trick is used rather frequently, but unfortunately, we have to solve it case by case.
I'll patch their test page.
We are actually going to solve this with forced CSS, since he might have .adsbox
on his other pages.
Fixed.
Is it possible to add a generic "bypasser" for this type of ad block detection?
Test link: https://codepo8.github.io/detecting-adblock/
Ref: https://github.com/codepo8/detecting-adblock/