From b022250019a249158de9426e192e66b1f959f8c0 Mon Sep 17 00:00:00 2001 From: peace2000 <17256841+peace2000@users.noreply.github.com> Date: Tue, 28 May 2024 18:48:28 +0300 Subject: [PATCH] Documented this https://github.com/gorhill/uBlock/commit/0e1e4b82c5 --- Resources-Library.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Resources-Library.md b/Resources-Library.md index 4fd5ef4..af6a77e 100644 --- a/Resources-Library.md +++ b/Resources-Library.md @@ -1024,7 +1024,7 @@ Parameters: - required, cookie value. Possible values: - arbitrary value - empty string for no value - - `$now$` keyword for setting current time in ms, e.g 1667915146503 + - `$now$` keyword for setting current time in ms, e.g 1667915146503. Can be used inside a string since [1.58.1b0](https://github.com/gorhill/uBlock/commit/0e1e4b82c5ea464f1e7837c5c8f400e5ffac4b3c) - `$currentDate$` keyword for setting current time as string, e.g 'Tue Nov 08 2022 13:53:19 GMT+0300' - optional, offset from current time in seconds, after which cookie should expire; defaults to no offset. Possible values: - positive integer in seconds @@ -1041,15 +1041,16 @@ Variadic parameters (must appears after required and optional parameters): Examples: - `example.com##+js(trusted-set-cookie, cmpconsent, 1-accept_1)` - `example.com##+js(trusted-set-cookie, cmpconsent, $now$)` + - `example.com##+js(trusted-set-cookie, cmpconsent, '{"accepted":true,"expire":$now$}')` - `example.com##+js(trusted-set-cookie, cmpconsent, accept, 259200)` - `example.com##+js(trusted-set-cookie, cmpconsent, accept, 1year)` - `example.com##+js(trusted-set-cookie, cmpconsent, decline, , none)` -The second filter sets a cookie with `new Date().getTime()` value. +The second and third filters will set a cookie with `new Date().getTime()` value. -The third and forth filters set a cookie which will expire in 3 days or 1 year. +The forth and fifth filters will set a cookie which will expire in 3 days or 1 year. -The fifth filter sets a cookie with no path. +The sixth filter sets a cookie with no path. Also see: [set-cookie](#set-cookiejs-)