$RT holds a
browser-small runtime id (see Overview).
Endpoints
Enable and status
enable starts the display server and returns its status; calling it again
returns the running display’s status unchanged, so it is safe to call first in
every script. Enable the display before browser.open to get a headed
browser window. The sections below assume the display is enabled.
Screenshot and wait_stable
screenshot returns the frame as base64 PNG or JPEG — crop with region,
shrink with scale_pct, or pass wait_stable_ms to capture only after the
screen stops changing. wait_stable is the standalone version: block until
the screen has been pixel-quiet for stable_ms.
Screenshot returns
{data, format, width, height} with data base64.
wait_stable returns {settled, waited_ms} (waitedMs in TypeScript).
Mouse and keyboard
Raw input at screen coordinates.click takes an optional button
(left/middle/right); scroll sends dx/dy wheel deltas at the
current pointer position — move first to aim it. type sends a string,
press one key name, and hotkey a chord.
Live view
view publishes a private watch URL for the screen. Open browser_url —
it carries a one-time auth token that signs the browser in. The token is only
returned by the first view call for the runtime; later calls extend
expires_at but return browser_url without the token, so keep the first
one. URLs expire after an hour.
fps defaults to 15 and caps at 30; quality is JPEG quality 1–100. The call
returns 201 with the web-service record — browser_url, url, port,
expires_at, and token (first call only). See
Web Services for how
private URLs authenticate.
Disable
disable stops the display server; headed browser windows go with it.
enable starts it again.
Notes
- Display coordinates are absolute screen pixels.
regionuses the same space, so a point in a cropped screenshot maps back by adding the region’sxandy. wait_stablebeats a fixed sleep: it returns as soon as the screen stops moving instead of waiting out the worst case.- Prefer browser actions over display input for web work — refs survive layout shifts where coordinates do not. Reach for the display when the target is outside the DOM.