Moreover, if the gray ad were representative of the state of advertising on the internet, I highly suspect that less people would spend too much effort in blocking advertisements.
My ideal ad-blocking solution turns the popover, popunder, rollover-expanding, shouting at the top of their heads to get your attention advertisements into something as innocuous as that 'nasty' gray ad. I don't have a problem trading my eyeballs for a product, but I do have a problem when your ad takes over my browser, makes the page unusable, or is generally a pain in the ass.
Of course, my fix there isn't to use an adblocker, it's just to block the site altogether.
Correct, it isn't supposed to be used with ad providers that Adblock may (or may not) already block, it's supposed to work with internal ads that would come from the same domain as the content providers.
This solution (and those listed in the comments) are all very interesting solutions, well done. They might not work with different colour images, but they are interesting nonetheless.
I'm guessing intern at an ad network pitches he can come up with an "unblockable ad" to his boss.
Boss wants to go home for the holiday weekend so he says, "OK, whatever kid" as he's walking out the door just after lunch.
Intern signs up with a one-hour old HN account and posts his masterpiece here and starts playing whack-a-mole with the dozens of methods to trivially block the "unblockable ad".
After a couple hours, everyone gets bored and goes back to work. The intern frets and worries all weekend that he promised his boss an unblockable ad and won't be able to deliver on Tuesday when everyone is back in the office. Come Tuesday, he goes into the office, sweating and nervous to discover his boss wasn't in the slightest bit paying attention to whatever it was he was saying last Friday.
Thats a nice story, but unfortunately not the truth. This was simply a spur of the moment idea and I wanted to see if it worked, which to a relative degree it did, hence why I posted it. The main goal of posting it is to show how easy it would be for a website to show ads to a user, even with an extension such as Adblock enabled. In regards to the account, I haven't had a need for a HN account before now.
var found = false;
$('img').each(function(i, elem) {
var e = $(elem);
if( e.attr('src') !== '' && !found ) {
e.attr("style","opacity:0.0;");
found = true;
}
});
The point of ad blocking is not to block all ads, just to block the most atrociously annoying and privacy invading ones. If the end game is that advertisers all calm down and stick to static images that do not double as web bugs we will all be happy.
This works assuming assuming OP doesn't change the page again:
// First clear the interval assigned to window
var highestTimeoutId = setTimeout(";");
for (var i = 0 ; i < highestTimeoutId ; i++) {
clearTimeout(i);
}
// Then empty the script tag
$('script').eq(3).empty();
// Then hide the image;
$('img[src^="img"]').eq(0).hide();
This is an arms race situation. The winner is simply the last one to move. I'm not sure exactly what you're trying to implicitly say, but it was already pretty clear that the whole ad removal thing was an arms race. It's obvious that neither side can Win Forever.
Sorry, you don't get to work around successes every time someone posts one in order to claim that nobody can do it. The GP did it, the challenge has been won.
He's not denying that the challenge was met, he's setting another challenge on top of that. It's like reverse Ruby Koans. You don't complete the first challenge then declare your learning done, the challenge keeps building.
If a site did this I'd just leave tbh. I turn everything off and opt into advertising on sites I find I enjoy (if it turns out those sites had bad ads I just turn them off again).
For tracking, security, and analytics reasons, ad providers almost always originate ads from a separate domain than the content provider's.