ChromeXt
ChromeXt copied to clipboard
Design principles of `GM_cookie` API
Here is the current design of the GM_cookie API
- If
GM_cookieis granted, then by default, cookies stored by the browser application are added for same originGM_xmlhttpRequestrequests. - If the
cookieproperty ofdetailsis found in the requestGM_xmlhttpRequest(details), then it will be turned into an array ofSet-Cookieheaders to be passed to HttpCookie.parse.ChromeXtwill then call CookieStore.add, and finally send the resulted cookies. - If the
anonymousproperty ofdetailsis set totrue, then for current request no cookies will be sent byChromeXt, and response cookies are ignored. - With
GM_cookiegranted, 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. - Cookies during
GM_xmlhttpRequestare managed internally in each session of browser. They will be reset when the browser is restarted.