It would also radically increase my bandwidth bills if the ads were anything but text or a small amount of (hopefully sanitised) HTML.
Both of these could be mitigated by adding an enormous amount of due diligence in terms of what ads I was willing to serve, but that would add a lot of extra cost to running the site.
There's no real technical barrier to doing it but I suspect the legal and operational barriers are more significant.
And yes, the DOM is involved too - ad blockers block URL patterns but also allow users to block DOM elements based on a selector-type syntax. The hardest ads to remove are ones where the DOM selectors are dynamic - i.e. server-side rendering producing divs with random CSS classes.
> It would also radically increase my bandwidth bills if the ads were anything but text or a small amount of (hopefully sanitised) HTML.
To an end user these sounds like features, not problems.
> Both of these could be mitigated by adding an enormous amount of due diligence in terms of what ads I was willing to serve
The lack of any vetting whatsoever is a big reason why adblock is so widespread. If you don't trust it enough to transmit it through your servers, why should I trust it to run on my computer?
I also think it'd be an interesting startup idea. I get that there would be some technical hurdles to overcome, especially with all the real-time bidding that goes on now. But I'm sure a couple smart people could come up with something. Could start with something as simple as a cron job, a WordPress plugin, or an nginx proxy.