# Cloudflare Browser Run: headless Chrome for AI agents and web apps

> What Cloudflare Browser Run is, the problem it solves, and how to use Quick Actions, Puppeteer sessions, CDP and MCP for AI agents and web apps.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2026-11-20 | Topics: [Cloudflare](https://flaviocopes.com/tags/cloudflare/) | Canonical: https://flaviocopes.com/cloudflare-browser-run/

[Browser Run](https://developers.cloudflare.com/browser-run/) is Cloudflare's hosted headless Chrome. You ask for a browser, it starts on Cloudflare's network, does what you tell it, and shuts down when you're done.

It used to be called **Browser Rendering**. You'll still see the old name in some places, like the API token permission and the crawler's user agent, but the product, the docs and the API path are now Browser Run.

I've used it in passing before, in the [scraping tool post](https://flaviocopes.com/scraping-tool/) and in the [Kitesurf post](https://flaviocopes.com/kitesurf-agentic-browser/). This post is the full picture: what it solves, every way to call it, and what I'd use it for with AI agents and with regular web apps. Everything in the Worker sections below I ran against my own account on November 20, 2026, and the outputs are the real ones.

## What problem does Browser Run solve?

A lot of things on the web only work in a real browser. A page that renders with JavaScript returns an empty `<div id="root">` to `fetch()`. A screenshot needs a rendering engine. A PDF that looks like your web page needs Chrome's print pipeline. An AI agent that has to click through a checkout, fill a form or read a dashboard needs a browser it can drive.

Running Chrome yourself is where it gets painful:

- Chrome is big. It doesn't fit in a Worker, and it barely fits in a Lambda function.
- It eats memory, and a page that leaks or crashes takes your process with it.
- You need servers, a pool, a queue in front of the pool, and something that kills zombie processes at 3 AM.
- Scaling from 1 browser to 50 at the same time means more servers, which sit idle the rest of the day.

Browser Run moves all of that to Cloudflare. You pay for the seconds a browser is open, and you get the browser from code that runs on [Workers](https://flaviocopes.com/cloudflare-workers/), from any server through the REST API, or from your laptop through the Chrome DevTools Protocol.

For AI agents there's a second problem it solves. An agent running on your Mac can drive your own Chrome, like I showed in [the best macOS browsers for AI agents](https://flaviocopes.com/macos-browser-ai-agents/). An agent running on a server, in a scheduled job or inside your product has no Chrome to drive. Browser Run gives it one, with a URL and a token.

## Two ways to use it

Browser Run has two families of features, and picking the right one saves you time and money.

| | Quick Actions | Browser Sessions |
| --- | --- | --- |
| What it is | One request, one result | A browser you control step by step |
| Code to deploy | None (REST) or one line (Worker) | A Worker, or a client using CDP |
| Good for | Screenshots, PDFs, Markdown, links, scraping, AI extraction, crawling | Logins, clicks, forms, multi-page flows, AI agents |
| Libraries | None | Puppeteer, Playwright, Stagehand, raw CDP, MCP |
| Billed on | Browser time | Browser time and concurrent browsers |

The Quick Actions are `content`, `screenshot`, `pdf`, `markdown`, `snapshot`, `scrape`, `json`, `links`, `accessibilityTree` and `crawl`. They're all the same shape: you send a `url` (or raw `html`) and some options, and you get the result back.

My advice is to start with a Quick Action and switch to a session only when you need to interact with the page.

## Set up a Worker with the browser binding

Inside a Worker you skip the API token and add a `browser` binding to `wrangler.jsonc`:

```json
{
  "name": "browser-run-demo",
  "main": "src/index.js",
  "compatibility_date": "2026-11-01",
  "browser": { "binding": "BROWSER", "remote": true }
}
```

`remote: true` matters during development. Without it, `wrangler dev` runs Quick Actions against a local Chrome, and the `json` action returns placeholder data shaped like your schema instead of calling a model. With it, `wrangler dev` uses the real Browser Run on your account, which is what I did for every example here.

The `quickAction()` method needs a compatibility date of 2026-03-24 or later.

## Quick Actions from a Worker

### Turn a page into Markdown

This is the one I'd reach for most with AI agents. Markdown is what you want to put in a model's context: no scripts, no CSS, no markup noise.

`quickAction()` returns a regular `Response`, so you call `.json()` on it:

```js
export default {
  async fetch(request, env) {
    const res = await env.BROWSER.quickAction('markdown', {
      url: 'https://flaviocopes.com/cloudflare-hyperdrive/'
    })
    const { result } = await res.json()
    return new Response(result)
  }
}
```

Here's the start of what came back for my Hyperdrive post:

```md
---
title: "Cloudflare Hyperdrive tutorial: use PostgreSQL with Workers"
meta:
  description: "Learn Cloudflare Hyperdrive with PostgreSQL and Workers, configure pooling and caching, and see how it fits with D1, R2, Queues, Supabase, and Neon."
  "og:title": "Cloudflare Hyperdrive tutorial: use PostgreSQL with Workers"
---

[AI Workshop: $99 instead of $299 · opens November 23 →](https://flaviocopes.com/black-friday/#ai-workshop)Black Friday: save $200 on AI Workshop...
```

Notice that the page metadata ends up in a frontmatter block, which is handy. Notice also that the banner and the sponsor links come along, because Browser Run converts the whole page. If you only want the article, combine it with `rejectRequestPattern`, or use the `scrape` or `json` actions below.

The response had a header worth knowing about:

```txt
x-browser-ms-used: 588.5361328125
```

That's how many milliseconds of browser time the request cost. Every Quick Action response has it, so you can log it and know exactly what each call costs you.

### Take a screenshot

The `screenshot` action returns the PNG directly, so the Worker can return the response as it is:

```js
export default {
  async fetch(request, env) {
    return env.BROWSER.quickAction('screenshot', {
      url: 'https://flaviocopes.com/',
      viewport: { width: 1280, height: 800 }
    })
  }
}
```

The request took 1.8 seconds end to end, and 531 ms of browser time. This is the image it returned:

![The flaviocopes.com home page, captured by Browser Run at 1280 by 800](https://flaviocopes.com/images/cloudflare-browser-run/screenshot-quick-action.webp)

The default viewport is 1920x1080. You can also pass `fullPage: true`, a `selector` to capture one element, or `type: 'jpeg'` with a `quality`. Be careful with `quality`: it returns a 400 error with PNG, which is the default type.

### Get every link on a page

The `links` action is the start of any crawler or link checker:

```js
const res = await env.BROWSER.quickAction('links', {
  url: 'https://flaviocopes.com/',
  excludeExternalLinks: true
})
const { result } = await res.json()
```

On my home page it returned 135 absolute URLs in 1.7 seconds:

```json
[
  "https://flaviocopes.com/black-friday/#ai-workshop",
  "https://flaviocopes.com/sponsor/",
  "https://flaviocopes.com/",
  "https://flaviocopes.com/blog",
  "https://flaviocopes.com/courses",
  "https://flaviocopes.com/apps",
  "https://flaviocopes.com/newsletter",
  "https://flaviocopes.com/livekit/"
]
```

There's also `visibleLinksOnly: true`, which skips links hidden with CSS.

### Extract structured data with AI

The `json` action loads the page, gives it to a model, and returns data in the shape you ask for. You describe what you want with a `prompt`, and you can pin the output down with a JSON schema:

```js
const res = await env.BROWSER.quickAction('json', {
  url: 'https://flaviocopes.com/cloudflare-hyperdrive/',
  prompt: 'Get the title, date and the first three section headings of this post',
  response_format: {
    type: 'json_schema',
    json_schema: {
      type: 'object',
      properties: {
        title: { type: 'string' },
        date: { type: 'string' },
        headings: { type: 'array', items: { type: 'string' } }
      },
      required: ['title', 'headings']
    }
  }
})
```

The result, in 5.5 seconds:

```json
{
  "title": "Cloudflare Hyperdrive tutorial: use PostgreSQL with Workers",
  "date": "Nov 4, 2026",
  "headings": [
    "What problem does Cloudflare Hyperdrive solve?",
    "What can Hyperdrive replace in an existing stack?",
    "Hyperdrive vs PgBouncer"
  ]
}
```

All three headings are right, and the browser part only took 668 ms. The rest was the model. By default it's `@cf/meta/llama-3.3-70b-instruct-fp8-fast` on [Workers AI](https://flaviocopes.com/cloudflare-workers-ai/), billed as Workers AI usage on top of browser time.

You can use another model with `custom_ai`. Each entry is a model from a provider supported by [AI Gateway](https://flaviocopes.com/cloudflare-ai-gateway/) plus your key, and several entries act as fallbacks in order:

```json
{
  "url": "https://flaviocopes.com/cloudflare-hyperdrive/",
  "prompt": "Get the title and the headings",
  "custom_ai": [
    {
      "model": "anthropic/claude-sonnet-4-20250514",
      "authorization": "Bearer sk-ant-..."
    },
    {
      "model": "workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast"
    }
  ]
}
```

When the model returns something that doesn't parse, the error includes `rawAiResponse`, so you can see what it tried to return.

### The other Quick Actions

- `content` returns the rendered HTML, after JavaScript ran. This is what you use to pre-render a single-page app for search engines.
- `pdf` prints the page with Chrome. It takes `pdfOptions` like `format`, `margin`, `printBackground`, `headerTemplate` and `footerTemplate`, and `addStyleTag` to inject print CSS.
- `scrape` takes a list of CSS selectors and returns the text, HTML, attributes and position of each match.
- `accessibilityTree` returns the page as the accessibility tree, which is a compact way for an agent to understand a page, and a way to check your own pages.
- `snapshot` returns several formats from one page load. You pass `formats: ['markdown', 'screenshot', 'links']` and pay for one visit instead of three.
- `crawl` starts from a URL and follows links or the sitemap. It's asynchronous and REST only, covered below.

A few options work on all of them:

| Option | What it does |
| --- | --- |
| `gotoOptions.waitUntil` | When the page counts as loaded. `networkidle0` waits for the network to go quiet |
| `waitForSelector` | Waits for an element, which is usually faster than waiting for the network |
| `rejectResourceTypes` | Skips images, fonts or stylesheets you don't need |
| `cookies`, `authenticate`, `setExtraHTTPHeaders` | Loads pages behind a login |
| `addScriptTag`, `addStyleTag` | Injects JavaScript or CSS before the action runs |
| `cacheTTL` | Caches the result, 5 seconds by default, up to a day, `0` to disable |

The default `waitUntil` is `domcontentloaded`. If a single-page app comes back empty, that's almost always why.

## Quick Actions from anywhere with the REST API

Every Quick Action is also a REST endpoint, so you can call it without a Worker:

```txt
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/<action>
```

Create an API token in the Cloudflare dashboard with the Browser Run Edit permission (some pages of the docs still call it Browser Rendering Edit), then call it with `curl`:

```bash
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/browser-run/markdown" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://flaviocopes.com/cloudflare-hyperdrive/"}'
```

This is how you use Browser Run from a Node server, a Python script, a GitHub Action or an n8n workflow.

### Crawl a whole site

The `crawl` endpoint is different from the others because it's a job. You start it, get an ID, and poll for the results:

```bash
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/browser-run/crawl" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://developers.cloudflare.com/browser-run/", "limit": 50, "formats": ["markdown"]}'
```

The response is `{"success": true, "result": "<job id>"}`. Then you check it with `GET .../browser-run/crawl/<job id>?limit=1`, and fetch the records when it's `completed`.

The useful options are `source` (`links`, `sitemaps` or `all`), `includePatterns` and `excludePatterns`, `modifiedSince` to only fetch pages that changed, and `render: false` to skip the browser and fetch plain HTML, which is free during the beta. Results stay available for 14 days.

The crawler plays by the rules. It respects `robots.txt` and its `crawl-delay`, waits half a second between requests to the same domain, identifies itself as `CloudflareBrowserRenderingCrawler/1.0`, and honors Content Signals. If a site says "no AI training", a crawl with `ai-train` in its purposes gets refused for that site.

## Browser Sessions with Puppeteer

When you need to click, type or wait for something, you open a session. Browser Run has its own fork of Puppeteer that connects through the binding:

```bash
npm install -D @cloudflare/puppeteer
```

Here's a smoke test I ran against my own site. It opens the home page, clicks the link to the blog, and collects the JavaScript errors and console errors along the way:

```js
import puppeteer from '@cloudflare/puppeteer'

export default {
  async fetch(request, env) {
    const browser = await puppeteer.launch(env.BROWSER)
    const page = await browser.newPage()

    const errors = []
    page.on('pageerror', (err) => errors.push(err.message))
    page.on('console', (msg) => msg.type() === 'error' && errors.push(msg.text()))

    await page.goto('https://flaviocopes.com/', { waitUntil: 'networkidle0' })
    await Promise.all([
      page.waitForNavigation(),
      page.click('a[href="/blog"]')
    ])

    const title = await page.title()
    const posts = await page.$$eval('main a', (links) => links.length)
    await browser.close()

    return Response.json({ title, posts, errors })
  }
}
```

The output, after 7 seconds:

```json
{
  "title": "Flavio Copes guides: 2,100+ free AI and programming tutorials",
  "posts": 100,
  "errors": [
    "%c%d font-size:0;color:transparent NaN",
    "%c%d font-size:0;color:transparent NaN",
    "%c%o font-size:0;color:transparent [object Object]",
    "%c%o font-size:0;color:transparent [object Object]"
  ]
}
```

The navigation worked, and the blog page lists 100 posts. The `errors` array is the interesting part: four console errors styled to be invisible (`font-size:0;color:transparent`). You'd never see them in DevTools unless you went looking. That's the kind of thing a scheduled check catches and a human doesn't.

Always call `browser.close()`. A browser you forget stays open until the idle timeout, 60 seconds by default, and you pay for those seconds.

If you prefer Playwright, there's `@cloudflare/playwright` with the same idea: `launch(env.BROWSER)` instead of `chromium.launch()`, plus `expect` from `@cloudflare/playwright/test` for assertions. Firefox, videos and the full Playwright Test runner aren't supported.

### Check your limits from code

Puppeteer has a helper that reads your account's current limits. On my paid account it returned:

```json
{
  "activeSessions": [],
  "maxConcurrentSessions": 200,
  "allowedBrowserAcquisitions": 10,
  "timeUntilNextAllowedBrowserAcquisition": 0
}
```

You get it with `await puppeteer.limits(env.BROWSER)`. It's useful in a Worker that runs many jobs, so it can wait instead of failing with a 429.

### Reuse a browser instead of starting a new one

By default every `launch()` starts a fresh browser. That's slow, and starting browsers is rate limited. If your Worker handles a lot of requests, you can keep a browser alive and connect to it:

```js
const sessions = await puppeteer.sessions(env.BROWSER)
const free = sessions.find((s) => !s.connectionId)

const browser = free
  ? await puppeteer.connect(env.BROWSER, free.sessionId)
  : await puppeteer.launch(env.BROWSER, { keep_alive: 600000 })

const context = await browser.createBrowserContext()
const page = await context.newPage()
// ...work with the page
await context.close()
browser.disconnect()
```

Two details. `keep_alive` is in milliseconds, between 10 seconds and 20 minutes, and it's an idle timeout, not a maximum lifetime. And you call `disconnect()`, not `close()`, so the next request finds the browser still running. Each request gets its own browser context, so cookies don't leak between them.

## Control a browser from outside Cloudflare with CDP

Browser Run exposes the [Chrome DevTools Protocol](https://flaviocopes.com/chrome-devtools-protocol/) over a WebSocket. Anything that speaks CDP can drive it, from your laptop or any server:

```txt
wss://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/devtools/browser?keep_alive=600000
```

With regular `puppeteer-core` in Node:

```js
import puppeteer from 'puppeteer-core'

const browser = await puppeteer.connect({
  browserWSEndpoint: `wss://api.cloudflare.com/client/v4/accounts/${process.env.CF_ACCOUNT_ID}/browser-run/devtools/browser?keep_alive=600000`,
  headers: { Authorization: `Bearer ${process.env.CF_API_TOKEN}` }
})

const page = await browser.newPage()
await page.goto('https://flaviocopes.com/')
console.log(await page.title())
await browser.close()
```

The code is the [Puppeteer](https://flaviocopes.com/puppeteer/) you already know. The only change is where the browser lives.

### Wrangler and Live View

Wrangler has commands to manage sessions by hand. They're in open beta:

```bash
npx wrangler browser create
```

```txt
Session created: 63b3ef5a-1af1-4ade-ba58-c32ee3130b4a
https://live.browser.run/ui/view?wss=live.browser.run/api/devtools/browser/63b3ef5a-.../page/66AB3AF6...?jwt=...
```

The second line is a **Live View** URL. Open it and you see the remote browser's tab, and you can click and type in it. Treat that URL like a password, because the JWT in it gives control of the session.

`wrangler browser list` shows what's running:

```txt
┌──────────────────────────────────────┬────────────────────────┬───────────────┬──────────────┐
│ Session ID                           │ Start Time             │ Connection ID │ Connected At │
├──────────────────────────────────────┼────────────────────────┼───────────────┼──────────────┤
│ 63b3ef5a-1af1-4ade-ba58-c32ee3130b4a │ 11/20/2026, 9:20:44 AM │ -             │ -            │
└──────────────────────────────────────┴────────────────────────┴───────────────┴──────────────┘
```

And `wrangler browser close <sessionId>` ends it. I'd run `list` from time to time while developing, to catch sessions a buggy script left open.

## Browser Run for AI agents

This is where I think Browser Run is most interesting right now. Here's how the pieces fit together:

```mermaid
flowchart LR
  accTitle: How an AI agent uses Browser Run
  accDescr: An agent calls Quick Actions for one-shot reads, or drives a Browser Session through MCP or CDP for multi-step tasks, and a human can take over through Live View.
  A["AI agent"] -->|"read a page"| B["Quick Actions: markdown, json, snapshot"]
  A -->|"multi-step task"| C["Browser Session via MCP or CDP"]
  C --> D["Live View and human handoff"]
  C --> E["Session recording"]
  B --> F["Result back in the agent's context"]
  C --> F
```

### Give a coding agent a cloud browser through MCP

The quickest way is `chrome-devtools-mcp` pointed at the Browser Run WebSocket. In Claude Code you add it to `~/.claude.json`, and the same block works in Cursor and OpenCode:

```json
{
  "mcpServers": {
    "browser-run": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--wsEndpoint=wss://api.cloudflare.com/client/v4/accounts/<accountId>/browser-run/devtools/browser?keep_alive=600000",
        "--wsHeaders={\"Authorization\":\"Bearer <API_TOKEN>\"}"
      ]
    }
  }
}
```

The agent gets the usual tools (navigate, click, fill, screenshot, read the console) but the browser runs on Cloudflare, not on your Mac. That's what you want for an agent running in a container, on a VPS, or overnight, and it keeps the agent away from your own logged-in Chrome profile. If you're new to MCP, start with [what is MCP](https://flaviocopes.com/what-is-mcp/).

Cloudflare also has `@cloudflare/playwright-mcp`, a Playwright MCP server you deploy as your own Worker, backed by a [Durable Object](https://flaviocopes.com/cloudflare-durable-objects/). Then any MCP client connects to your Worker's `/mcp` endpoint.

### Feed pages to a model as Markdown

When an agent needs to read the web, most of the cost is tokens. The `markdown` action strips a page down to its content before it reaches the model. For a docs page, a changelog or a blog post, the model gets a short clean document instead of thousands of tokens of HTML.

For several pages, `crawl` with `formats: ['markdown']` turns a documentation site into a folder of Markdown files you can load into an agent's knowledge base or a [Vectorize](https://developers.cloudflare.com/vectorize/) index. `modifiedSince` keeps the next crawl small.

### Extract instead of parse

For an agent that needs data rather than prose, the `json` action does the parsing for you. "Get the price, plan names and limits from this pricing page" with a schema is a lot less brittle than CSS selectors that break when the site changes its design. I'd still validate the result, because a model can get a number wrong.

### Let a human take over for logins and 2FA

Agents get stuck on logins, two-factor codes and CAPTCHAs. Browser Run doesn't bypass CAPTCHAs, and it shouldn't. Instead it has a **human in the loop** handoff over CDP: the agent sends `Cloudflare.handoff` with instructions like "please log in", you get a Live View link, you do the login in the remote browser, and the agent gets `Cloudflare.handoffComplete` and carries on in the same session. The handoff can wait up to 30 minutes.

### Record what the agent did

Pass `recording: true` when you start a session (`puppeteer.launch(env.BROWSER, { recording: true })`, or `?recording=true` on the WebSocket URL) and Browser Run records the session with rrweb. It's a replay of the DOM, not a video, input values are masked, and you can download the network traffic as a HAR file. Recordings stay for 30 days. When an agent does something weird at 4 AM, this is how you find out what it saw.

### Put guardrails on the browser

An agent with a browser can go anywhere. Guardrails restrict a session to a list of allowed domains, or to read-only CDP methods, so it can look but not type or click. Over CDP you pass them in the `cf-brapi-guardrails` header. I'd use the read-only mode for any agent whose job is research.

### Kitesurf, the agent-first browser

For agents that read and click without needing video or WebGL, Browser Run also offers [Kitesurf](https://flaviocopes.com/kitesurf-agentic-browser/), Cloudflare's own browser that runs on Workers instead of Chromium. You add `?browser=kitesurf` to a Quick Action or the CDP URL, or `browser: 'kitesurf'` to `quickAction()`. It's free during the beta.

## Browser Run for web applications

Not everything is about agents. These are the jobs where I'd use it in a regular web app.

| Job | How |
| --- | --- |
| Open Graph images for posts or products | Render an HTML template with `screenshot` and `html` instead of `url`, store it in [R2](https://flaviocopes.com/cloudflare-r2/) |
| PDF invoices, receipts, reports | `pdf` with `html` and print CSS, triggered when the order is paid |
| Link previews in a chat or a CMS | `snapshot` with `screenshot` and `links`, or `json` for title, image and description |
| Smoke tests after every deploy | A Puppeteer session like the one above, from a [Cron Trigger](https://flaviocopes.com/cloudflare-cron-triggers/) |
| Price and change monitoring | `scrape` or `json` on a schedule, diff with yesterday's result in [KV](https://flaviocopes.com/cloudflare-kv/) |
| Pre-rendering a single-page app for crawlers | `content` with `waitUntil: 'networkidle0'`, cached |
| Archiving pages | `pdf` or `snapshot`, stored in R2 |
| Accessibility checks | `accessibilityTree` on your key pages |
| Checking broken links | `crawl` with `source: 'links'`, then check the statuses |

Two of these deserve a note.

For **OG images and PDFs**, pass `html` instead of `url`. You render your own template, so there's no network request to a page, it's faster, and you don't have to publish a page only to screenshot it.

For **jobs that take many browser calls**, put a [Queue](https://flaviocopes.com/cloudflare-queues/) in front. A Cron Trigger adds one message per URL, and the consumer processes them at a pace your concurrency limit can handle. My [scraping tool post](https://flaviocopes.com/scraping-tool/) has a full version of this with a pricing page.

## Pricing and limits

| | Workers Free | Workers Paid |
| --- | --- | --- |
| Browser time | 10 minutes a day | 10 hours a month included, then $0.09 an hour |
| Concurrent browsers (sessions) | 3 | 10 included, then $2 per browser, up to 200 |
| New browsers | 1 every 20 seconds | 3 per second |
| Quick Action requests | 1 every 10 seconds | 30 per second |
| Browser idle timeout | 60 seconds | 60 seconds, up to 20 minutes with keep alive |
| Crawl jobs | 5 a day, 100 pages each | Up to 100,000 pages a job |

Quick Actions are billed on browser time only. Sessions are billed on browser time and on concurrent browsers, where concurrency is the average of each day's peak.

To give you a sense of scale, the three Quick Actions I timed for this post used between 530 and 670 ms of browser time each. At $0.09 an hour, a screenshot like that costs about $0.000013, and 10 included hours is more than 60,000 screenshots a month. The AI extraction adds Workers AI usage on top.

A failed Quick Action that hits a wait timeout isn't charged. A forgotten `browser.close()` is.

## What Browser Run won't do

Browser Run traffic is always identified as a bot. It sends signed requests using Web Bot Auth, and headers like `Signature-agent` and `cf-brapi-request-id` that you can't remove. Site owners can allow or block it.

That means it isn't a tool for getting past bot protection. Changing the user agent doesn't help, it doesn't solve CAPTCHAs or Turnstile, and it doesn't rotate IPs. On a site that blocks bots you'll get the block page in your screenshot. For sites you're authorized to automate and that fight back, a hosted browser built for that, like [TinyFish](https://flaviocopes.com/tinyfish/), or a real browser with a residential connection works better, and it's why my scraping tool post keeps a separate setup for Google.

For your own sites, your clients' sites, public docs and the many sites that don't block bots, it's fine.

## Gotchas

- **Empty pages.** The default wait is `domcontentloaded`. Use `waitForSelector` or `networkidle0` for apps that render with JavaScript.
- **422 errors.** The page crashed, ran out of memory or timed out. Try `rejectResourceTypes` to skip heavy assets.
- **429 errors.** You hit a rate limit. Respect the `Retry-After` header. On the free plan, "Browser time limit exceeded for today" resets at midnight UTC.
- **"Cannot read properties of undefined (reading 'fetch')".** You passed the wrong binding name to `launch()`.
- **No XPath** in `@cloudflare/puppeteer`. Use CSS selectors or `page.evaluate()`, which can only return plain values.
- **Too many tabs** in one browser can crash it. Use several browser contexts across a few browsers instead of 50 tabs in one.
- **Local dev without `remote: true`** gives you fake `json` results and no Kitesurf, and rejects requests over 1 MB.

## Browser Run compared with the alternatives

| | Browser Run | Your own Chrome on a server | Hosted agent browsers (TinyFish and similar) | Chrome on your Mac |
| --- | --- | --- | --- | --- |
| Setup | A binding or a token | Server, Chrome, a pool, monitoring | An account and a key | Nothing |
| Scales to many browsers | Yes, up to 200 | As many as you pay for | Yes | No |
| Runs from Workers | Yes, natively | No | Over HTTP or CDP | No |
| Bot protection | Identified as a bot | Depends on your IP | Built to handle it | You're a real user |
| Logged-in sessions | Cookies, handoff, Live View | Persistent profiles | Saved profiles | Your own logins |
| Cost model | Browser seconds | Server time, idle included | Per task or per minute | Free |

If you're already on Cloudflare, Browser Run is the obvious default for screenshots, PDFs, Markdown, extraction and smoke tests, and it's a good cloud browser for agents that work on sites that don't mind bots. If you need persistent profiles and stealth, look elsewhere.

The full reference is in the [Browser Run docs](https://developers.cloudflare.com/browser-run/), and the [changelog](https://developers.cloudflare.com/browser-run/changelog/) moves fast: Live View, human handoff, recordings, the CDP endpoint and `quickAction()` all arrived in 2026.
