As discussed with filter list maintainers.
* @scriptlet trusted-create-element
*
* @description
* Element(s) from a parsed HTML string are added as child element(s) to a
* specific parent element in the DOM.
*
* @param parent
* A CSS selector identifying the element to which created element(s) will be
* added.
*
* @param html
* An HTML string to be parsed using DOMParser, and which resulting elements
* are to be added as child element(s).
*
* @param duration
* Optional. If specified, the time in ms after which the added elements will
* be removed. No removal will occur if not specified.
In Firefox, scriptlets are dynamically registered as content scripts
to ensure they execute in a timely manner.
The race condition could lead to scriptlet injection failing at
browser launch time in Firefox when the setting "Suspend network
activity until all filter lists are loaded" had been disabled[1],
even after forcing a page reload. Causing the filter lists to
reload would make the issue go away.
[1] Default is enabled in Firefox and it is strongly advised to NOT
change this.
Support for paths allows to narrow down specific static extended
filters to specific webpages on a given site.
Examples of usage:
example.com/toto##h1
/example\.com\/toto\d+/#@#h1
Scriptlets added:
- json-edit
- trusted-json-edit
- json-edit-xhr-response
- trusted-json-edit-xhr-response
- json-edit-fetch-response
- trusted-json-edit-fetch-response
- jsonl-edit-xhr-response
- trusted-jsonl-edit-xhr-response
- jsonl-edit-fetch-response
- trusted-jsonl-edit-fetch-response
These scriptlets are functionally similar to their `json-prune` counterpart,
except that they all use the new uBO-flavored JSONPath syntax, and the
`trusted-` versions allow to modify values instead of just removing them.
The `replace=` filter option has been extended to support applying
uBO-flavored JSONPath syntax to the response body. If the `replace=`
value starts with `json:` or `jsonl:`, the remaining of the value will
be interpreted as a JSONPath directive, which can be used to either
remove or modify property in a JSON document.
@description
Conditionally prevent assignment to `innerHTML` property.
@param [selector]
Optional. The element must matches `selector` for the prevention to take
place.
@param [pattern]
Optional. A pattern to match against the assigned value. The pattern can be
a plain string, or a regex. Prepend with `!` to reverse the match condition.
As discussed with filter list volunteers.
`generichide` option is implicitly enforced on all sites unless an
exception overrides `generichide`. Though rare, sometimes a
`generichide` exception needs to be overridden so that generic
cosmetic filtering is made possible on a specific site.
This commit is to add support for restoring generic cosmetic
filtering on sites which were excluded through a `generichide`
exception.
Concretely, this is needed to ensure the test suite can properly
verify that generic cosmetic filtering is working when the
filtering mode is set to "complete":
||ublockorigin.github.io^$generichide,important
Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3576
This is the first step, a trivial code change which disable the
injection of `Cache-Control` header in Firefox.
In the next dev cycle, the second step will be to remove all
the code related to `Cache-Control` injection.