---
title: "pols browser"
description: "Control a sandbox's Chrome over the Chrome DevTools Protocol"
---

<!-- Generated by scripts/reference.mjs from the pols CLI's --help. Do not edit; run `npm run reference:sync`. -->

Control a sandbox's Chrome over the Chrome DevTools Protocol

## Usage

```text
pols browser [flags]
pols browser [command]
```

## Subcommands

| Command | Description |
| --- | --- |
| [`pols browser cdp`](#pols-browser-cdp) | Print a short-lived WebSocket URL for Playwright or Puppeteer |

## Flags

```text
-h, --help   help for browser
```

## pols browser cdp

Print a WebSocket URL for the Chrome DevTools Protocol endpoint of the Chrome
on the sandbox's desktop (started on first connect). Connect within 5
minutes; the URL grants access to that sandbox's browser, so keep it secret.

### Usage

```text
pols browser cdp SANDBOX [flags]
```

### Examples

```sh
pols browser cdp web
# Playwright: await chromium.connectOverCDP(url)
# Puppeteer:  await puppeteer.connect({ browserWSEndpoint: url })
```

### Flags

```text
-h, --help   help for cdp
```

The [global flags](/reference/cli/#global-flags) work with this command too.
