To Quote Wladimir Palant, developer of Adblock Plus
"There is only one reliable way to make sure your ads aren't blocked - make sure the users don't want to block them. Don't forget about the users, use ads in a way that doesn't degrade their experience."
Sounds like a very small phase in a cat-and-mouse chase. The people who use AdBlock are pretty technically savvy, they'll jump on another plug-in that bypasses the hack you've just mentioned in no time. And the hack doesn't work anyway for some existing popular adblock extensions.
Perhaps it would be more worthwhile to move to a different model altogether.
Many technical minded people tend to think that if something will eventually fail, it's not worth doing.
There's an old joke about a horse trainer who was ordered by his king, under penalty of death, to teach his horse to speak. So he very methodically starts to do just that. When asked why he's trying to do the impossible, he answers: "Teaching takes a long time. Maybe the king dies. Maybe the horse dies. Or maybe the horse learns to talk."
afaik, modifying css or not loading the advert is the most common adblock approach. To do anything lower level would be far harder.
One of the whole points of adblock is also to reduce bandwidth usage on the client side, increase load speed etc. So if you're using adblock and not loading ads from the server, that behavior is obvious and easily detected.
Advertising works extremely well. A very small minority of users decide to block all advertising without even giving websites the chance to show value in it.
I disagree about adBlock being tech savvy. Most of the time it's just doing regexps on iframe/image sources. Which is ridiculously naive.
Is this an ad? <a href=/foo.html>beds</a>. Definitely could be, yes. Can adblock block it? Nope.
If adblock did become more widespread (I doubt it will), then the advertising would just move server side, and become more hidden so that it can't be detected.
What's this alternate model you've devised for the web? Say we removed all advertising from the web, how much money would we each have to pay a day to replace that revenue? How many of us would be willing to pay to use the web like that? I know I wouldn't.
Some sites do this. In that case, you can guess that something is an ad based on the size of the image -- advertisers like to buy ads in standard-sized chunks, and you can just block all images that are that size.
Adblock also uses filters available from the Internet that automatically update at a certain interval. So if foo.com is even moderately popular, the filterset will be updated to block your site's ads reasonably quickly.
Finally, NoScript solves the problem of your adblock detector. If I don't run your detection code, the callback will not be called.
The number of people browsing with js disabled is pretty moot these days.
The number of people using Javascript to deny access to their site is pretty low these days. If that increases, the number of people blocking Javascript will increase.
I guarantee you that if someone wants to see the content on your site without ads, they will see the content on your site without ads. For example, you could just draw a white square over the ads instead of blocking them completely. You could make the DOM API return "uh sure, the ad is there", but not actually display it on the screen.
You're fighting a losing battle, and because adblockers are auto-updateable, even small victories won't last long. It's probably a better use of your time to do something, anything, else. It's like DRM -- a lot of development time sunk, just to hurt legitimate users. It doesn't make sense.
As I said, adblocking is extremely naive. <a href=http://www.foo.com>foo.com</a>; could be a paid advert for all you know, and the fact it is or isn't is hidden from you, and your adblocker. So I'm afraid the adblockers are firmly at the ultimate losing side. Sure, you can block intrusive flashing in your face advertising, but that's only one small segment of online advertising. (And nowhere near as effective as text links).
Well, the good news, is that you're an extremely tiny minority.
Most people like ads. Many even click on them! Loads even go on to buy products! Using money!!!!
I wouldn't go so far as to say people like ads. They tolerate them and are influenced by them, yes, but like? That's taking it to a bit of an extreme.
For my case, even though I'm defending these advertisements, I think they are poison. When possible, I pay to get service that lacks ads. If I could pay Google $100 per year to not show me any Adsense or Adwords ads, for example, I probably would.
That's quite a threat. If you make me actually pay for what I consume in your store, I'll take my business elsewhere! You better watch it. I'm not kidding about this. You just lost a non-paying customer, you SOB!
Most sites don't get their views from people typing the URL into the URL bar. Maybe it's the "non-paying customer" that posts your site to HN and Reddit every day. By banning that one user who doesn't like ads, you lose the opportunity to serve thousands of ads.
Also, if you don't like people stealing your content, you'd better block Google. They display their own ads next to your content!
Finally, ads are not just on content sites. Amazon.com has ads, which I block. I spent like $3000 at Amazon last year. If they block me because I'm not viewing their ads, that's $3000 in tangible revenue down the toilet, all so they could make 30 cents on some ad views. Needless to say, I doubt Amazon will be banning me for not viewing ads any time soon.
You're coming out with some crazy strawman arguments. obviously amazon wouldn't block you. They don't make all their money from advertising. They're primarily a retailer :/