Page 1 of 1

Site checking nsIAdblockPlus in Components.interfaces

Posted: Fri Sep 14, 2007 11:29 am
by King_Felix
Hi, I've laboured through most of the posts to see if this was mentioned before (the DannyCarlton posts were a great laugh), so I hope this hasn't been addressed before.....

I visit a site that recently has started blocking pages if the ABP extension is installed (even if I turn it off for this site), using JavaScript to see if nsIAdblockPlus is in Components.interfaces. The code used is roughly this:

Code: Select all

<script>
if(document.all){ci= new Array(1,2);}
else{ci=Components.interfaces;}
if("nsIAdblockPlus" in ci){
document.write('ad block detected');
var bod = document.getElementsByTagName("html");
bod[0].innerHTML = '<p align="center"><font face="Century Gothic">--some annoying stuff I won't repeat</font></p>';
}
</script>
Do you gurus out there have something that could help me get around this? Maybe even change the (internal?) name of ABP, so that nsIAdblockPlus doesn't get found? Thanks in advance!

Posted: Fri Sep 14, 2007 11:55 am
by Wladimir Palant
Yes, I have seen this already, and I am working on a solution. With some luck there will be a development build today.

Posted: Fri Sep 14, 2007 12:19 pm
by fanboy
awesome! :)

Posted: Fri Sep 14, 2007 1:01 pm
by King_Felix
Thanks in advance!

Posted: Fri Sep 14, 2007 1:06 pm
by Wladimir Palant
Development build is up: http://adblockplus.org/development-buil ... ity-closed

Note that it breaks all extensions using nsIAdblockPlus interface. See http://adblockplus.org/development-buil ... ity-update for a compatible Element Hiding Helper build, other extensions still have to be updated. The ones I know of are:

Filterset.G Updater
Adblock Plus Filter Uploader
backword

Posted: Fri Sep 14, 2007 1:23 pm
by King_Felix
Just tried it, and it seems to be working perfectly!

Haven't seen anything else broken, will keep you guys posted if I find anything. Thanks for the amazingly fast reaction, truely impressive.

Posted: Fri Sep 14, 2007 8:16 pm
by frenchfrog
New iteration is up on [link removed]

Code: Select all

<script>
function dieAdBlockPlusDie()
  {
  var giframe = document.getElementsByTagName("iframe");
  var bod = document.getElementsByTagName("body");
  var blocked=1;
  for (var i = 0; i < giframe.length; i++)
    {
    var name = giframe[i].getAttribute("name");
    if(name == "google_ads_frame")
      {
      var blocked=0;
      }
    }
  if(blocked)
    {
    bod[0].innerHTML = '<p align="center"><font face="Century Gothic">...</font></p>';}
  }  
setTimeout('dieAdBlockPlusDie()', 2000);
</script>
This doesn't directly detect adblock plus so I guess it's all _fine_. This version also have the advantage of possibly blocking other browsers.

EDIT: Problem is, it's not _portable_, if google update it's code all people which included this code will have to modify their pages.

Posted: Fri Sep 14, 2007 9:32 pm
by Wladimir Palant
Oh, you think that's the only problem? If Google's ads are down or simply slow, if the user has a slow or unreliable connection - this script will claim that people are blocking ads. And there are probably a dozen other reasons why this might happen. But why would the man who can simply block all Firefox users care?

PS: Link to Carlton's site removed - please don't give him more publicity than he deserves (which is: none at all).

Posted: Tue Sep 18, 2007 9:37 am
by Reve
Wladimir Palant wrote:Development build is up: http://adblockplus.org/development-buil ... ity-closed

Note that it breaks all extensions using nsIAdblockPlus interface. See http://adblockplus.org/development-buil ... ity-update for a compatible Element Hiding Helper build, other extensions still have to be updated. The ones I know of are:

Filterset.G Updater
Adblock Plus Filter Uploader
backword
No loss breaking the Filterset G updater really.

Posted: Tue Sep 18, 2007 9:44 am
by Wladimir Palant
Updates for Element Hiding Helper and Filterset.G Updater are available, Adblock Plus Filter Uploader is still in the review queue on addons.mozilla.org. Haven't heard anything from backword extension author, but then the dependency on Adblock Plus is absolutely minimal there.

Posted: Tue Sep 18, 2007 9:56 am
by fanboy
wasn't there a chrome:// bug, where javascript can reveal if you're running AB+?

Posted: Tue Sep 18, 2007 10:00 am
by Wladimir Palant