From d8083d99e6ac36e32f15a68fc49ecd98d7a1013f Mon Sep 17 00:00:00 2001 From: garry-ut99 <72945564+garry-ut99@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:26:37 +0000 Subject: [PATCH] Updated 'remove-cookie.js' description. --- Resources-Library.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Resources-Library.md b/Resources-Library.md index b249772..113f344 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -26,6 +26,7 @@ - [trusted-set-constant](#trusted-set-constantjs-) _(trusted-set)_ [Trusted] - [set-cookie](#set-cookiejs-) - [trusted-set-cookie](#trusted-set-cookiejs-) [Trusted] +- [remove-cookie](#remove-cookiejs-) _(cookie-remover)_ - [set-local-storage-item](#set-local-storage-itemjs-) / set-session-storage-item - [trusted-set-local-storage-item](#trusted-set-local-storage-itemjs-) / trusted-set-session-storage-item [Trusted] - [call-nothrow](#call-nothrowjs-) @@ -43,7 +44,6 @@ - [trusted-replace-node-text](#trusted-replace-node-textjs-) _(trusted-rpnt)_ [Trusted] - [spoof-css](#spoof-cssjs-) - [href-sanitizer](#href-sanitizerjs-) -- [cookie-remover](#cookie-removerjs-) - [disable-newtab-links](#disable-newtab-linksjs-) - [window-close-if](#window-close-ifjs-) - [no-window-open-if](#no-window-open-ifjs-) _(nowoif)_ @@ -310,6 +310,7 @@ The logging or debugging of `addEventListener()` calls can now be done with the *** +### remove-cookie.js / ### cookie-remover.js [↪](https://github.com/gorhill/uBlock/blob/a94df7f3b27080ae2dcb3b914ace39c0c294d2f6/assets/resources/scriptlets.js#L942) Removes current page cookies specified by name. For current domain, wildcard (dot) subdomain(s), after [1.28.0](https://github.com/gorhill/uBlock/commit/c4d39d37632fbee4d513116641a282ed2a48c89d) also for domain one level above `www`, current and `/` path, script accessible (HttpOnly=false), on load and before unload. @@ -318,9 +319,16 @@ Caveats: cookies set for higher level domain will not be removed. For example, i Parameters: - optional, string/_regular expression_, matching in the name of the cookie +Tokens: + - "when": when this parameter is present, it adds ability to trigger cookie removal on specific events (with delay 500ms): + - when "when" is not present: executes on page load and before unload + - `scroll`: executes when scrolling page (since [1.53.5rc3](https://github.com/gorhill/uBlock/commit/ef311ddbec9e50e032cfce062bd6c69aed5ae977)) + - `keydown`: executes when key pressed (since [1.53.5rc4](https://github.com/gorhill/uBlock/commit/3db46c1728a2a93fd103c258a7e73a60d84c95fd)) + Examples: - `subdivx.com##+js(cookie-remover, ref_cookie)` - + - `discovermagazine.com##+js(remove-cookie, AWSALBTG, when, scroll)` +(solves: ['remove-cookie' scriptlet sometimes does not work](https://github.com/uBlockOrigin/uBlock-issues/issues/3293)) ***