Which is the best method to block these ads?

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Which is the best method to block these ads?

Post by loveleeyoungae »

Hi, I'm trying to make a filters list specific for sites in my country (Vietnam), at least for me & my friends :D

I'm having some questions here, hope someone can tell me the basics:

1. Should I use one regex

Code: Select all

/(q|quang)cao
or two simple filters

Code: Select all

/quangcao
/qcao
?
(On the FAQ you say regex is slower, but I still think it's just a simple regex?)

2. On this site, there are two scrolling banners on two sides of the page. Because of the filter rule /adverti, most of the images/flash on the scroll are blocked, but at this time, it's still displaying a flash ad from another site. So I've tried inspecting the site and see these two elements: div id="divAdLeft" and div id="divAdRight"

When I added the filter #div(id^=divAd), it didn't list that ad as a blockable item in the blockable items list. Then was that ad still downloaded?
Is there any better way to block ads on this page? I want to permantly block them from being downloaded.

3. On this site VNExpress, should I add the filter /VAImages or only need to filter some script?
Because I think there is a script which loads all ads on this page, and if I block that only script then ABP wouldn't have to block every address containing /VAImages?
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Post by Hubird »

So it sounds like you a trying to make a supplemental list, this is probably the easiest way.

For http://dantri.com.vn/Sukien/uoc-rut-mot ... 258250.vip

I would use:

Code: Select all

/bannermanager/*

Code: Select all

vuvu.com.vn/services/*/ma1/

Regx filters are a LOT slower than normal filters and probably should be avoided if possible / practical.

For http://vnexpress.net/GL/Home/ I would use something like:

Code: Select all

/vnexpress.net/Files/VAImages/*
You will have to check the site for false positives because I can no understand Vietnamese. But it looks like it should be the trick if you are worried about just VAImages causing problems

Also the code

Code: Select all

/qcao
Is too short, I'm pretty sure it is best if your filters are at least 8 characters long

If you download the latest development build of ABP it warn you when you try to add a regular expression or a filter that is too short.

http://adblockplus.org/devbuilds/
User avatar
Adblock Plus Fan
Posts: 1255
Joined: Sat Feb 24, 2007 11:08 am

Re: Which is the best method to block these ads?

Post by Adblock Plus Fan »

loveleeyoungae wrote:1. Should I use one regex
or two simple filters
The standard recommendation is simple filters. You should base your list on as many simple filters as possible as long as you can avoid regexps in my opinion.

If you look at this graph: http://adblockplus.org/images/43.gif
The red line represents regexp performance and general filter performance from ancient Adblock versions.
Ignore the green line. The current ABP version is represented by the blue line if I recall correctly.
So, 100 regexps are considerably slower than 100 simple filters.

Then look at this graph: http://adblockplus.org/images/44.gif
The difference between 100 simple filters and 3000 simple filters is almost 0. But can you imagine how slow the red line would be at 3000 filters?

Wladimir wrote the article about performance here: http://adblockplus.org/blog/investigati ... algorithms

With this in mind, I recommend you to use simple filters as crazily as you want.

loveleeyoungae wrote:/quangcao
/qcao
To get more in depth. /quangcao is a fast simple filter, while /qcao is as slow as regexps.

To be a fast filter, you need to have 8 unbroken characters in a row. Filters that start and end with the / mark is regexp, so /example-ads/ is slow while */example-ads/* is fast.

I'll give you a few more examples:
http://ai.pricegrabber.com/*
12345678
*.imageshack.us/comments.js*
/advertpro/*

The 4 above filters are fast.

/advertpro/
12345*67890
/12345678/
*ads*
*/ads/*
The 5 above filters are slow as regexps.


So with these rules, /qcao is slow like regexp, if you can make the filter longer then it'll become fast, otherwise it won't hurt too much as long as you only have a few.

If you have many small/slow filters like /qcao, then you have the option to combine them into complex regexps of course, there will be advantage and disadvantages.
Huge, complex regexps appears to be faster than many small regexps, but at the same time they are harder to maintain. And it's harder to debug false positives. Furthermore your users lose flexibility to disable the individual regexps.
So there's advantage and disadvantage so the choice is yours.
loveleeyoungae wrote:When I added the filter #div(id^=divAd), it didn't list that ad as a blockable item in the blockable items list.
It is not displayed due to a bug. There is a workaround if you want to display it in the blockable items list.
1. go to the site.
2. open blockable items list.
3. open ABP preferences menu.
4. Click ok to close the preferences menu.
After this it should display your element rules, this method works for the latest stable version.
loveleeyoungae wrote:Then was that ad still downloaded?
Yes. All rules that look similar to #div(id^=divAd) or domain.com#div and so on do not block downloads, they only hide the ads.
loveleeyoungae wrote:Is there any better way to block ads on this page? I want to permantly block them from being downloaded.
Block it the normal way: http://adblockplus.org/en/faq_basics#objects
loveleeyoungae wrote:should I add the filter /VAImages or only need to filter some script?
Because I think there is a script which loads all ads on this page
You would need to experiment and test yourself, sometimes scripts have other important things in them and not just ads.
loveleeyoungae wrote:and if I block that only script then ABP wouldn't have to block every address containing /VAImages?
True, if you find a script that only loads ads, then the best way is to kill the script.
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Post by Hubird »

It has been suggested that:

Code: Select all

http://logging.*
And

Code: Select all

/bannermanager/*
Be added to the Easy subscriptions. If they are accepted they will save you a few filters !!
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

Wow, thank you, Hubird & Adblock Plus Fan! :D

I read the FAQ, but there are some parts I couldnt understand clearly, and you two make it easier for me :)

Well, I just have some last questions (I think :p )

1. Beside *, which one will break the "8 characters in a row"; or which ones of these are treated as RegExps?

Code: Select all

/12345/*
*/12345/
*/12/34/
/12/34/*
*//1234.
//1234.*
://123.*
*://123.
*123456*
*1234567*
*1234567
1234567*
/bn/*$~stylesheet
2. How could this filter /bn/*$~stylesheet block .SWF and .GIF files? I thought it should have been $~object in order to block .SWF, and $~image in order to block .GIF?
(Ex: http://ddth.com/)

3. @Adblock Plus Fan:
About the #div(id^=divAd) filter: Without this filter, the blockable items list shows an item: vuvu.com.vn..../yah230x210.swf
Now when I enable the filter, the list will only show the element #div(id^=divAd) as being filtered and WILL NOT show vuvu.com..../yah230x210.swf.

And thats what I meant, where is vuvu... and why doesnt it show in the blockable items list as being filtered (either hidden or blocked)?
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Post by Hubird »

1.

They are ALL slow filters

I does not matter where the 8 characters are as long as they are in a row.

eg:

12345678
*12345678
1*23456789
12345678*9

They all have 8 characters in a row so are fast filters.

2.

/bn/*$~stylesheet will block every thing in the path http://ddth.com/bn/ EXCEPT style sheets. This is because of the ~ symbol, it seems to mean NOT.

http://ddth.com/*$~image
Will block everything EXCEPT for images on ddth.com

http://ddth.com/*$image
Will block ONLY images on ddth.com

Try the above 2 codes and see the difference !!
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

Thanks Hubird.
My bad, I didn't notice the ~ character, sorry :oops:

Err, will ? break the 8-character thing, for ex.:

Code: Select all

abcd?efgh
User avatar
Adblock Plus Fan
Posts: 1255
Joined: Sat Feb 24, 2007 11:08 am

Post by Adblock Plus Fan »

loveleeyoungae wrote:Err, will ? break the 8-character thing, for ex.:

Code: Select all

abcd?efgh
? is valid in the url and will not break the 8 character string. Anything which is valid in an file's url will not break anything.

The * mark is obviously invalid and will break the 8 characters.
loveleeyoungae wrote:the list will only show the element #div(id^=divAd) as being filtered and WILL NOT show vuvu.com..../yah230x210.swf.
This is not supposed to happen. I think you saw wrong.
loveleeyoungae wrote:And thats what I meant, where is vuvu... and why doesnt it show in the blockable items list as being filtered (either hidden or blocked)?
vuvu... is not blocked therefore it cannot be red, it is still downloaded even though you hid it.
For each active hidden element on a page, the blockable items list will create a new entry just to show the element, they do not replace any other entry.
I see it right here on my list:
Image
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

Hmm, it seems that there was something wrong with the Flash plugin in my portable Firefox, so vuvu didn't show up even when I disabled the filters. Now it shows correctly.

Now I think I know what I should do :D
Thank you very much for all your support, Hubird and Adblock Plus Fan.

Greetings, :)
Hùng
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

Hello,

There is a little strange thing, so I want to make it clear:

In the EasyList, there is a filter:
/banners/*.gif$~background
which is NOT marked as RegEx by ABP.

But when I created this filter:
/banners/*.jpg$~background
then ABP marked it as RegEx?

Could anybody explain to me?

Btw, I'm using the development build of ABP 0.7.5.5, but why is the exported list only marked [Adblock Plus 0.7.1]?

Thanks in advance
smk
Posts: 100
Joined: Mon Jul 14, 2008 6:54 am

Re:

Post by smk »

/banners/*.jpg$~background
is not marked as regex for me
Btw, I'm using the development build of ABP 0.7.5.5, but why is the exported list only marked [Adblock Plus 0.7.1]?
You need to use 'third-party' option to make it display the correct format, as it is not backwards-compatible. Wladimir mentioned this somewhere, can't remember which post
Wladimir Palant

Post by Wladimir Palant »

/banners/*.jpg$~background has only two possible shortcuts - "/banners" or "banners/". If both are already taken by other filters, you will see a warning.

Exported lists always specify the minimal version that supports all your filters. Which will be 0.7.1 if you use filter options but not the $collapse or $third-party options that were introduced later.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

It isn't marking it as a regexp (well indirectly it is) ... it's marking it as too short (doing it here too). I think that there may be too many instances of /banners/ for it to create a new shortcut for this one. If you removed the EasyList, it would work.

**Edit: I see Wladimir beat me to it :)

/banners/*.jpg$~background will cause false-positives anyway. That's why it is not used in the EasyList
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

Okay, thanks, now I understand.
I think you may want to update the FAQ as well :)

About banners/.jpg...: Some websites in Vietnam use basic methods of advertising: they manually upload the ads images and manually edit the html index file to include those images :shock: And the only way to block them is to use a filter like that. Maybe I'll hide them instead.

@rick: I sent you a pm on your forum. Hope you read it :)
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

loveleeyoungae wrote:
@rick: I sent you a pm on your forum. Hope you read it :)
I saw it, but I am at work now. I'll look later.
Locked