Connection order

  1. Read the live setup reference; check identity and current pricing.
  2. Create one time-limited run with a stable idempotency key and wait for ready.
  3. Request control for that run. The short-lived, single-connection address is sensitive.
  4. Connect to the default browser context and reuse an existing page; create any extra page inside that context.
  5. Retrieve downloads before explicitly ending the run your Agent created.
Connection fragment · cdp_url comes from the current run's control response
import { chromium } from 'playwright';

const browser = await chromium.connectOverCDP(cdp_url);
const context = browser.contexts()[0];
const page = context.pages()[0] ?? await context.newPage();
await page.goto('https://docs.python.org/3/whatsnew/3.13.html');
const title = await page.title();
console.log(title);
await browser.close(); // disconnects only; end the run separately

Reconnect after a drop

If the connection expires or drops while the original run is still ready, request a new control address for that run. Find and inspect the original page. Do not reuse the old address, create an unnecessary second run, or replay a write action with an unknown outcome.

See the OpenAPI contract for fields and errors. Patchright users should follow its version-specific guide.