View previous topic :: View next topic |
Author |
Message |
Woody Guest
|
Posted: Mon Jan 31, 2005 Post subject: AdBlock and Bannerblind |
|
|
From the FAQ:
# Will Adblock ever filter images based on their size?
No -- there's already a suitable solution for this in Bannerblind.
The last version of Bannerblind is dated 2003-08-21 and it doesn't work with Firefox 1.0. Why do not add such a great feature to the AdBlock?
I have looked for an extension with this functionality, but couldn't find such. Is there any way to block images with certain sizes? |
|
Back to top |
|
 |
Guest
|
|
Back to top |
|
 |
Woody Guest
|
Posted: Mon Jan 31, 2005 Post subject: |
|
|
kstahl wrote: | No, Adblock only blocks based on URLs.
More importantly, there is no way for Firefox or Adblock to know how big an image is without downloading it first so you would be caught in a catch 22. |
kstahl wrote: | Anonymous wrote: | I thought there was a way to block images based on image dimensions WxH. |
Not with Adblock, no. The reasons are the same as for file size. |
Is it possible to begin download every image (if it passes the RegExp filter), recognize .gif, .jpeg or somewhat else header and stop downloading if determined WxH is denied? |
|
Back to top |
|
 |
wonkothesane The Other Developer
Joined: 22 May 2004 Posts: 210
|
Posted: Mon Jan 31, 2005 Post subject: |
|
|
Woody: no, only file sizes are normally included in the header, not image dimensions. |
|
Back to top |
|
 |
Drahken
Joined: 30 Oct 2004 Posts: 107
|
Posted: Mon Jan 31, 2005 Post subject: |
|
|
Umm.... have you ever tried to view properties on an image in firefox while it's still loading? Firefox will tell you the dimensions the instant the pic begins to load, but won't tell you the filesize until it's fully loaded and cached. I don't know if firefox is getting the dimensions from the header or the server, or some other source, but it somehow gets the info before the image loads. (This holds true on all images, not just progressive/interlaced ones, and not just ones that have the size defined in the HTML (in fact, if the size in the HTML is different from the true dimensions, the properties popup will tell you the images actual dimensions).)
If you can figure out how/where firefox is getting this info, you could use it to make woody's suggestion work.
http://allspark.net/cypherswipe/image-properties.png
The JPG one was a progressive image. The properties popup was opened after the initial scan layer, so that might have told firefox about the dimensions.
The PNG one was a standard (non-interlaced) one. The properties popup was opened when the pic was less than 1/3 loaded. That could have been enough to tell firefox the width, but not the height. |
|
Back to top |
|
 |
wonkothesane The Other Developer
Joined: 22 May 2004 Posts: 210
|
Posted: Mon Jan 31, 2005 Post subject: |
|
|
Drahken: you're free to use Live HTTP Headers (or an OS-specific equivalent) to see what headers servers return when you dispatch an HTTP request for an image file. Without downloading the image, that's all you get access to (through a HEAD request).
In general, the first few hundred bytes of an image are devoted to describing the content -- mainly color metadata and the image's dimensions. Firefox (well, Gecko, technically...) figures out the size of an image by downloading and beginning to render the image itself. |
|
Back to top |
|
 |
Woody Guest
|
Posted: Tue Feb 01, 2005 Post subject: |
|
|
wonkothesane wrote: | In general, the first few hundred bytes of an image are devoted to describing the content -- mainly color metadata and the image's dimensions. | Yes, I have mean exactly this.
wonkothesane wrote: | Firefox (well, Gecko, technically...) figures out the size of an image by downloading and beginning to render the image itself. | Oh, it's a pity. So, Firefox' barebone must be modified in order to give extensions the access to such images manipulating? |
|
Back to top |
|
 |
Ferhat Guest
|
Posted: Wed Mar 23, 2005 Post subject: hmm.. |
|
|
I have come to this discussion via a topic I have written.
I read it all, I think I have got the point. BUT, what I have on my mind was the HTML source. As far as I know a browser download the HTML code first and than compile this script and generate the site, isnt it?
If so, mostly the ads are send with SRC, WIDTH and HEIGHT tags. Maybe this can be used... |
|
Back to top |
|
 |
rickst29 Guest
|
Posted: Fri Mar 25, 2005 Post subject: spring1 |
|
|
I think Ferhat is right-- nearly all code generators (Dreamweaver, etc.) will provide the image size via HTML <image> properties heigth="xx" and width="yy"</image>. Therefore Adblock doesn't have to inspect the leading bytes of the image binaries in order to determine the size. It's given to us by the HTML in the VAST majority of web pages.... I'd guess more than 98% of pages downloaded in the USA. (I hardly ever visit native-language Asian and European websites, so I can't speak for their HMTL generation tools).
And, looking just now at "My Yahoo" home page, created by Yahoo's proprietary generator, the image for the current advertisement shows: alt="click here" width="728" height="90". Doing a bunch of reloads, I see that ALL of the ads being served today have the same dimensions.
But, some ads are now being created as tables, effectively bypassing Adblock. For example, "My Yahoo" often shows a "yahoo personals" ad, formatted as a table. The width is either 728 or 730, it always fills the exact same size (via bgcolor) as the image advertisements. They're not showing it today, I've done several reloads.
So I think it would be even better if you allowed adblock to kill table elements, and/or entire tables, and not just images/plugin stuff, via dimensions as well as URLs (either or both, with wildcard matching as currently implemented for image and flash and etc.).
With my greatest thanks for Adblock, Rick Stockton |
|
Back to top |
|
 |
Zachariah

Joined: 21 Jul 2004 Posts: 703 Location: Earth
|
Posted: Fri Mar 25, 2005 Post subject: |
|
|
I have a sneaking suspicion that Adblock doesn't read the HTML file at all. If this is the case then it won't matter if the dimensions are in the HTML.
My guess is that it looks at the URL of each object which Mozilla/Firefox requests, and matches that against its list.
If I'm right, then that explains why Adblock needs to download the object to know its dimensions. _________________ • Latest Adblock!
• If all else fails try a really fresh install of Firefox. |
|
Back to top |
|
 |
kstahl Support
Joined: 02 Jan 2004 Posts: 1202 Location: Stockholm, Sweden
|
Posted: Fri Mar 25, 2005 Post subject: |
|
|
That is correct. Adblock hooks into the same mechanism used in Firefox's own internal image blocker. Every request for remote content is passed through Adblock which tries to match it against the filter list.
Adblock does not parse the HTML, nor can it modify it. _________________ Adblock 0.5.3.042
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1. Gecko/20051111 Firefox/1.5 |
|
Back to top |
|
 |
Drahken
Joined: 30 Oct 2004 Posts: 107
|
Posted: Sat Mar 26, 2005 Post subject: |
|
|
1) Has anyone ever tried forcing an old extension to install by going into about:config and changing all the references to a version number to something early enough for the extension to accept?
2) Bannerblind was nice, but it was really just a simpler way to do what you can still do by editing the usercontent.css file. Bannerblind didn't actually block any images, it just hid them. The usercontent.css method works the same way. |
|
Back to top |
|
 |
raphael Guest
|
Posted: Tue Jul 12, 2005 Post subject: |
|
|
kstahl wrote: | That is correct. Adblock hooks into the same mechanism used in Firefox's own internal image blocker. Every request for remote content is passed through Adblock which tries to match it against the filter list.
Adblock does not parse the HTML, nor can it modify it. |
Adblock can modify the HTML, as you can see here:
http://aasted.org/adblock/viewtopic.php?t=2194 |
|
Back to top |
|
 |
Drahken
Joined: 30 Oct 2004 Posts: 107
|
Posted: Tue Jul 12, 2005 Post subject: |
|
|
It's obvious that adblock can parse and alter the html to at least some degree, based on the simple fact that it can A) hide ads instead of blocking them completely and B) collapse most ad containers. This means that it must first locate the html for the ad and/or container, then ad style="display:none !important;" into said html. |
|
Back to top |
|
 |
Zachariah

Joined: 21 Jul 2004 Posts: 703 Location: Earth
|
|
Back to top |
|
 |
|