[1] See https://github.com/chrisaljoudi/uBlock/tree/master/platform/..., the code is in `vapi-client.js`, line 247.
You really have to start from the bottom up assuming that things are going to get blocked for some people and build in graceful degradation of performance:
https://www.exratione.com/2014/12/practice-defensive-javascr...
Though the problem in this article looks more in the way of something to be caught by a sufficiently well constructed QA process, followed by a bug filed with the ad blocker in question.
See, I don't agree with this - it's like saying as a site-owner, you need to cater to people who disable JavaScript, or who use Ghostery.
Sure, you can cater to them if you like (or if you think they're a sizeable portion of your audience). But if I was using one of those two, I certainly wouldn't go whine to a site owner and say "Your site doesn't work for me!". It's my choice to use those products.
Likewise for ad-blockers - sure, I use ad-blockers. But if a site breaks for me, I don't go whine to that site owner. I just choose to either disable the ad-blocker for that site (if the site has content I want), or I just don't frequent that site (if it doesn't).
Disabling JavaScript, or using an ad-blocker is an elective thing that some people choose to do (whether for paranoia, or because ads annoy them). It's not like say, accessibility for colour-blind people or people using a screen-reader, who can't really choose their disabilities. I have sympathy for people with disabilities (I myself am hard-of-hearing), however, I have less sympathy for people who disable JavaScript or use ad-blockers (Note that I myself use one - but if it breaks something, I debug it myself).
If your site is monetized through something other than ads (e.g. purchases), it might be in your financial interest to make sure that your site works correctly even in the presence of a poorly-written ad blocker. Of course this depends on how many of your users are affected by the problem.
Now if your site is free, with no ads, then I can see how your philosophy could make sense.
It seems that the average number of page-views for all sites that are ad-blocked is something like 9% (and on some sites up to 50%)[1].
would you really want to sacrifice a 9-50% of possible revenue?
[1]https://www.quora.com/What-is-the-percentage-of-Internet-use...
Because advertisers are so aggressive about shoving shit in our direction. It's an arms race, and unfortunately we sometimes suffer from collateral damage.
I opened the page, and to my surprise,, the header image didn't show on my computer either, but it showed on my coworkers screen.
In my standard "eliminate all simple causes" method I switched to incognito, and the header image loaded.
Somehow, I was able to recognize that it was due to an extension that was not active in incognito, and that the header image was named ...ads.png and it was catching a rather generic Adblock matcher. We renamed the file and all was good.
Since I have JavaScript disabled by default, I encounter plenty of such messages; but almost all of them I can safely ignore. It wouldn't surprise me if there are messages to the effect of "This site is not compatible with adblock, turn off your adblocker for a better experence" - and upon acting on such a message, the poor luser gets bombarded with all manner of popups and other crap. Incidentally, that's a similar experience to when I first started browsing with disabled JavaScript, and made me become much more wary of turning it on just because some site wants me to.
It sounds like the ad blocker misused a regular expression and matched the string "twitter" in the wrong context. Some ad blockers just use files of regular expressions somewhat blindly. If you're looking at URLs, parse them.
<img src="/an_existing_image.jpg?&ad_box_" onerror="alert('You are using adblock')">
How it's made:1. Look into the most popular filter's used by adblock extensions: https://easylist-downloads.adblockplus.org/easylist.txt
2. Choose for example a querystring rule from the beginning (from the "General advert blocking filters")
3. Append it to the url of an existing image
4. Use the onerror event to detect if it wasn't loaded
Since it's like playing whack-a-mole, I think most ad blockers simply don't care if their presence is known.
If adblocking is all about user choice then it's only fair that sites have choice to serve that content too. Right now it's incredibly hard for sites to reliably know if someone is using adblock.
Attempting to purposefully disguise that usage goes beyond any accepted ethics of using adblock today.
no that's not true - it's "easy", as long as you have cooperation from the advertising network. Their ads could do some callback onto the main page.
makes me wonder, has anyone come up with headless ad-blocking for integration testing?