Documentation Index
Fetch the complete documentation index at: https://mintlify.com/l-xiaoshen/handstage/llms.txt
Use this file to discover all available pages before exploring further.
V3 is the entry point to every Handstage session. You create an instance by calling one of the three static connect methods — connectLocal, connectTransport, or connectSession — and then interact with the browser through its context property or by calling create() to open an isolated context.
Static methods
V3.connectLocal
Launch or attach to a local Chrome browser over CDP.
Launch and session options. All fields are optional. See Configuration options reference for the full schema.
Promise<V3>
V3.connectTransport
Connect using a custom CDP transport object. Use this when you supply your own WebSocket implementation or proxy layer.
A CDP transport that implements
send and exposes CDP events. Handstage wraps it in a CdpConnection internally.Session and viewport options. See Configuration options reference.
Promise<V3>
V3.connectSession
Connect to an existing CDP session object — for example, a session handed off from another automation framework.
An existing CDP session that exposes
send, on, and off.Session and viewport options. See Configuration options reference.
Promise<V3>
Instance properties and methods
browser.context
Returns the default browser context for the session. This is the context that owns the initial pages opened at connect time.
V3Context
Throws if the instance has already been closed.
browser.create
Create a new isolated browser context — similar to an incognito profile. The new context shares the underlying CDP connection but has its own cookies, storage, and pages. disposeOnDetach defaults to true so Chrome auto-cleans the context if the connection drops.
Options for the new context. See V3Context — browser context API reference for
CreateContextOptions.Promise<V3Context>
browser.connectURL
Returns the browser-level CDP WebSocket URL for local connections. Returns an empty string when the instance was created via a custom transport or session.
string
browser.close
Shuts down the browser session. Closes the active context, and — for local connections where keepAlive is not set — kills the Chrome process and cleans up any temporary profile directories.
When
true, bypasses the internal guard that prevents concurrent close calls. Use only when you need to force-close an already-closing instance.Promise<void>
browser.verbose
Controls the minimum log level emitted by this instance. Assign a LogLevel value to change verbosity at runtime.
LogLevel
See Error types and error handling for the LogLevel enum values.
browser.logger
A function that receives every LogLine that passes the current verbose threshold. Assign a custom function to redirect logs to your own sink.
logger function in the options when calling a connect method.
Type (logLine: LogLine) => void