From c47863898d82037a0bbbbe896b92e64ff42a2b3c Mon Sep 17 00:00:00 2001 From: D4niloMR <70459964+D4niloMR@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:29:28 -0300 Subject: [PATCH] Updated Resources Library (markdown) --- Resources-Library.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Resources-Library.md b/Resources-Library.md index e267add..a75c576 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -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. [1.58.1b6](https://github.com/gorhill/uBlock/commit/9072772f6134d80b4cfa4b90a10c624810a781fc) + +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?)`