uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
935 stars 79 forks source link

AdGuard aliases for set-cookie-reload and trusted-set-cookie-reload are wrong #2881

Closed superlex closed 11 months ago

superlex commented 1 year ago

Prerequisites

I tried to reproduce the issue when...

Description

Correct AdGuard syntax to set a cookie and reload: example.org#%#//scriptlet('set-cookie-reload', 'cookie-set1', '1') See https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#set-cookie-reload

Correct uBlock0 syntax to set a cookie and reload: example.org##+js(set-cookie, cookie-set3, 3, , reload, 1) See https://github.com/gorhill/uBlock/wiki/Resources-Library#set-cookiejs-

The same thing applies to trusted-set-cookie https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-trusted-scriptlets.md#trusted-set-cookie-reload https://github.com/gorhill/uBlock/wiki/Resources-Library#trusted-set-cookiejs-

So,

A specific URL where the issue occurs.

example.org

Steps to Reproduce

Add these filters to User Filters List:

example.org#%#//scriptlet('set-cookie-reload', 'cookie-set1', '1')
example.org#%#//scriptlet('set-cookie', 'cookie-set2', '2', '', 'reload', '1')
example.org##+js(set-cookie, cookie-set3, 3, , reload, 1)
!
example.org#%#//scriptlet('trusted-set-cookie-reload', 'cookie-tset1', 'tset1')
example.org#%#//scriptlet('trusted-set-cookie', 'cookie-tset2', 'tset2', '', '', 'reload', '1')
example.org##+js(trusted-set-cookie, cookie-tset3, tset3, , , reload, 1)

Expected behavior

example.org#%#//scriptlet('set-cookie-reload', 'cookie-set1', '1')
example.org##+js(set-cookie, cookie-set3, 3, , reload, 1)
example.org#%#//scriptlet('trusted-set-cookie-reload', 'cookie-tset1', 'tset1')
example.org##+js(trusted-set-cookie, cookie-tset3, tset3, , , reload, 1)

are recognized as correct and applied.

Actual behavior

example.org#%#//scriptlet('set-cookie', 'cookie-set2', '2', '', 'reload', '1')
example.org##+js(set-cookie, cookie-set3, 3, , reload, 1)
example.org#%#//scriptlet('trusted-set-cookie', 'cookie-tset2', 'tset2', '', '', 'reload', '1')
example.org##+js(trusted-set-cookie, cookie-tset3, tset3, , , reload, 1)

are recognized as correct and applied.

uBO version

1.52.2

Browser name and version

Firefox 118

Operating System and version

macOS 11

Screenshot

cookie-reload
gwarser commented 11 months ago

image

Yuki2718 commented 4 months ago

Has something changed about position of the reload token? For https://github.com/AdguardTeam/AdguardFilters/issues/180011 portal.payment.eltax.lta.go.jp##+js(set-cookie, xn_cookieconsent, false, , , reload, 1) never works but portal.payment.eltax.lta.go.jp##+js(set-cookie, xn_cookieconsent, false, , reload, 1) does.

stephenhawk8054 commented 4 months ago

set-cookie has 3 arguments (expire time is fixed as session only) => false, , reload, 1 so false, , , reload, 1 won't work

If you use trusted-set-cookie, it has 4 arguments (custom expire time) => false, , , reload, 1