Live data from Hacker News

I challenge you to remove the gray ad using Adblock

0x1b.pw

31–40 of 46 posts

Re: I challenge you to remove the gray ad using Adblock

#34

  var removeGrayImage = function() {
	$("img").each(function(idx, el) {
		var canvas = $("")[0];
		canvas.width = el.width;
		canvas.height = el.height;
		canvas.getContext("2d").drawImage(el, 0, 0, el.width, el.height);
		var pixel = canvas.getContext("2d").getImageData(1, 1, 1, 1);
		var r = pixel.data[0];
		var g = pixel.data[1];
		var b = pixel.data[2];
		if(r == 183 && g == 183 && b == 183) {
			$(el).css({opacity: 0});
		}
	});
  };

Re: I challenge you to remove the gray ad using Adblock

#35
It still has a style that the other image doesn't:

    style="height: 250px; width: 250px;"
After that, other than positionally blocking them, there's nothing that can be done short of visually inspecting the element.

You could modify the script to randomly place the ad either first or second, so you don't need the third tag with no src.

What is the goal of this experiment?

Re: I challenge you to remove the gray ad using Adblock

#36
post #35

It still has a style that the other image doesn't: style="height: 250px; width: 250px;" After that, other than positionally blocking them, there's nothing that can be done short of visually inspecting the element. You could modify the script to randomly place the ad either first or second, so you don't need the third tag with no src. What is the goal of this experiment?

What is the goal of this experiment?

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.

Re: I challenge you to remove the gray ad using Adblock

#38
post #34

var removeGrayImage = function() { $("img").each(function(idx, el) { var canvas = $(" ")[0]; canvas.width = el.width; canvas.height = el.height; canvas.getContext("2d").drawImage(el, 0, 0, el.width, el.height); var pixel = canvas.getContext("2d").getImageData(1, 1, 1, 1); var r = pixel.data[0]; var g = pixel.data[1]; var b = pixel.data[2]; if(r == 183 && g == 183 && b == 183) { $(el).css({opacity: 0}); } }); };

Damn, you went for the same solution as me. I didn't think anyone else would so obtuse as to use a canvas to access the raw image data.

Here's my equivalent solution:

  var canvas = document.createElement('canvas');
  canvas.height = 1;
  canvas.width = 1;
  var twodctx = canvas.getContext('2d');
  var blockImg = null;
  var qs = document.querySelectorAll('img');
  for (var i = 0; i 

Re: I challenge you to remove the gray ad using Adblock

#39

Earlier quoted context omitted.

Updated, try again ;)

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.

STOP HAVING FUN. THE FUN IS OVER.

Re: I challenge you to remove the gray ad using Adblock

#40
post #34

var removeGrayImage = function() { $("img").each(function(idx, el) { var canvas = $(" ")[0]; canvas.width = el.width; canvas.height = el.height; canvas.getContext("2d").drawImage(el, 0, 0, el.width, el.height); var pixel = canvas.getContext("2d").getImageData(1, 1, 1, 1); var r = pixel.data[0]; var g = pixel.data[1]; var b = pixel.data[2]; if(r == 183 && g == 183 && b == 183) { $(el).css({opacity: 0}); } }); };

I took yours and lukegb's a bit further - thanks for the inspiration. Probably overkill, though :-P

    var removeImageByHash = function() {
        var bad = [525994816];
        var canvas = document.createElement('canvas');
        var ctx = canvas.getContext("2d");
        var imgs = document.querySelectorAll('img');

        for( var idx = 0; idx 
Post reply on HN