
Ask HN: Would it be possible to code an undetectable ad blocker? - guilamu
I&#x27;m lacking the technical knowledge to answer this question, but I would have thought it would be something within the realm of possibility, but since no one has ever done it yet, I guess I&#x27;m wrong and I would really like to know why.<p>My two cents: Wouldn&#x27;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?
======
claudiulodro
As someone that has developed ads before, not really.

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.

~~~
patrics123
What about visually overlaying all the ad areas with something else ... lets
say whitespace or cat-pictures instead? ;-)

~~~
twobyfour
That depends on what your purpose is for using an ad blocker in the first
place.

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.

~~~
guilamu
I guess we can all agree that we can't make it undetectable if ads are not
loaded at all. The idea would be to load them in a sandbox environment (so it
would be harmless whatever malware is attached) and then just send the webpage
back to the user ad free.

------
giobox
Whilst It won't be completely 100% undetectable, in practice I've found Pi-
hole gets close to delivering the sort of browsing experience you are looking
for.

[https://pi-hole.net](https://pi-hole.net)

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.

~~~
guilamu
Hello giobox,

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!

