-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
dontOverwrite
vararg to (trusted-)set-cookie
scriptlet
When the vararg `, dontOverwrite, 1` is present, the scriptlet will not modify the cookie if it already exists. Related discussion: uBlockOrigin/uAssets#19976 (comment)
- Loading branch information
Showing
1 changed file
with
10 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
607bba6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gorhill , so the usage will be like:
youtube.com##+js(trusted-set-cookie, SOCS, CAISNQgDEitib3FfaWRlbnRpdHlmcm9udGVuZHVpc2VydmVyXzIwMjMwODI5LjA3X3AxGgJlbiADGgYIgJnPpwY, , , reload, 1, dontOverwrite, 1)
or:
youtube.com##+js(trusted-set-cookie, SOCS, CAISNQgDEitib3FfaWRlbnRpdHlmcm9udGVuZHVpc2VydmVyXzIwMjMwODI5LjA3X3AxGgJlbiADGgYIgJnPpwY, , , , , dontOverwrite, 1)
?
607bba6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trusted-set-cookie
has 4 positional arguments (not counting the name of the scriptlet), so, dontOverwrite, 1
needs to come at 5th position at the earliest, so this should work:Varargs can be used in any order among themselves, as long as they start after the positional arguments. So
, reload, 1, dontOverwrite, 1
or, dontOverwrite, 1, reload, 1
accomplish the same thing.