The Adblock Project Forum Index The Adblock Project
Pull up a seat ...stay a while.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AdBlock blocking images it shouldn't

 
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sat Nov 29, 2003    Post subject: AdBlock blocking images it shouldn't Reply with quote

I've got several regexp entries in my AdBlock preferences to block images that comes from common directories and addresses like "ad", "ads", "advertising", etc, but I've found that some images that are given seemingly random names (ie, "/blahblahblahblahADblahblahblah/imagename.jpg") are getting blocked, even though it's not an ad. I used to use entries like *ads* that worked the same way, but images like "downloads.jpg" got blocked that way. Now, I don't know if my regexp entries are done correctly, but what I have for the AD and ADS entries are:

/[^a-zA-Z]ad[^a-zA-Z]/
/[^a-zA-Z]ads[^a-zA-Z]/

Is that done correctly? I'm trying to block things that ONLY have AD and ADS in the name and not just somewhere in the name. Any suggestions?
Back to top
Org



Joined: 23 Oct 2003
Posts: 349

PostPosted: Sat Nov 29, 2003    Post subject: Reply with quote

Have you checked the RegEx instructions:

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/regexp.html#1010689

Perhaps a RegEx like this might work for you:

/[\/.]ads?[\/.]/

This would block addresses like:

..tp://ad.xxx.yyy.com/
..tp://xxx.ads.yyy.com/
/ad/
/ads/

(I used "..tp" instead of http or ftp to prevent the forum software from making it a bogus link)
Back to top
View user's profile Send private message
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Sun Nov 30, 2003    Post subject: Reply with quote

Org:
I edited your expression to use literals.
Back to top
View user's profile Send private message
Org



Joined: 23 Oct 2003
Posts: 349

PostPosted: Sun Nov 30, 2003    Post subject: Reply with quote

Ok, thx. I didn't realise that Javascript RegEx's need quoting inside square bracket character classes. For example, in GNU grep or GNU Emacs quoting is not needed there. I guess there are countless of slightly different RegEx dialects out there these days.
Back to top
View user's profile Send private message
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Sun Nov 30, 2003    Post subject: Reply with quote

Org:
I hadn't considered that brackets might auto-literalize certain cases.
.
Quick testing revealed the period (.) is handled literally, but the forward and back-slashes (\ /) aren't.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Dec 01, 2003    Post subject: Reply with quote

That seems to have done the trick for me. Thanks guys! Regexp are pretty hard to wade through, and I Knew I'd made a mistake somewhere, but I wasn't sure where.
Back to top
Melon
Guest





PostPosted: Mon Dec 08, 2003    Post subject: Odd Reply with quote

Same topic, but different occurance so I might aswell post on this thread rather than starting a new one and then get reffered to this one.

Right, just made a filter of /hit/ but it seems to be blocking the image http://www.google.com/nav_page.gif and http://www.google.com/nav_next.gif

The reason is because I searched for "white" and with Check Parent Links enabled, it blocked out those 2 images.

just wondering what regex I can use that filters /hit/ but the above effect doesn't occur. I thought maybe using the above example i.e: /[\/.]hit?[\/.]/ but I don't want to be blocking websites like ..tp://hit.xxx.yyy.com/ or ..tp://xxx.hit.yyy.com/ I presume it's a case of removing the outer /'s ?

Thanks for any help.

(I really should get round to learning/understanding RegEx).
Back to top
Melon
Guest





PostPosted: Mon Dec 08, 2003    Post subject: Ah Reply with quote

Oops, just got it by removing the periods. Probably should have done my trial and error run before posting.
Back to top
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Mon Dec 08, 2003    Post subject: Reply with quote

Melon:
Are you sure this filter was blocking the images on google?: /hit/
.
You can verify which filters caught what by clicking the status-element. Select a blocked-element to see its filter.
Back to top
View user's profile Send private message
Melon
Guest





PostPosted: Mon Dec 08, 2003    Post subject: Reply with quote

I've already mentioned why the filter blocks the images

"The reason is because I searched for "white" and with Check Parent Links enabled, it blocked out those 2 images. "

and how I knew that filter was blocking those images was because I clicked on the method you've described.
Back to top
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Mon Dec 08, 2003    Post subject: Reply with quote

Melon:
Haha- yea, I read it too fast.
Back to top
View user's profile Send private message
Melon
Guest





PostPosted: Mon Dec 08, 2003    Post subject: Reply with quote

Hehe, you need to slow down. Take a step back from so much of your devotion (not that it's a bad thing) to this project Smile
Back to top
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Tue Dec 09, 2003    Post subject: Reply with quote

Melon:
Adblock, while fun, is really a side-project.
.
Since I have little time to allow for testing -- and only for one platform at that -- this forum provides valuable feedback. Mozilla users are naturally savvy, and these threads form a kind of knowledge-base for what's been solved, and how.
.
That's why I respond to everyone; ...even when taxed for time :P
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group