From 5810a76f37860f41d0c5c953f39853f154eea7fc Mon Sep 17 00:00:00 2001 From: MasterKia Date: Fri, 24 Mar 2023 23:02:25 +0330 Subject: [PATCH] Add call-nothrow scriptlet --- Resources-Library.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Resources-Library.md b/Resources-Library.md index 8b8b29c..593d6c2 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -21,6 +21,7 @@ - [addEventListener-defuser](#addeventlistener-defuserjs-) _(aeld)_ - [addEventListener-logger](#addeventlistener-loggerjs-) _(aell)_ - [set-constant](#set-constantjs-) _(set)_ +- [call-nothrow](#call-nothrowjs-) - [no-setInterval-if](#no-setinterval-ifjs-) _(nosiif)_ - [no-setTimeout-if](#no-settimeout-ifjs-) _(nostif)_ - [nano-setInterval-booster](#nano-setinterval-boosterjs-) _(nano-sib)_ @@ -252,6 +253,22 @@ Parameters: *** +### call-nothrow.js [↪](https://github.com/gorhill/uBlock/blob/e93117cbb607472a830e1c0653dfbddde4c965fc/assets/resources/scriptlets.js#L1984) + +New in [1.48.1b0](https://github.com/gorhill/uBlock/commit/e93117cbb607472a830e1c0653dfbddde4c965fc). + +Prevents a call to an existing function from throwing an exception. + +The exception will be caught by the scriptlet and neutralized. The first argument must be a reference to a function call. At the moment, the function call must exist at the time the scriptlet is called. + +Parameters: + - required, _a reference to a function call_ + +Examples: + - `example.com##+js(call-nothrow, Object.defineProperty)` + +*** + ### disable-newtab-links.js [↪](https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/assets/resources/scriptlets.js#L869) Prevents creating new tabs/windows by deactivating links with `target` attribute.