Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,24 @@ playwright-cli install-browser [browser] # install a browser
`install-browser` accepts `--with-deps`, `--dry-run`, `--list`, `--force`, `--only-shell` and
`--no-shell`; use `playwright-cli install-browser --help` for details.

#### Attach to a hosted Chromium browser over CDP

If a hosted Chromium browser provides a browser-level WebSocket CDP URL, use that URL in
`--cdp` and give the CLI session a name. For one example of a hosted endpoint, see the
[Cloudbrowser connection guide](https://cloudbrowser.tv/docs/connections).

```bash
# Set CDP_URL to the browser's WebSocket CDP endpoint before running these commands.
playwright-cli -s=remote attach --cdp="$CDP_URL"
playwright-cli -s=remote tab-list
playwright-cli -s=remote detach
```

Use `tab-list` to find the existing tabs. Detaching ends the CLI session. If the hosted
browser is still running and the endpoint is still valid, attaching again lets you
inspect the same tabs. Treat a URL containing credentials as a secret and keep it
out of logs and shared configuration files.

When attaching via the Playwright Extension, the session controls only the tabs selected by the
user and the tabs it opens. These tabs form a group named after the session. Use `--session-color`
to choose its color, or `--no-tab-group` to leave the tabs ungrouped:
Expand Down