From 439f20f77d928dacd0ce06e2778ca33af1808efb Mon Sep 17 00:00:00 2001 From: MasterKia Date: Wed, 5 Apr 2023 12:42:53 +0330 Subject: [PATCH] acs supports logging --- Resources-Library.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Resources-Library.md b/Resources-Library.md index 24b4665..269f6e0 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -140,6 +140,20 @@ Examples: - `tichyseinblick.de##+js(acis, Math, /\}\s*\(.*?\b(self|this|window)\b.*?\)/)` +Starting with [1.48.5b4](https://github.com/gorhill/uBlock/commit/edbe96a4010cff59a37c2aa2ec0fb89c48c913f9), you can use the logging abilites. + +To enable logging, use the JSON approach to pass parameters to `acs` scriptlet. Example: +```adb +example.com##+js(acs, { "target": "document.oncontextmenu", "log": true }) +``` + +Whereas "target", "needle", and "context" correspond to their respective positional argument. Using JSON form to pass parameters allows to specify extra paramters to facilitate debugging of that scriptlet: + +- `"log": true` => output useful information at the dev console. +- `"debug": true` => break at key locations in the scriptlet. + +The added logging/debugging capabilities work only in the **dev build** of uBO or if the advanced setting `filterAuthorMode` is set to `true`. + *** ### aopr.js /