mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-12 18:04:16 +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
1 changed files with 5 additions and 4 deletions
|
@ -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 a new issue