Adblock Plus accepts this filter and considers it
a blocking filter. This is since there's a "/" character after the "$"
and so the text after "$" is not considered to be filter options.
For example try filter "/$fileanalytics", I don't think it'll work since
"fileanalytics" isn't a valid filter option.
The relevant code is the Filter.optionsRegExp regular expression[1] in
adblockpluscore/lib/filterClasses.js:
Code: Select all
/**
* Regular expression that options on a RegExp filter should match
* @type {RegExp}
*/
Filter.optionsRegExp = /\$(~?[\w-]+(?:=[^,\s]+)?(?:,~?[\w-]+(?:=[^,\s]+)?)*)$/;
filter options have to follow these rules:
- optionally start with a single "~"
- contain only a-z, A-Z, 0-9, "_" and "-"
- can optionally end with a single "=" followed by one or more
characters which aren't "," or whitespace
- separated by a single ","
Also the options string must start with "$" and end with the end of the
filter.
I don't see a way to escape the "$" character, so I don't think it's
possible to write a filter which ignores the options string should it
happen to follow the above rules. Instead you'd have to add an extra
character such as "/" like your example filter does