abp-filter-parser icon indicating copy to clipboard operation
abp-filter-parser copied to clipboard

Fixes for abp-filter-parser

Open joanbm opened this issue 8 years ago • 0 comments

I have been using this project and have found what (AFAIK) is a bug in the exception filter match checks, and also a potential enhancement to the filter match checks to support HTML rule filters (currently unsupported / crashes on call).

All info for reviewing the changes is included in the code/comments/commit logs.

The thing I'm a bit doubtful about in this pull request is the change to cleanedInput. cleanedInput basically contains the URL with the http/https prefix removed, and is used right before checking is a filter matches. I removed it because if it's present, the test in parser-test.js that includes '@@|http://example.com' as an exception filter fails, because this filter is added with the "http://" prefix in the exception bloom filter. If later, one tries to query against exceptionBloomFilter with cleanedInput, it will NOT match because the http:// prefix has been removed from cleanedInput, so there's no substring match. I don't see how this could work if the prefix is removed, and I can't find any reason to remove the prefix before matching, so I decided to remove this.

Any comments/possible improvements/etc. gladly accepted ;)

joanbm avatar May 07 '17 14:05 joanbm