Investigate rejecting too broad filters
This come from Easylist issue https://github.com/easylist/easylist/issues/6123
A filter with a single letter (
u) was added to the filter list basically blocking any URL containing
So we should investigate what is the minimum length of a generic filter to not be reject.
A few key item to consider:
- Check all Easylist to determine what the minimum relevant filter
- Interestingly the matcher, as an implementation detail, limit "keywords" to 3 chars. Keyword are continuous string of alpha-numerical values to classify filters for lookup purpose. It indicate to some extent what amount of information is considered.
What to change
filterClasses.js to reject filters deemed too broad.
This will introduce two new invalid filter reasons which may require associated UI messages:
- filter_url_not_specific_enough - when a generic URL filter's pattern is 3 characters or less
- filter_elemhide_not_specific_enough - when a generic elemhide, elemhide exception, or elemhide emulation filter's body is 2 characters or less
- Try to add a short generic filter, like
- You should be unable to add this as a custom filter, since these are now invalid filters.
- This only applies to generic filters, so if you specify a domain,
u$domain=example.com, then it is valid.