Documentation
¶
Overview ¶
Package provider defines the interface for connecting to a Chrome instance. The default Local provider wraps the existing launcher. Future cloud providers (Browserless, Browserbase) implement the same interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectOpts ¶
ConnectOpts carries the parameters any provider needs to set up a connection.
type Local ¶
type Local struct{}
Local provisions Chrome by launching a local process via Rod's launcher.
type Provider ¶
type Provider interface {
// Name returns a human-readable identifier (e.g. "local", "browserless").
Name() string
// Connect provisions a Chrome instance and returns the DevTools WS URL.
// The cleanup function MUST be called when the browser is no longer needed.
Connect(ctx context.Context, opts ConnectOpts) (wsURL string, cleanup func(), err error)
}
Provider abstracts Chrome acquisition. A provider returns a WebSocket URL the caller can pass to rod.New().ControlURL(), plus a cleanup function that releases whatever the provider allocated (kill process, release slot, …).
Click to show internal directories.
Click to hide internal directories.