VscodeAdblockSyntax icon indicating copy to clipboard operation
VscodeAdblockSyntax copied to clipboard

Add support for unescaped commas within strings in uBO scriptlet injections

Open scripthunter7 opened this issue 1 year ago • 2 comments

uBO has started to support using quotes in values https://github.com/uBlockOrigin/uAssets/blob/562d4c6043f38ec3786dc34119d26e711140d6cf/filters/annoyances-cookies.txt#L124 I see that the quoted value still has commas colored in red.

Originally posted by @peace2000 in https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/95#issuecomment-1842587463

scripthunter7 avatar Dec 06 '23 11:12 scripthunter7

See

  • https://github.com/uBlockOrigin/uAssets/commit/67c390448a451caec1c1b744082616ed7bca4dc9
  • https://github.com/gorhill/uBlock/commit/027c7a4fb5b74207b7dedcbc83f4c70527ea5566

scripthunter7 avatar Dec 06 '23 11:12 scripthunter7

Thanks for opening this.

We typically quote parameters only if it's necessary, but all the variations should be highlighted properly, whether quoted or not. (Also the scriplet name can be quoted nowadays, but uBO doesn't have a scriptlet name that contains a comma :) )

example.com##+js(trusted-set-cookie, ConsentChecked, '{"userHasSetCookies":true,"marketingCookies":false}')

example.com##+js(trusted-set-cookie, 'Consent,Checked', '{"userHasSetCookies":true,"marketingCookies":false}')

example.com##+js(trusted-set-cookie, 'Consent,Checked', true)

example.com##+js('trusted-set-cookie', 'Consent,Checked', true)

example.com##+js('trusted-set-cookie', ConsentChecked, true)

All those should be highlighted correctly.

peace2000 avatar Dec 06 '23 12:12 peace2000