1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 15:33:38 +01:00

Updated descriptions: "remove-cache-storage-item" + "trusted-replace-argument" + "prevent-canvas"

garry-ut99 2024-07-11 16:57:45 +00:00
parent dd12c1c049
commit 06cef32588

@ -727,6 +727,26 @@ Also see:
New in [1.55.1b18](https://github.com/gorhill/uBlock/commit/34da372d7af0ca576b7063053d7966fdb04bdf9b)
Syntax:
- `[...]##+js(trusted-replace-argument, fn, argpos, argval [,condition, pattern])`
Parameters:
- required, `fn`: is the function we want to proxy through an `apply` handler.
This can also be a class, in which case the scriptlet will proxy
through `construct` handler. At the moment, `fn` must exist at the
time the scriptlet executes.
- required, `argpos`: is the 0-based position of the argument we want to change
- required, `argval`: is the value we want to have for the argument -- the value
is interpreted the same way the value for `set-constant` is
interpreted.
Tokens:
- `condition, pattern`: is a vararg which tells the scriptlet to act
only if `pattern` is found in the argument to overwrite.
Example of usage:
- `alliptvlinks.com##+js(trusted-replace-argument, MutationObserver, 0, noopFunc)`
[Documentation to be completed]
***
@ -949,7 +969,7 @@ The mutation observer of this scriptlet can be a significant overhead for pages
Parameters:
- required, the name of the node for which the text content must be substituted. Valid node names can be found at:
https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName
- required, A string or regex to find in the text content of the node as the target of substitution
- required, a string or regex to find in the text content of the node as the target of substitution
- optional, the replacement text. Can be omitted if the goal is to delete the text which
matches the pattern. Cannot be omitted if extra pairs of parameters have to be used (see below)
@ -1409,10 +1429,19 @@ Also see:
### remove-cache-storage-item.js [](https://github.com/gorhill/uBlock/blob/66e3a1ad47162a89709e99072e5eaecdd83cb633/assets/resources/scriptlets.js#L4076)
#### _Trusted scriptlet_
New in [1.55.1b23](https://github.com/gorhill/uBlock/commit/6c54731a728b06f89a66ddc851ebae3e19e45448)
Removes cache storage item.
Syntax: `...##+js(remove-cache-storage-item, cacheNamePattern[, urlPattern])`
Parameters:
- required, `cacheNamePattern`: the name of the cache to target. Plain string or _regex_.
- optional, `urlPattern`: the URL of the resource to remove. Plain string or _regex_.
If no pattern is provided, the whole cache is removed.
Reference: https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage
[Documentation to be completed]
***
@ -1470,6 +1499,23 @@ Also see:
New in [1.52.3b2](https://github.com/gorhill/uBlock/commit/1ff3878a4920e31791547238e3e879a32357914f)
Prevent usage of specific or all (default) canvas APIs.
Syntax:
- `example.com##+js(prevent-canvas [, contextType])`
Parameters:
- optional, `contextType`: A specific type of canvas API to prevent (default to all
APIs). Can be a string or regex which will be matched against the type
used in getContext() call. Prepend with `!` to test for no-match.
Examples:
- `example.com##+js(prevent-canvas)` - prevents `example.com` from accessing all canvas APIs
- `*##+js(prevent-canvas, /webgl/)` - prevents access to any flavor of WebGL API, everywhere
- `example.com##+js(prevent-canvas, !2d)` - prevents `example.com` from accessing any flavor of canvas API except `2d`
References: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
[Documentation to be completed]
***