Browser messages and input

Before WebSocket upgrade, the handler waits for and consumes an internal ready signal; clients are not guaranteed to receive it as the first event. frame sends text metadata followed by raw image binary. Non-frame events are forwarded as text. Keep frames paired with their images; do not treat an arbitrary next event as image data.

Client message

Key fields

Rules

ack

type、seq

seq is the positive sequence number of a processed frame.

release

type

Sends a release signal. Disconnection alone does not establish task resumption or browser termination.

input_mouse

eventType, x/y, button, and others

mousePressed/mouseReleased/mouseMoved/mouseWheel only.

input_keyboard

eventType, key/code/text, and others

keyDown/keyUp/char only.

Shared keyboard/mouse fields also include clickCount, deltaX/deltaY, modifiers, and windowsVirtualKeyCode. Inputs follow server types. Text is limited to 4096 bytes, key/code to 64 bytes, modifiers to 0–15, and virtual key codes to 0–255. Mouse button is empty or left/right/middle; clickCount is 0–3. Coordinates are nonnegative; numbers must be finite with absolute values ≤100000.

Incoming messages must be text frames of at most 16384 bytes, including after decompression. The sandbox input decoder rejects unknown structural fields and trailing JSON. This is not an arbitrary JavaScript/CDP/navigation API. Output scanner lines are limited to 4MiB, separate from client input limits.

Current handler connections last at most 10 minutes, with 15-second pings, a 45-second read timeout, and current-access rebinding/browser verification about every 30 seconds. Deadlines/network failures are not business cancellation. Compression negotiates lossless transport and preserves decoded image bytes; no fixed frame rate or compression ratio is promised.

Closing a viewing connection does not end the original browser. Token acquisition and status checks neither create replacement sandboxes nor start browsers. Browser not running returns 409/BROWSER_NOT_RUNNING; original environment ended returns 410/BROWSER_SESSION_ENDED. Recovery requires the original task and real environment state.

Last updated on