This site is not affiliated with or endorsed by Cloudflare, Inc. It showcases deployable experiments across most Cloudflare products.
Browser Rendering

Browser CDP Inspect

Browser Rendering + Puppeteer CDP inspection - capture title, cookies, document metadata, and performance timing without screenshots

Browser Rendering inspection beyond screenshots - navigate with @cloudflare/puppeteer and return title, cookies, document metadata, and performance timing.

API Reference

GET /inspect

url string (required)

http:// or https:// target.

Navigation timeout: 20s. Uses waitUntil: "domcontentloaded" to stay under the Worker request budget.

Example Request

curl "https://your-worker.workers.dev/inspect?url=https://example.com"

Success Response

{
  "title": "Example Domain",
  "url": "https://example.com/",
  "cookiesCount": 0,
  "documentTitle": "Example Domain",
  "performance": { "domContentLoaded": 120.5 },
  "userAgent": "..."
}

Error Codes

  • 400 - Missing or non-http(s) url (INVALID_URL)
  • 502 - Browser launch or navigation failure (INSPECT_ERROR)

Use Cases

  • Inspect rendered page metadata without capturing a screenshot
  • Count cookies and read document title after JS load
  • Collect basic performance timing from Puppeteer/CDP
  • Debug SPA shells that need a real browser, not raw HTML fetch

Limitations

  • Browser Rendering requires remote mode (wrangler dev --remote) or a deployed Worker
  • 20s navigation timeout; domcontentloaded only (not full network idle)
  • Returns a subset of CDP data - not a full DevTools dump
  • Subject to Browser Rendering quotas and concurrency limits

Use in your project

Copy these files into an existing Worker. Prefer Deployment to try the full experiment first. Source: apps/experiments/browser-cdp-inspect.

DependenciesNoneBindingsBrowser RenderingPlatformWorkers runtime
import { ALLOWED_SCHEMES } from "../constants/defaults";export function validateUrl(input: string | undefined): string | null {  if (!input || typeof input !== "string") return null;  const trimmed = input.trim();  if (!trimmed) return null;  try {    const url = new URL(trimmed);    if (!ALLOWED_SCHEMES.includes(url.protocol as (typeof ALLOWED_SCHEMES)[number])) {      return null;    }    return url.href;  } catch {    return null;  }}

Deployment

Click the deploy button

Deploy to Cloudflare Workers

Deploy

Ensure Browser Rendering is enabled for your account. wrangler.json binds BROWSER and uses nodejs_compat_v2.

Test your deployment

curl "https://your-worker.workers.dev/inspect?url=https://www.cloudflare.com"

Local Development

cd apps/experiments/browser-cdp-inspect
npm install
npm run dev

For Browser Rendering locally, prefer remote mode:

npx wrangler dev --remote
curl "http://localhost:8787/inspect?url=https://example.com"

Configuration

wrangler.json declares:

  • Browser binding BROWSER
  • Compatibility flag nodejs_compat_v2

Cloudflare Features Used

On this page