Ask HN: Would it be possible to code an undetectable ad blocker?
My two cents: Wouldn't it be possible to just display ads in a sandbox environment invisible to the user and then display to the user an ad-free experience?
My two cents: Wouldn't it be possible to just display ads in a sandbox environment invisible to the user and then display to the user an ad-free experience?
I mean, anything is possible, but nowadays ads are hooked into all sorts of analytics software that determines how long an ad is on screen and things like that. You could try and implement something like what you're proposing, but it would show up as weird metrics on the advertiser's side.
Ads are already in a sandbox (iframe), so you could just make a little extension that sets iframes to display: none and give it a whirl if you wanted to test an MVP.
If you just don't want to see ads, by all means overlay them and your ad blocker will probably go undetected.
But a lot of people run ad blockers to save bandwidth or avoid being tracked or to avoid the malware that's been known to be distributed through even the most reputable ad networks. Overlays don't solve those problems.
Rather than sandbox the ads, pihole simply kills the DNS request for the ad resources - unlike most ad blockers the vast majority of ad/tracking resources simply never reach your computer, eliminating the need to dump them into a sandbox. In practice I've found it works on preventing ads on most sites that otherwise detect ad blockers and put up a "nag wall". For me anyway it's been much more effective than the browser based solutions, and with none of the DOM manipulation overhead etc.
Also has really nice advantage of blocking ads on devices that don't support adblocker extensions - games consoles, tv streaming boxes etc.
Thank you very much for your answer. I totally missed Pi-hole on HN and let met tell you, I just installed it and it's a real marvel.
That's exactly what I needed, the web is suddenly incredibly fast and ad-free, this is a dream come true!