cloudflare-browser
What it does
This skill lets an AI agent drive a headless Chrome browser hosted on Cloudflare Workers. It is for developers who need screenshots, scraping or page recordings without running their own browser.
When to use it
- ✓When you need a screenshot of a web page taken by a remote browser.
- ✓When you want to scrape content from pages that need a real browser.
- ✓When you want to record a video across several pages in sequence.
Skill link
https://github.com/cloudflare/moltworker/blob/main/skills/cloudflare-browser/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Take a screenshot of our pricing page and save it as a PNG file.”
5 new skills a week. 1 minute to read.
How it works
The agent connects to a Chrome DevTools Protocol endpoint over WebSocket on a Cloudflare Worker, then sends commands to navigate, capture and read the page. Helper scripts handle screenshots and multi-page video.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Cloudflare Browser Rendering
Control headless browsers via Cloudflare's Browser Rendering service using CDP (Chrome DevTools Protocol) over WebSocket.
Prerequisites
CDP_SECRETenvironment variable set- Browser profile configured in openclaw.json with
cdpUrlpointing to the worker endpoint:"browser": { "profiles": { "cloudflare": { "cdpUrl": "https://your-worker.workers.dev/cdp?secret=..." } } }
Quick Start
Screenshot
node /path/to/skills/cloudflare-browser/scripts/screenshot.js https://example.com output.png
Multi-page Video
node /path/to/skills/cloudflare-browser/scripts/video.js "https://site1.com,https://site2.com" output.mp4
CDP Connection Pattern
The worker creates a page target automatically on WebSocket connect. Listen for Target.targetCreated event to get the targetId:
const WebSocket = require('ws');
const CDP_SECRET = process.env.CDP_SECRET;
const WS_URL = `wss://your-worker.workers.dev/cdp?secret=${encodeURIComponent(CDP_SECRET)}`;
const ws = new WebSocket(WS_URL);
let targetId = null;
ws.on('message', (data) => {
const msg = JSON.parse(data.toString());
if (msg.method === 'Target.targetCreated' && msg.params?.targetInfo?.type === 'page') {
targetId = msg.params.targetInfo.targetId;
}
});
Key CDP Commands
| Command | Purpose |
|---|---|
| Page.navigate | Navigate to URL |
| Page.captureScreenshot | Capture PNG/JPEG |
| Runtime.evaluate | Execute JavaScript |
| Emulation.setDeviceMetricsOverride | Set viewport size |
Common Patterns
Navigate and Screenshot
await send('Page.navigate', { url: 'https://example.com' });
await new Promise(r => setTimeout(r, 3000)); // Wait for render
const { data } = await send('Page.captureScreenshot', { format: 'png' });
fs.writeFileSync('out.png', Buffer.from(data, 'base64'));
Scroll Page
await send('Runtime.evaluate', { expression: 'window.scrollBy(0, 300)' });
Set Viewport
await send('Emulation.setDeviceMetricsOverride', {
width: 1280,
height: 720,
deviceScaleFactor: 1,
mobile: false
});
Creating Videos
- Capture frames as PNGs during navigation
- Use ffmpeg to stitch:
ffmpeg -framerate 10 -i frame_%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4
Troubleshooting
- No target created: Race condition - wait for Target.targetCreated event with timeout
- Commands timeout: Worker may have cold start delay; increase timeout to 30-60s
- WebSocket hangs: Verify CDP_SECRET matches worker configuration
FAQ
What setup is needed?
The skill requires a CDP_SECRET environment variable and a browser profile with a cdpUrl in the config.
Where do the screenshot scripts live?
They are in the skill's scripts folder, and the skill shows a sample command for them.
Does it work outside Cloudflare Workers?
The skill is written for a Cloudflare Workers setup, so it expects that environment.
Details
Original description by the author
Control headless Chrome via Cloudflare Browser Rendering CDP WebSocket. Use for screenshots, page navigation, scraping, and video capture when browser automation is needed in a Cloudflare Workers environment. Requires CDP_SECRET env var and cdpUrl configured in browser.profiles.
repo: cloudflare/moltworker
Popularity
- GitHub stars
- 9.9k
- Ranking position
- #12035
- License
- Apache-2.0
- Updated
- 5/8/2026
Comments
- …
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.