Updated Resources Library (markdown)

D4niloMR 2025-06-15 19:29:28 -03:00 committed by Raymond Hill
parent 6fa520865f
commit c47863898d
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

@ -786,7 +786,24 @@ New in [1.51.1rc3](https://github.com/gorhill/uBlock/commit/3152896d428c54c76cfd
Replaces response text content of `xhr` requests if all given parameters match.
For usage, see: [trusted-replace-fetch-response](#trusted-replace-fetch-responsejs-)
Parameters:
- required, argument for matching contents of `responseText` that should be replaced. Possible values:
If set, `replacement` is required. Possible values:
- `*`: match all text content
- non-empty string
- regular expression
- optional, should be set if first parameter is set. String to replace the response text content matched by pattern. Empty string to remove content. Defaults to empty string.
- optional, string of space-separated properties to match; possible props:
- string or regular expression for matching the URL passed to `XMLHttpRequest.open()` call; empty string, wildcard `*` will match all fetch calls
- colon-separated pairs `name:value` where:
- `name` — string or regular expression for matching XMLHttpRequest property name
- `value` — string or regular expression for matching the value of the option passed to `XMLHttpRequest.open()` call
Tokens:
- `includes, pattern`: replace only if `pattern` match in the text response. Can be a plain string or a regex. <sup>[1.58.1b6](https://github.com/gorhill/uBlock/commit/9072772f6134d80b4cfa4b90a10c624810a781fc)</sup>
Scriptlet does nothing if response body can't be converted to text.
Example:
- `in-jpn.com##+js(trusted-replace-xhr-response, /.*/, , pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?)`