Documentation
¶
Overview ¶
Package profile keeps a browser profile's auth state (cookies + per-origin localStorage) canonical on the local machine and checks it in and out of an otherwise-ephemeral remote browser seed over CDP.
A named profile is a cuttle seed. Its storage_state.json lives under $XDG_DATA_HOME/cuttle/profiles/<name>/. On session start the state is injected into the fresh remote seed; during and at the end of the session it is extracted back and written atomically, so a crash loses at most one checkpoint interval of cookie deltas. "Resides locally" is true at rest; a live session necessarily holds the cookies on the remote to act as the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Name string // profile name == seed
CDPBase string // e.g. http://127.0.0.1:9222
Remote bool // storage = "remote": durable remote dir, no checkout/checkin
Interval time.Duration // checkpoint interval; 0 uses the default
}
Options configures a profile session.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a live checkout of a local-canonical profile into a remote seed. For a remote-persistent profile it is an inert handle (the remote dir is durable, so there is nothing to check out or in).
func Checkout ¶
Checkout starts a session: for a local-canonical profile it takes the single-writer lock, injects the local storage_state into the fresh remote seed, and begins periodic checkpoints. For a remote-persistent profile it returns an inert session. The caller MUST Close the returned session (a deferred Close plus a signal-aware context covers Ctrl-C).