mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Updated Resources Library (markdown)
parent
6fa520865f
commit
c47863898d
1 changed files with 18 additions and 1 deletions
|
|
@ -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?)`
|
||||
|
|
|
|||
Loading…
Reference in a new issue