secondsky/claude-skills / plugins/cloudflare-browser-rendering/skills/cloudflare-browser-rendering
cloudflare-browser-rendering
VerifiedCloudflare Browser Rendering with Puppeteer/Playwright. Use for screenshots, PDFs, web scraping, or encountering rendering errors, timeout issues, memory exceeded.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.7 KB |
| references/common-errors.md | markdown | 14.9 KB |
| references/patterns.md | markdown | 12.6 KB |
| references/pricing-and-limits.md | markdown | 13.9 KB |
| references/puppeteer-api.md | markdown | 11.8 KB |
| references/puppeteer-vs-playwright.md | markdown | 15.1 KB |
| references/session-management.md | markdown | 16.4 KB |
| scripts/check-versions.shexecutable | script | 1.2 KB |
| templates/ai-enhanced-scraper.ts | script | 3.7 KB |
| templates/basic-screenshot.ts | script | 1.8 KB |
| templates/pdf-generation.ts | script | 2.8 KB |
| templates/playwright-example.ts | script | 2.7 KB |
| templates/screenshot-with-kv-cache.ts | script | 2.7 KB |
| templates/session-reuse.ts | script | 3.5 KB |
| templates/web-scraper-basic.ts | script | 2.9 KB |
| templates/web-scraper-batch.ts | script | 3.1 KB |
| templates/wrangler-browser-config.jsonc | other | 3.1 KB |
templates/basic-screenshot.ts
View on GitHub// Basic Screenshot Example
// Minimal example for taking screenshots with Cloudflare Browser Rendering
import puppeteer from "@cloudflare/puppeteer";
interface Env {
MYBROWSER: Fetcher;
}
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const { searchParams } = new URL(request.url);
const url = searchParams.get("url");
if (!url) {
return new Response("Missing ?url parameter. Example: ?url=https://example.com", {
status: 400,
});
}
let normalizedUrl: string;
try {
normalizedUrl = new URL(url).toString();
} catch {
return new Response("Invalid URL", { status: 400 });
}
// Launch browser
const browser = await puppeteer.launch(env.MYBROWSER);
try {
// Create new page
const page = await browser.newPage();
// Navigate to URL
await page.goto(normalizedUrl, {
waitUntil: "networkidle0", // Wait for network to be idle
timeout: 30000, // 30 second timeout
});
// Take screenshot
const screenshot = await page.screenshot({
fullPage: true, // Capture full scrollable page
type: "png",
});
// Clean up
await browser.close();
return new Response(screenshot, {
headers: {
"content-type": "image/png",
"cache-control": "public, max-age=3600", // Cache for 1 hour
},
});
} catch (error) {
// Always close browser on error
await browser.close();
throw error;
}
},
};
/**
* Deploy:
* npx wrangler deploy
*
* Test:
* https://your-worker.workers.dev/?url=https://example.com
*
* Configuration (wrangler.jsonc):
* {
* "browser": { "binding": "MYBROWSER" },
* "compatibility_flags": ["nodejs_compat"]
* }
*/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |