From eb2ebb99773b51795d5d88c12d1307ddf6309f38 Mon Sep 17 00:00:00 2001 From: garry-ut99 <72945564+garry-ut99@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:45:52 +0000 Subject: [PATCH] Updated "trusted-replace-outbound-text" scriptlet. --- Resources-Library.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Resources-Library.md b/Resources-Library.md index f1b3c4b..48f97cb 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -1071,6 +1071,15 @@ matches `ed5ce21c7d7c95c8662c7844c0f4a4dc` or any similiar value in `"csrf_token - `www.reddit.com##+js(trusted-replace-outbound-text, JSON.stringify, '/(?<="adblock":{"enabled":)true/', false)` matches `true` in `"adblock":{"enabled":true` and replaces it with `false` resulting in a new spoofed value: `"adblock":{"enabled":false` +When the replacement starts with `json:`, it will be first decoded using JSON.parse() (since [1.59.1b8](https://github.com/gorhill/uBlock/commit/0dcb985601)), example: + +- `example.com##+js(trusted-replace-outbound-text, somefn, json:"ok")` + +The doublequotes are required since this is what JSON.parse() +expects as a valid JSON string. + +
+ Solves related issues / discussions: - [Add a scriptlet to intercept atob call and prune its text output](https://github.com/uBlockOrigin/uBlock-issues/issues/3157) - [Add new scriptlet — 'trusted-replace-outbound-text'](https://github.com/AdguardTeam/Scriptlets/issues/410)