Skip to Content

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:

  1. Worker sends worker.command
  2. Session actor relays as server.command to the client
  3. Client executes the command in the webview
  4. Client sends client.command_response
  5. Session actor relays as server.command_result to 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

Last updated on