mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 02:42:41 +01:00
Improve trusted-set-cookie
scriptlet
Replace placehoders instead of direct assignement Related feedback: https://github.com/uBlockOrigin/uAssets/pull/23877#issuecomment-2134417389
This commit is contained in:
parent
d8a77f38ce
commit
0e1e4b82c5
@ -4228,10 +4228,11 @@ function trustedSetCookie(
|
|||||||
const logPrefix = safe.makeLogPrefix('set-cookie', name, value, path);
|
const logPrefix = safe.makeLogPrefix('set-cookie', name, value, path);
|
||||||
const time = new Date();
|
const time = new Date();
|
||||||
|
|
||||||
if ( value === '$now$' ) {
|
if ( value.includes('$now$') ) {
|
||||||
value = Date.now();
|
value = value.replaceAll('$now$', time.getTime());
|
||||||
} else if ( value === '$currentDate$' ) {
|
}
|
||||||
value = time.toUTCString();
|
if ( value.includes('$currentDate$') ) {
|
||||||
|
value = value.replaceAll('$currentDate$', time.toUTCString());
|
||||||
}
|
}
|
||||||
|
|
||||||
let expires = '';
|
let expires = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user