Can't get a filter to be case insensitive

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
Kevin_Ar18

Can't get a filter to be case insensitive

Post by Kevin_Ar18 »

Let's say you add this element hiding rule:

##*[alt*=text]

This should hide any element with an alt attribute that contains "text" in it. However, it seems that the filter is case sensitive. It will not block "Text" or any other case.

I have not tested to see if it is just certain pages or not. Is there a way to make it case-insensitive all the time?
User avatar
fanboy
Posts: 3446
Joined: Sun Jun 17, 2007 4:45 am
Contact:

Re: Can't get a filter to be case insensitive

Post by fanboy »

Its not an issue with adblock, its CSS that is case sensitive.
Kevin_Ar18

Re: Can't get a filter to be case insensitive

Post by Kevin_Ar18 »

fanboy wrote:Its not an issue with adblock, its CSS that is case sensitive.
I thought it might be cause. :)

... Is there any alternative that would not be case sensitive? Would switching to the old non-css style work?



Is there any technical way to make ABP support case-insensitivity?


As you know, the case sensitivity makes it difficult to write effective filters. :(
Kevin_Ar18

Re: Can't get a filter to be case insensitive

Post by Kevin_Ar18 »

BTW, thanks for confirming that part about the CSS though. :)
Michael
Posts: 1361
Joined: Sat Dec 19, 2009 12:29 pm

Re: Can't get a filter to be case insensitive

Post by Michael »

Kevin_Ar18 wrote:Would switching to the old non-css style work?
I believe that the old style merely translated the filter into CSS, which was inefficient.
Kevin_Ar18 wrote:Is there any technical way to make ABP support case-insensitivity?
The only way that I can think of is to simultaneously create all possible rules (e.g. ###advert would result in #advert, #Advert, ###ADvert, ###ADVert and all the other possible permutations of lower and upper case letters). I don't really think that this would be an ideal solution for performance reasons and the lack of control that subscription authors would have - an exception for a rule would apply to all variations of the id of the element.
KevinAr18

Re: Can't get a filter to be case insensitive

Post by KevinAr18 »

Michael wrote:The only way that I can think of is to simultaneously create all possible rules (e.g. ###advert would result in #advert, #Advert, ###ADvert, ###ADVert and all the other possible permutations of lower and upper case letters).
Thanks. That's what I had in mind too.
Michael wrote:the lack of control that subscription authors would have - an exception for a rule would apply to all variations of the id of the element.
Could it not be made into an option instead of the default or done via something in regex... or some other way perhaps that would make it easy? In other words, it can be turned on and off. In this way, the option to use case-insensitivity would give greater power to writing filters.


Still, that doesn't solve the problem of "how" to make it work. :) I suppose you could inject some regex matching into the function(s) that lookup the CSS in the DOM ... but that is probably way beyond what you would want to do for an add-on. Oh, well, thanks for letting me know anyways... even if there is no easy way to implement such a thing in Adblock Plus.
Locked