Page 1 of 1

Web page to check for ad blocking

Posted: Fri Dec 30, 2016 5:24 pm
by fivefilters
I've been working on a project to help promote ad blocking. It's a web page that will check for ad blocking and recommend an ad blocker if blocking is not detected.

The idea is to make it easier for others to install an ad blocker. It recommends a suitable blocker based on the browser or device detected. It currently checks for Chrome, Firefox, Microsoft Edge, Opera, Safari and iOS devices.

If anyone's interested in trying it out or reading more about it: https://blockads.fivefilters.org

Code at https://github.com/fivefilters/block-ads

Feedback appreciated.

Re: Web page to check for ad blocking

Posted: Sat Dec 31, 2016 1:35 am
by smed79
I've posted something similar here viewtopic.php?f=85&t=30824

Re: Web page to check for ad blocking

Posted: Sun Jan 01, 2017 10:57 pm
by fivefilters
Thanks, that looks really good! I guess the difference is yours is a way for webmasters to promote ad blocking on their existing sites - something I think definitely should be done more. Ours is a page that does only that.

I've used something similar to your code on fivefilters.org - we link to the Block Ads! site recommending an ad blocker if we detect the visitor isn't using one. The method we use there is to hide the link with inline CSS. Then we request ads.css in the HTML header and if that loads (sign of no blocking, because EasyList filters it out), it contains a style rule to display the link. Your way of using GoogleAd in the class attribute is much simpler, but I guess requires the ad blocker to filter elements on the page, not just HTTP requests.

With blockads.fivefilters.org we want it to work for as many different ad block solutions as possible, and on mobile too. So it only makes HTTP requests to known ad server domains. If you use something like an Android DNS-based ad blocker, e.g. https://github.com/julian-klode/dns66, or an ad-blocking VPN, it will detect the blocking. Whereas the element hiding technique, or relying on ads.css wouldn't work.