Documentation ¶
Overview ¶
Commands for interacting with the browser's cookie storage backend.
Index ¶
- type Commands
- func (self *Commands) Clear() error
- func (self *Commands) Delete(name string, args *DeleteArgs) error
- func (self *Commands) Get(name string) (*Cookie, error)
- func (self *Commands) List(args *ListArgs) ([]*Cookie, error)
- func (self *Commands) Map(args *ListArgs) (map[string]string, error)
- func (self *Commands) Set(cookie *Cookie) error
- type Cookie
- type DeleteArgs
- type ListArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commands ¶
type Commands struct { friendscript.Module // contains filtered or unexported fields }
func (*Commands) Delete ¶
func (self *Commands) Delete(name string, args *DeleteArgs) error
Deletes a cookie by name, and optionally matching additional criteria.
func (*Commands) List ¶
List all cookies, either for the given set of URLs or for the current tab (if omitted).
type Cookie ¶
type Cookie struct { // The name of the cookie. Name string `json:"name"` // The cookie's value. Value string `json:"value"` // The applicable domain for the cookie. Domain string `json:"domain"` // The cookie's path. Path string `json:"path"` // The size of the cookie. Size int `json:"size"` // The cookie's expiration date. Expires *time.Time `json:"expires"` // The cookie is flagged as being inaccessible to client-side scripts. HttpOnly bool `json:"http_only"` // The cookie is flagged as "secure" Secure bool `json:"secure"` // This is a session cookie. Session bool `json:"session"` // The same site value of the cookie ("Strict" or "Lax") SameSite string `json:"same_site"` // The URL the cookie should refer to (when setting) URL string `json:"url,omitempty"` }
type DeleteArgs ¶
type DeleteArgs struct { // Deletes all cookies with the given name where domain and path match the given URL. URL string `json:"url"` // If specified, deletes only cookies with this exact domain. Domain string `json:"domain"` // If specified, deletes only cookies with this exact path. Path string `json:"path"` }
type ListArgs ¶
type ListArgs struct { // an array of strings representing the URLs to retrieve cookies for. If omitted, the // URL of the current browser tab will be used Urls []string `json:"urls"` // A list of cookie names to include in the output. If non-empty, only these cookies will appear (if present). Names []string `json:"names"` }
Click to show internal directories.
Click to hide internal directories.