Related discussion/issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2917
- https://github.com/uBlockOrigin/uAssets/discussions/30124
The "list of selectors" parameter is now a "list of steps". A step
can be:
- A selector, which tells the scriptlet to click a matching element. If
no matching element is found, the scriptlet will wait for a matching
element to become available.
- An integer, which tells the scriptlet to wait n ms before processing
the next step
- A directive, which is a string starting with `!` (not implemented yet)
If the last item in the list is an integer, this tells the scriplet to
override the built-in timeout value of 10s, such that the life time of
the scriptlet can now be extended beyond 10s.
Example:
..##+js(trusted-click-element, '1000, a, 500, b, c, 15000')
The scriptlet filter above will perform the following steps, in order:
- Prepare the scriptlet to timeout at 15s from now
- Wait 1000 ms
- Wait for element `a` to become available then click on it
- Wait 500 ms
- Wait for element `b` to become available then click on it
- Wait for element `c` to become available then click on it
- Abort if all the steps cannot be completed before 15s
The changes keep compatiblity with older syntax or with AdGuard
syntax.
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3799
An infinite loop in the network filter parser was triggered when
the following conditions were fulfilled:
- There was a network option `$` anchor
- There were only whitespace character(s) preceding the anchor
- There was an invalid filter option following the anchor
Add vararg `throttle, n` where `n` is the time to wait in ms before
returning a response from proxied `fetch()`.
As discussed with filter list maintainers.
The `uritransform=` option will now be converted to a proper DNR
rule when the following condition are fulfilled:
- The value of the `uritransform` option matches `//[replacement]/`,
i.e. the pattern to match is empty, and only the replacement part is
provided.
- The filter pattern is a regex.
Is such case, the DNR rule will be a `redirect` making use of the
`regexSubstitution` property.
In case the above conditions are not fulfilled, the filter will
be discarded as incompatible with DNR syntax (as was the case
before).
This is potentially a breaking change, in cases where a filter
assumed that the part to match was the start of the path part of
a URL.
A reminder that `uritransform` is an option which requires a
trusted source, otherwise it is rejected.
As discussed with filter list maintainers.
Examples of usage:
$ => result is `null`
$+={"modifyOrCreate": "..."}
These expressions were not working with previous version.
As discussed with filter list maintainers.
Examples of JSON path expression to replace a pattern within a string
value:
..book.*.author=repl({"pattern": "Melville", "replacement": "Toto"})
..book.*.author=repl({"regex": "e", "replacement": "o"})
..book.*.author=repl({"regex": "e", "flags": "g", "replacement": "o"})
If the target value is not a string, no modification will occur.
Related issue:
https://github.com/uBlockOrigin/uBOL-home/issues/325
This is a first version, with support only for custom filters which are
plain CSS selectors. Future versions will extend support to style-based
and procedural cosmetic filters.
Manually text-editing existing custom filters is currently not supported,
this will be added in a future version in the Develop pane. To remove
existing custom filters, the "Remove a custom filter" tool can be used.