From 0a2fc989a1dce33079b49a00baea784b6fdc27b4 Mon Sep 17 00:00:00 2001 From: D4niloMR <70459964+D4niloMR@users.noreply.github.com> Date: Sat, 29 Mar 2025 15:41:56 -0300 Subject: [PATCH] Updated Resources Library (markdown) --- Resources-Library.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/Resources-Library.md b/Resources-Library.md index 510723e..e267add 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -37,6 +37,7 @@ - [prevent-setTimeout](#prevent-setTimeoutjs-) _(no-setTimeout-if / nostif / setTimeout-defuser)_ - [adjust-setInterval](#adjust-setIntervaljs-) _(nano-setInterval-booster / nano-sib)_ - [adjust-setTimeout](#adjust-setTimeoutjs-) _(nano-setTimeout-booster / nano-stb)_ +- [prevent-innerHTML](#prevent-innerHTMLjs-) - [prevent-xhr](#prevent-xhrjs-) _(no-xhr-if)_ - [trusted-prevent-xhr](#trusted-prevent-xhrjs-) [Trusted] - [prevent-fetch](#prevent-fetchjs-) _(no-fetch-if)_ @@ -235,12 +236,7 @@ Parameters: - required, _property_ (chain of properties joined by `.`) to trap in order to launch the stack trace matching code, ex. `Math.random` - optional, string/_regular expression_, the needle to match against the stack trace. If the empty string, only log. Prepend pattern with `!` to test for unmatched patterns in stack trace (New in [1.51.1b6](https://github.com/gorhill/uBlock/commit/84cc69aa10bc9c8045ed94b528ddc158c06ae7ab)) - -Tokens: - - "log": - - `all`: log stack trace for all access to trapped property - - `match`: log stack trace for defused access to trapped property - - `nomatch`: log stack trace for non-defused access to trapped property +The scriptlet logs when there is a match. If verbose mode is enabled, it will log both matches/no matches. Stack trace is normalized, but there still can be differences (Chromium vs Firefox) because of different format of stack trace. @@ -713,6 +709,8 @@ Prevent web pages from using _`eval()`_ on specific matching payloads. Parameters: - optional, string/_regular expression_, matching in payload string. +When used without parameters, will log calls to `eval()` to the logger. + Examples: - `orgyxxxhub.com##+js(noeval-if, replace)` @@ -979,6 +977,26 @@ Also see: *** +### prevent-innerHTML.js [↪](https://github.com/gorhill/uBlock/blob/935ce74d3a7b300be12a952f2e7dfa9f0f595db9/src/js/resources/prevent-innerHTML.js#L42) + +New in [1.63.1b0](https://github.com/gorhill/uBlock/commit/fe744816f1df077fae764e15e5bb5bd0f1c1edc1). + +Conditionally prevent assignment to `innerHTML` property. + +Parameters: + + - Optional, `selector`: The element must matches `selector` for the prevention to take place. + - Optional, `pattern`: 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. + +When verbose mode is enabled, the scriptlet will log the assigned value of the element. + +Example: +```adblock +example.com##+js(prevent-innerHTML, body, adblock) +``` + +*** + ### prevent-xhr.js [↪](https://github.com/gorhill/uBlock/blob/745fbd1c02b7179052ba97f51c54f7cb000636f0/assets/resources/scriptlets.js#L1171) ### no-xhr-if.js @@ -1607,7 +1625,10 @@ Parameters: - `true` / `t`3 / `false` / `f`3, - `yes` / `y` / `no` / `n`, - `all`10 / `none`10 / `functional`10, - - `granted`11 / `done`11 + - `granted`11 / `done`11, + - `decline`12 / `declined`12, + - `closed`13 / `next`13 / `mandatory`13, + - `disagree`13 / `agree`13 - optional, cookie path, defaults to /; possible values: - `/`: root path - `none`: to set no path at all @@ -1623,6 +1644,8 @@ Parameters: 9. [1.60.1b12](https://github.com/gorhill/uBlock/commit/4d982d9972be4eb0a23e289c6f3ec3ae8cca36f2) 10. [1.61.3b10](https://github.com/gorhill/uBlock/commit/791a2b08e1a15c169c0a86130de769822628c81d) 11. [1.62](https://github.com/gorhill/uBlock/commit/62178de75682a9e7e8fc7d1bedda2c7f476b5b66) +12. [1.62.1b1](https://github.com/gorhill/uBlock/commit/4b12247da106249a4d1e1143fd1c30d97656de73) +13. [1.62.1b2](https://github.com/gorhill/uBlock/commit/35a47d674b47b14fed18691ce5ede6a7adddb4a1) The scriptlet encodes cookie names and values, e.g value "{ test: 'value'}" becomes `%7B%20test%3A%20'value'%7D`.