Commands
Commands are Playwright-like browser instructions sent from the worker to the client.
How commands work
Commands are relayed one at a time through the session:
- Worker sends
worker.command - Session actor relays as
server.commandto the client - Client executes the command in the webview
- Client sends
client.command_response - Session actor relays as
server.command_resultto the worker
Command types
Commands mirror Playwright’s browser automation API:
Navigation
- navigate — Navigate to a URL
- reload — Reload the current page
- goBack — Navigate back
- waitForNavigation — Wait for a navigation to a URL matching a pattern
DOM interaction
- click — Click an element by selector
- fill — Fill an input field
- select — Select a dropdown option
- waitForSelector — Wait for a DOM element to appear
DOM inspection
- getAttribute — Get an element attribute value
- textContent — Get an element’s text content
- innerHTML — Get an element’s inner HTML
- isVisible — Check if an element is visible
JavaScript
- evaluate — Execute JavaScript in the page context
Page state
- url — Get the current URL
- title — Get the page title
- content — Get the full page HTML
- screenshot — Capture a screenshot
Input
- press — Press a keyboard key
Waiting
- waitForNetworkIdle — Wait for network activity to settle
- waitForTimeout — Wait for a fixed duration
Status UI
- updateStatus — Update the overlay heading, subheading, or progress
One at a time
Only one command can be pending at a time. The worker must wait for the result before sending the next command.
Next steps
- Yield to User — Hand control to the user
- Protocol: Commands — Wire format details
Last updated on