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.
As discussed with filter list maintainers.
@scriptlet edit-inbound-object.js
@description
Prune properties from an object passed as argument to a specific method.
Properties can only be removed.
@param propChain
Property chain of the method to trap.
@param argPos
0-based position of the argument. Use negative integer for position relative
to the end.
@param jsonq
A uBO-flavored JSONPath query.
@scriptlet trusted-edit-inbound-object.js
@description
Edit properties of an object passed as argument to a specific method.
Properties can be assigned new values.
@param propChain
Property chain of the method to trap.
@param argPos
0-based position of the argument. Use negative integer for position relative
to the end.
@param jsonq
A uBO-flavored JSONPath query.
edit-outbound-object-.js
@description
Prune properties from an object returned by a specific method.
Properties can only be removed.
@param jsonq
A uBO-flavored JSONPath query.
trusted-edit-outbound-object.js
@description
Edit properties from an object returned by a specific method.
Properties can be assigned new values.
@param jsonq
A uBO-flavored JSONPath query.
json-edit-xhr-request.js
@description
Edit the object sent as the body in a XHR instance.
Properties can only be removed.
@param jsonq
A uBO-flavored JSONPath query.
@param [propsToMatch, value]
An optional vararg detailing the arguments to match when xhr.open() is
called.
trusted-json-edit-xhr-request.js
@description
Edit the object sent as the body in a XHR instance.
Properties can be assigned new values.
@param jsonq
A uBO-flavored JSONPath query.
@param [propsToMatch, value]
An optional vararg detailing the arguments to match when xhr.open() is
called.
json-edit-fetch-request.js
@description
Edit the request body sent through the fetch API.
Properties can only be removed.
@param jsonq
A uBO-flavored JSONPath query.
@param [propsToMatch, value]
An optional vararg detailing the arguments to match when fetch() is
called.
trusted-json-edit-fetch-request.js
@description
Edit the request body sent through the fetch API.
Properties can be assigned new values.
@param jsonq
A uBO-flavored JSONPath query.
@param [propsToMatch, value]
An optional vararg detailing the arguments to match when fetch() is
called.