Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address https://github.com/easylist/easylist/issues/19226 #23877

Merged
merged 3 commits into from
May 30, 2024
Merged

address https://github.com/easylist/easylist/issues/19226 #23877

merged 3 commits into from
May 30, 2024

Conversation

dportvine
Copy link
Contributor

No description provided.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented May 28, 2024

@gorhill This site needs epoch time (1716874494) in the cookie value. I wonder if it's possible to have $now$ for trusted-set-cookie ?

@gorhill
Copy link
Member

gorhill commented May 28, 2024

I wonder if it's possible to have $now$ for trusted-set-cookie ?

It's already supported: https://github.com/gorhill/uBlock/blob/1.58.0/assets/resources/scriptlets.js#L4231

@stephenhawk8054
Copy link
Member

Hmm... Weird, when I use

abw.by##+js(trusted-set-cookie, cookiePolicy, %7B%22accepted%22%3Atrue%2C%22technical%22%3Atrue%2C%22statistics%22%3Afalse%2C%22marketing%22%3Afalse%2C%22expire%22%3A$now$%7D)

The cookie value still has $now$ instead of the date

image

Or should I use unescape version?

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented May 28, 2024

Oh wait, it's because trustedSetCookie is using value = Date.now(); instead of value = value.replaceAll('$now$', Date.now()); like in local storage.

Yeah sorry I meant using it inside a string.

gorhill added a commit to gorhill/uBlock that referenced this pull request May 28, 2024
Replace placehoders instead of direct assignement

Related feedback:
uBlockOrigin/uAssets#23877 (comment)
@gorhill
Copy link
Member

gorhill commented May 28, 2024

I meant using it inside a string

gorhill/uBlock@0e1e4b82c5

By the way, you don't need to pre-encode the JSON data, this also works:

abw.by##+js(trusted-set-cookie, cookiePolicy, '{"accepted":true,"technical":true,"statistics":false,"marketing":false,"expire":$now$}')

--

Edit: added quotes

@stephenhawk8054 stephenhawk8054 merged commit 92ca6cd into uBlockOrigin:master May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants