Site checking nsIAdblockPlus in Components.interfaces

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
King_Felix
Posts: 4
Joined: Fri Sep 14, 2007 11:18 am

Site checking nsIAdblockPlus in Components.interfaces

Post 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!
Wladimir Palant

Post 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.
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

awesome! :)
King_Felix
Posts: 4
Joined: Fri Sep 14, 2007 11:18 am

Post by King_Felix »

Thanks in advance!
Wladimir Palant

Post 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
King_Felix
Posts: 4
Joined: Fri Sep 14, 2007 11:18 am

Post 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.
frenchfrog
Posts: 3
Joined: Mon Jan 29, 2007 4:42 pm

Post 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.
Wladimir Palant

Post 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).
Reve

Post 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.
Wladimir Palant

Post 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.
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Post by fanboy »

wasn't there a chrome:// bug, where javascript can reveal if you're running AB+?
Wladimir Palant

Post by Wladimir Palant »

Post Reply