Update filter validation messages
Background / User story
As mentioned in https://gitlab.com/eyeo/specs/spec/merge_requests/201#note_107805263 we want to update all of our filter validation messages.
All messages are displayed within a tooltip upon hover over the alert icon in the custom filter table.
Here are the latest messages for each of them, taken from filter-validation.json and common.json
Type | ID | String |
---|---|---|
error | elemhideemulation_nodomain | No active domain specified for extended element hiding filter |
error | invalid_csp | Invalid Content Security Policy |
error | invalid_domain | Invalid (or empty) domain specified |
error | invalid_regexp | Invalid regular expression |
error | snippet_nodomain | No active domain specified for snippet filter |
error | unexpected_filter_list_header | Filter list headers aren't allowed here |
error | unknown_option | Unknown filter option |
error | filter_action_failed | Something went wrong. Please try again. |
warning | slow | To ensure a fast filter, please check the length of the pattern and ensure it doesn't contain a regular expression. |
What is out of scope
List of all updated messages can be found here: https://docs.google.com/spreadsheets/d/1ELv_4zxjyJXr3_HdZS44dSEgB0doyRRA_H77NZkFL6Y/edit?usp=sharing
We have decided to limit the scope of this ticket to only updating existing messages, so some messages were left out and will be dealt with later, if necessary:
- regex (no ticket yet, see comment: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/issues/228#note_330767368)
- invalid css selector (was removed here: https://issues.adblockplus.org/ticket/7423, but we have a ticket open to add it back here: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/issues/558)
- duplicate filter (generic filter_action_failed error is shown in case of duplicated filter, we have a ticket open to add a specific error for duplicate filters here: https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/issues/467)
New error states | Proposed message |
---|---|
regexp | The pattern you entered will be interpreted as a regular expression which cannot be efficiently processed by Adblock Plus and may slow down your browsing experience. If you didn't intend to use a regular expression, add an asterisk (*) to the end of the pattern. |
invalid_css_selector | $selector$ is not a valid CSS selector (syntax does not adhere to standard). |
duplicate filter | Duplicate filter, please update or remove the filter |
What to change
- Design: N/A
- Research: N/A
- Spec: https://gitlab.com/eyeo/specs/spec/-/merge_requests/330
- Legal: N/A
- Development: Update existing errors/warnings with the new ones.
Hints for testers
Examples
ID | Incorrect | Correct | Reason |
---|---|---|---|
elemhideemulation_nodomain | #?#foo |
example.com#?#foo |
Element hiding emulation filters must be limited to at least one domain |
invalid_csp | example.com$csp=base-uri |
See Content Security Policy standard | Syntax doesn't adhere to standard. |
invalid_css_selector | ##.. |
See CSS Selectors standard | Syntax doesn't adhere to standard. |
invalid_domain | ,##foo |
##foo or example.com##foo or foo.com,bar.com##foo
|
Domain list must contain either zero, one or more comma-separated domains. |
invalid_regexp | /[/ |
See ECMAScript standard | Syntax doesn't adhere to standard. |
regexp | /foo/ |
foo |
Regular expressions aren't being optimized by the extension (see trac#2278). |
slow | exa |
example |
Extension only optimizes filters whose patterns contain a long enough static string. |
snippet_nodomain | #$#foo |
example.com#$#foo |
Snippet filters must be limited to at least one domain |
unexpected_filter_list_header | [ |
None | Filter list headers (e.g. [Adblock] ) are only allowed in downloadable filter lists. |
unknown_option | $foo |
$script , $subdocument , etc. |
The filter option foo doesn't exist. |
invalid_option | $domain |
$domain=example.com |
Invalid filter option. |
Hints for translators
Added description and changed text of current strings:
filter_elemhideemulation_nodomain
filter_invalid_csp
filter_invalid_domain
filter_invalid_regexp
filter_snippet_nodomain
filter_unknown_option
unexpected_filter_list_header
Added description to the current string:
filter_slow
Added string:
filter_invalid_option
Integration notes
None.