From e4e8d0cb3556f727008e760bf2fcb6e7c003eb89 Mon Sep 17 00:00:00 2001 From: gwarser Date: Thu, 14 Nov 2019 22:17:00 +0100 Subject: [PATCH] Add json-prune --- Resources-Library.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Resources-Library.md b/Resources-Library.md index ca9a640..eb99b17 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -108,6 +108,22 @@ Parameters: - none +*** + +### json-prune.js [↪](https://github.com/gorhill/uBlock/blob/b97fea09d20d014923b2741a01fa3f3f5555e230/assets/resources/scriptlets.js#L239) + +New in [1.23.0](https://github.com/gorhill/uBlock/commit/2fd86a66fcc2665e5672cc5862e24b3782ee7504) + +Intercepts calls to `JSON.parse`, and if the result of the parsing is an Object, it will remove specified properties from the result before returning to the caller. + +Parameters: + - optional, string, a list of space-separated properties to remove + - optional, string, a list of space-separated properties which must be all present for the pruning to occur + +A property in a list of properties can be a chain of properties, example: `adpath.url.first`. + +When used without parameters, will log current hostname + json payload to the console. + *** ### noeval.js [↪](https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/src/web_accessible_resources/noeval.js)