Token导航 LogoToken导航

Agent Skill · 研究检索

browser-rendering(浏览器渲染)

browser-rendering 用于处理浏览器自动化、网页检查和页面信息提取,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

browser-rendering 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 58,684。

总安装 408周安装 17GitHub Stars 公开资料未说明下载 136核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:browser-rendering(浏览器渲染)
来源仓库:https://github.com/null-shot/cloudflare-skills
仓库路径:skills/browser-rendering
安装命令:
npx skills add https://github.com/null-shot/cloudflare-skills --skill browser-rendering
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/null-shot/cloudflare-skills --skill browser-rendering

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

browser-rendering 借助 Cloudflare 边缘节点提供全球分布式浏览器渲染服务。支持 REST API 快速截图与 Puppeteer/Playwright 高级自动化集成。适用于大规模网页抓取、PDF 生成及跨平台兼容性测试场景。可根据任务复杂度在简单 HTTP 调用与专业框架间自由切换。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/browser-rendering

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/null-shot/cloudflare-skills --skill browser-re…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

browser-rendering 怎么安装?

在终端执行 npx skills add https://github.com/null-shot/cloudflare-skills --skill browser-rendering。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

browser-rendering 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

browser-rendering 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

browser-rendering 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

browser-rendering 用的人多吗?

公开数据是累计安装 408 次,近一周安装 17 次,下载 136 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

browser-rendering 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
browser-rendering

浏览器渲染 · 本页

408—接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Browser Rendering

Cloudflare Browser Rendering provides headless Chrome instances on the global edge network for web scraping, screenshots, PDF generation, and automated testing. Choose from REST API for simple tasks or Workers Bindings (Puppeteer, Playwright, Stagehand) for advanced automation.

Choosing an Integration Method

MethodUse CaseComplexity
REST APISimple screenshots, PDFs, markdown extraction, structured dataLow - just HTTP requests
PuppeteerIndustry-standard Chrome automation, porting existing scriptsMedium - familiar API
PlaywrightModern cross-browser automation, AI agent integration (MCP)Medium - developer-friendly
StagehandAI-native automation with natural language selectorsLow - resilient to site changes

REST API Method

For simple, stateless tasks like capturing screenshots or generating PDFs without writing complex scripts.

Setup

Create an API token with Browser Rendering - Edit permission in the Cloudflare dashboard.

Available Endpoints

EndpointPurpose
/contentFetch fully-rendered HTML
/screenshotCapture page screenshot
/pdfGenerate PDF document
/snapshotTake webpage snapshot
/scrapeExtract HTML elements
/jsonCapture structured data using AI
/linksRetrieve all links from page
/markdownExtract markdown content

REST API Example

curl -X POST \
  https://api.cloudflare.com/client/v4/accounts/{account_id}/browser-rendering/screenshot \
  -H "Authorization: Bearer {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "fullPage": true,
    "type": "png"
  }' \
  --output screenshot.png

Monitoring usage: Check the X-Browser-Ms-Used header in responses to see browser time consumed (in milliseconds).

Workers Bindings Method

For complex workflows, persistent sessions, and custom automation. Requires deploying a Cloudflare Worker.

Configuration

Add browser binding to wrangler.jsonc:

{
  "name": "browser-automation",
  "main": "src/index.ts",
  "compatibility_date": "2025-09-17",
  "compatibility_flags": ["nodejs_compat"],
  "browser": {
    "binding": "BROWSER"
  }
}

Option A: Puppeteer

Industry-standard Chrome automation API, ideal for porting existing scripts.

Installation:

npm install @cloudflare/puppeteer --save-dev

Basic example:

import puppeteer from "@cloudflare/puppeteer";

interface Env {
  BROWSER: Fetcher;
}

export default {
  async fetch(request, env): Promise<Response> {
    const { searchParams } = new URL(request.url);
    const url = searchParams.get("url");

    if (!url) {
      return new Response("Missing ?url parameter", { status: 400 });
    }

    const browser = await puppeteer.launch(env.BROWSER);
    try {
      const page = await browser.newPage();
      await page.goto(url);
      const text = await page.$eval("body", (el) => el.textContent);

      return Response.json({ bodyText: text });
    } finally {
      await browser.close();
    }
  },
} satisfies ExportedHandler<Env>;

Option B: Playwright (Recommended for New Projects)

Modern browser automation with developer-friendly API and AI agent integration.

Installation:

npm install @cloudflare/playwright --save-dev

Current version: v1.57.0

Basic example:

import { launch } from "@cloudflare/playwright";

interface Env {
  BROWSER: Fetcher;
}

export default {
  async fetch(request, env): Promise<Response> {
    const browser = await launch(env.BROWSER);
    try {
      const page = await browser.newPage();
      await page.goto("https://example.com");

      const title = await page.title();
      const screenshot = await page.screenshot({ type: "png" });

      return new Response(screenshot, {
        headers: { "Content-Type": "image/png" },
      });
    } finally {
      await browser.close();
    }
  },
} satisfies ExportedHandler<Env>;

Playwright advantages:

  • Built-in test assertions with expect() from @cloudflare/playwright/test
  • Trace files for debugging (downloadable trace.zip)
  • Storage state for persisting cookies/localStorage
  • MCP integration for AI agents

Option C: Stagehand (AI-Native)

Uses natural language selectors instead of brittle CSS selectors, making automation resilient to website changes.

Example:

// Instead of: await page.click("#submit-button")
// Use natural language: await page.act("click the submit button")

Stagehand is ideal for AI agents that need to autonomously navigate websites without breaking when the DOM structure changes.

FIRST: Installation (Workers Bindings)

Choose your library and install:

# Puppeteer (industry standard)
npm install @cloudflare/puppeteer --save-dev

# OR Playwright (modern, recommended)
npm install @cloudflare/playwright --save-dev

# OR Stagehand (AI-native)
npm install @cloudflare/stagehand --save-dev

When to Use Browser Rendering

Use CaseRecommended MethodWhy
Simple screenshotsREST APINo code required, just HTTP request
PDF generationREST API or PuppeteerREST for simple, Puppeteer for custom headers/auth
Web scrapingPuppeteer or PlaywrightFull DOM access, complex navigation
Automated testingPlaywrightBuilt-in assertions, trace files
SEO analysisREST API /markdown or /jsonAI-powered structured extraction
AI agentsPlaywright (MCP) or StagehandNatural language automation, resilient selectors
Page monitoringREST API or PuppeteerREST for periodic checks, Puppeteer for complex flows

Quick Reference

OperationAPI
Launch browserawait puppeteer.launch(env.BROWSER_RENDERING)
Create new pageawait browser.newPage()
Navigate to URLawait page.goto(url)
Get HTML contentawait page.content()
Extract textawait page.$eval("selector", el => el.textContent)
Take screenshotawait page.screenshot({type: "png"})
Generate PDFawait page.pdf({format: "A4"})
Close browserawait browser.close()

Basic Page Scraping

import puppeteer from "@cloudflare/puppeteer";

interface Env {
  BROWSER_RENDERING: Fetcher;
}

export default {
  async fetch(request, env): Promise<Response> {
    const { searchParams } = new URL(request.url);
    let url = searchParams.get("url");

    if (url) {
      url = new URL(url).toString(); // normalize
      const browser = await puppeteer.launch(env.BROWSER_RENDERING);
      const page = await browser.newPage();
      await page.goto(url);

      // Parse the page content
      const content = await page.content();

      // Find text within the page content
      const text = await page.$eval("body", (el) => el.textContent);

      // Do something with the text
      // e.g. log it to the console, write it to KV, or store it in a database.
      console.log(text);

      // Ensure we close the browser session
      await browser.close();

      return Response.json({
        bodyText: text,
      });
    } else {
      return Response.json({
        error: "Please add an ?url=https://example.com/ parameter"
      }, { status: 400 });
    }
  },
} satisfies ExportedHandler<Env>;

Screenshot Capture

Capture screenshots of web pages as PNG or JPEG:

import puppeteer from "@cloudflare/puppeteer";

interface Env {
  BROWSER_RENDERING: Fetcher;
}

export default {
  async fetch(request, env): Promise<Response> {
    const { searchParams } = new URL(request.url);
    const url = searchParams.get("url");

    if (!url) {
      return new Response("Missing ?url parameter", { status: 400 });
    }

    const browser = await puppeteer.launch(env.BROWSER_RENDERING);
    try {
      const page = await browser.newPage();

      // Set viewport size
      await page.setViewport({ width: 1920, height: 1080 });

      await page.goto(url, { waitUntil: "networkidle0" });

      // Capture screenshot
      const screenshot = await page.screenshot({
        type: "png",
        fullPage: true, // Capture entire page
      });

      return new Response(screenshot, {
        headers: { "Content-Type": "image/png" },
      });
    } finally {
      await browser.close();
    }
  },
} satisfies ExportedHandler<Env>;

PDF Generation

Convert web pages to PDF documents:

import puppeteer from "@cloudflare/puppeteer";

interface Env {
  BROWSER_RENDERING: Fetcher;
}

export default {
  async fetch(request, env): Promise<Response> {
    const { searchParams } = new URL(request.url);
    const url = searchParams.get("url");

    if (!url) {
      return new Response("Missing ?url parameter", { status: 400 });
    }

    const browser = await puppeteer.launch(env.BROWSER_RENDERING);
    try {
      const page = await browser.newPage();
      await page.goto(url, { waitUntil: "networkidle0" });

      // Generate PDF
      const pdf = await page.pdf({
        format: "A4",
        printBackground: true,
        margin: {
          top: "20px",
          right: "20px",
          bottom: "20px",
          left: "20px",
        },
      });

      return new Response(pdf, {
        headers: { "Content-Type": "application/pdf" },
      });
    } finally {
      await browser.close();
    }
  },
} satisfies ExportedHandler<Env>;

Browser Lifecycle Management

CRITICAL: Always close the browser after use to prevent memory leaks and ensure resources are freed:

const browser = await puppeteer.launch(env.BROWSER_RENDERING);
try {
  const page = await browser.newPage();
  // ... perform operations
} finally {
  // Always close, even if an error occurs
  await browser.close();
}

Best practices:

  1. Use try/finally to ensure cleanup
  2. Close browser even if operations fail
  3. Each request should launch and close its own browser
  4. Don't reuse browser instances across requests
  5. Set reasonable timeouts to prevent hanging

DOM Manipulation and Extraction

Extract structured data from pages:

const browser = await puppeteer.launch(env.BROWSER_RENDERING);
try {
  const page = await browser.newPage();
  await page.goto(url);

  // Extract multiple elements
  const data = await page.evaluate(() => {
    return {
      title: document.querySelector("h1")?.textContent,
      links: Array.from(document.querySelectorAll("a")).map(a => ({
        text: a.textContent,
        href: a.href,
      })),
      images: Array.from(document.querySelectorAll("img")).map(img => img.src),
    };
  });

  return Response.json(data);
} finally {
  await browser.close();
}

Wait Strategies

Wait for content to load before scraping:

const page = await browser.newPage();
await page.goto(url);

// Wait for specific selector
await page.waitForSelector(".content-loaded");

// Wait for navigation with options
await page.goto(url, {
  waitUntil: "networkidle0", // Wait until network is idle
  timeout: 30000, // 30 second timeout
});

// Wait for custom condition
await page.waitForFunction(() => {
  return document.querySelector(".dynamic-content") !== null;
});

Error Handling

Handle common browser automation errors:

const browser = await puppeteer.launch(env.BROWSER_RENDERING);
try {
  const page = await browser.newPage();

  // Set timeout for navigation
  await page.goto(url, { timeout: 30000 });

} catch (error) {
  if (error.name === "TimeoutError") {
    return new Response("Page load timeout", { status: 504 });
  }

  console.error("Browser error:", error);
  return new Response("Browser automation failed", { status: 500 });

} finally {
  await browser.close();
}

Puppeteer vs Playwright

FeaturePuppeteerPlaywright
API StyleChrome DevTools ProtocolHigher-level abstractions
Test AssertionsManualBuilt-in expect()
DebuggingConsole logsTrace files with GUI
Storage PersistenceManualBuilt-in storage state API
MCP IntegrationNoYes (for AI agents)

Choose Puppeteer if: You have existing scripts or prefer Chrome DevTools Protocol.

Choose Playwright if: Starting new, need test assertions, want better debugging, or building AI agents.

See references/puppeteer.md for complete Playwright-specific features including test assertions, trace files, and storage state patterns

Detailed References

Best Practices

General

  1. Choose the right method: REST API for simple tasks, Workers Bindings for complex automation
  2. Always close browsers: Use try/finally to ensure browser.close() is called (Workers Bindings only)
  3. Monitor usage: Check X-Browser-Ms-Used header (REST) or dashboard for browser time consumed
  4. Set timeouts: Prevent hanging requests with reasonable timeout values
  5. Handle errors gracefully: Catch TimeoutError and 429 rate limit errors
  6. Test locally first: Use wrangler dev to iterate before deploying

Workers Bindings Specific

  1. Reuse sessions: Keep browsers open with keep_alive option (up to 10 minutes) for better performance
  2. Use waitUntil options: Wait for appropriate page state (networkidle0, load, domcontentloaded)
  3. Consider caching: Cache static screenshots/PDFs in R2 or KV
  4. Respect robots.txt: Check site policies before automated scraping
  5. Check session history: Use playwright.history() or puppeteer.history() to debug idle timeouts

REST API Specific

  1. Spread requests evenly: Rate limits are per-second, not burst (e.g., 6/min = 1 per 10 seconds)
  2. Handle 429 responses: Read Retry-After header and retry appropriately
  3. Use AI endpoints: /json and /markdown endpoints use AI for structured extraction

Common Patterns

See references/patterns.md for complete examples including:

  • Session reuse and keep-alive for performance
  • Authentication with custom headers
  • Custom user agents
  • Caching screenshots in R2
  • Rate limiting with Durable Objects

平台分布

Codex

37.41%
按下载量换算51

Claude

30.39%
按下载量换算41

Cursor

18.21%
按下载量换算25

Gemini CLI

9.07%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills