jackspace/claudeskillz/cloudflare-browser-rendering
- community
Checking that the SKILL.md file is still in the repository.
Reference for Cloudflare Browser Rendering, headless Chrome on Workers via @cloudflare/puppeteer and @cloudflare/playwright. Covers the browser binding, puppeteer.launch, puppeteer.connect and puppeteer.sessions, page.goto, page.screenshot, page.pdf, page.evaluate, browser.close and disconnect, session reuse with keep_alive, incognito contexts, batch scraping and crawling, and pricing and concurrency limits. Use when taking screenshots, generating PDFs from URLs or HTML, scraping or crawling sites, automating or testing web apps from a Worker, extracting page content for AI, or troubleshooting browser timeouts, concurrency limits, memory exceeded errors, XPath selectors not supported, or Cannot read properties of undefined (reading fetch).
Install
npx vskill@latest install jackspace/claudeskillz/cloudflare-browser-renderingSKILL.md
Cloudflare Browser Rendering - Complete Reference
Production-ready knowledge domain for building browser automation workflows with Cloudflare Browser Rendering.
Status: Production Ready ✅ Last Updated: 2025-10-22 Dependencies: cloudflare-worker-base (for Worker setup) Latest Versions: @cloudflare/puppeteer@1.0.4, @cloudflare/playwright@1.0.0, wrangler@4.43.0
Table of Contents
- Quick Start (5 minutes)
- Browser Rendering Overview
- Puppeteer API Reference
- Playwright API Reference
- Session Management
- Common Patterns
- Pricing & Limits
- Known Issues Prevention
- Production Checklist
Quick Start (5 minutes)
1. Add Browser Binding
wrangler.jsonc:
Why nodejs_compat? Browser Rendering requires Node.js APIs and polyfills.
2. Install Puppeteer
3. Take Your First Screenshot
4. Deploy
Test at: https://your-worker.workers.dev/?url=https://example.com
CRITICAL:
- Always pass
env.MYBROWSERtopuppeteer.launch()(not undefined) - Always call
browser.close()when done (or usebrowser.disconnect()for session reuse) - Use
nodejs_compatcompatibility flag
Browser Rendering Overview
What is Browser Rendering?
Cloudflare Browser Rendering provides headless Chromium browsers running on Cloudflare's global network. Use familiar tools like Puppeteer and Playwright to automate browser tasks:
- Screenshots - Capture visual snapshots of web pages
- PDF Generation - Convert HTML/URLs to PDFs
- Web Scraping - Extract content from dynamic websites
- Testing - Automate frontend tests
- Crawling - Navigate multi-page workflows
Two Integration Methods
| Method | Best For | Complexity | |
|---|---|---|---|
| Workers Bindings | Complex automation, custom workflows, session management | Advanced | |
| REST API | Simple screenshot/PDF tasks | Simple |
This skill covers Workers Bindings (the advanced method with full Puppeteer/Playwright APIs).
Puppeteer vs Playwright
| Feature | Puppeteer | Playwright | |
|---|---|---|---|
| API Familiarity | Most popular | Growing adoption | |
| Package | @cloudflare/puppeteer@1.0.4 | @cloudflare/playwright@1.0.0 | |
| Session Management | ✅ Advanced APIs | ⚠️ Basic | |
| Browser Support | Chromium only | Chromium only (Firefox/Safari not yet supported) | |
| Best For | Screenshots, PDFs, scraping | Testing, frontend automation |
Recommendation: Use Puppeteer for most use cases. Playwright is ideal if you're already using it for testing.
Puppeteer API Reference
puppeteer.launch()
Launch a new browser instance.
Signature:
Parameters:
binding(required) - Browser binding fromenv.MYBROWSERoptions(optional):keep_alive(number) - Keep browser alive for N milliseconds (max: 600000 = 10 minutes)
Returns: Promise<Browser> - Browser instance
Example:
CRITICAL: Must pass env.MYBROWSER binding. Error "Cannot read properties of undefined (reading 'fetch')" means the binding wasn't passed.
puppeteer.connect()
Connect to an existing browser session.
Signature:
Use Cases:
- Reuse existing browser sessions for performance
- Share browser instance across multiple Workers
- Reduce startup time
Example:
puppeteer.sessions()
List currently running browser sessions.
Signature:
Returns:
Example:
puppeteer.history()
List recent sessions (both open and closed).
Signature:
Returns:
Use Case: Monitor usage patterns and debug session issues.
puppeteer.limits()
Check current account limits and available sessions.
Signature:
Returns:
Example:
Browser API
Methods available on the Browser object returned by launch() or connect().
browser.newPage()
Create a new page (tab) in the browser.
Signature:
Example:
Performance Tip: Reuse browser instances and open multiple tabs instead of launching new browsers.
browser.sessionId()
Get the current browser session ID.
Returns: string - Session ID
Example:
browser.close()
Close the browser and terminate the session.
Signature:
When to use: When you're completely done with the browser and want to free resources.
browser.disconnect()
Disconnect from the browser WITHOUT closing it.
Signature:
When to use: Session reuse - allows another Worker to connect to the same session later.
Example:
browser.createBrowserContext()
Create an isolated incognito browser context.
Signature:
Use Cases:
- Isolate cookies and cache between operations
- Test multi-user scenarios
- Maintain session isolation while reusing browser
Example:
Page API
Methods available on the Page object returned by browser.newPage().
page.goto()
Navigate to a URL.
Signature:
Options:
waitUntil- When to consider navigation complete:"load"- Wait for load event (default)"domcontentloaded"- Wait for DOMContentLoaded"networkidle0"- Wait until no network connections for 500ms"networkidle2"- Wait until ≤2 network connections for 500mstimeout- Maximum navigation time in milliseconds (default: 30000)
Example:
Best Practice: Use "networkidle0" for dynamic content, "load" for static pages.
page.screenshot()
Capture a screenshot of the page.
Signature:
Options:
fullPage(boolean) - Capture full scrollable page (default: false)type(string) -"png"or"jpeg"(default:"png")quality(number) - JPEG quality 0-100 (only for jpeg)clip(object) - Capture specific region:{ x, y, width, height }
Examples:
page.pdf()
Generate a PDF of the page.
Signature:
Options:
format(string) - Page format:"Letter","A4", etc.printBackground(boolean) - Include background graphics (default: false)margin(object) -{ top, right, bottom, left }(e.g.,"1cm")landscape(boolean) - Landscape orientation (default: false)scale(number) - Scale factor 0.1-2 (default: 1)
Example:
page.content()
Get the full HTML content of the page.
Signature:
Example:
page.setContent()
Set custom HTML content.
Signature:
Use Case: Generate PDFs from custom HTML.
Example:
page.evaluate()
Execute JavaScript in the browser context.
Signature:
Use Cases:
- Extract data from the DOM
- Manipulate page content
- Workaround for XPath (not directly supported)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cloudflare-browser-rendering/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 6
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jackspace/claudeskillz/cloudflare-browser-rendering)