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

Design principles of GM_cookie API #115

Open
JingMatrix opened this issue Sep 20, 2023 · 0 comments
Open

Design principles of GM_cookie API #115

JingMatrix opened this issue Sep 20, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@JingMatrix
Copy link
Owner

JingMatrix commented Sep 20, 2023

Here is the current design of the GM_cookie API

  1. If GM_cookie is granted, then by default, cookies stored by the browser application are added for same origin GM_xmlhttpRequest requests.
  2. If the cookie property of details is found in the request GM_xmlhttpRequest(details),
    then it will be turned into an array of Set-Cookie headers to be passed to HttpCookie.parse. ChromeXt will then call CookieStore.add, and finally send the resulted cookies.
  3. If the anonymous property of details is set to true, then for current request no cookies will be sent by ChromeXt, and response cookies are ignored.
  4. With GM_cookie granted, the UserScript can and only can change the cookie store in the browser of current origin. No third party cookies can be saved into the browser by a UserScript. This design is due to the privacy protection of users.
  5. Cookies during GM_xmlhttpRequest are managed internally in each session of browser. They will be reset when the browser is restarted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant