OpenAICloudflare Developer PlatformMay 28, 2026, 12:00 AM

Browser Run - Use Browser Run Quick Actions directly from Workers

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Browser Run - Use Browser Run Quick Actions directly from Workers

Key Points

  • Call Quick Actions from Workers
  • No API tokens or external HTTP requests
  • Requires compatibility_date 2026-03-24+

Summary

Cloudflare Workers can now invoke Browser Run Quick Actions directly via the browser binding's quickAction() method. This removes the need for API tokens or external HTTP calls, reducing implementation complexity and latency by keeping traffic on Cloudflare's network.

Key Points

  • Add a browser binding to your Wrangler config (wrangler.toml or wrangler.jsonc) and set compatibility_date to 2026-03-24 or later.
    • Example (TOML): [ browser ] binding = "BROWSER"
  • Call the method directly from a Worker: await env.BROWSER.quickAction("screenshot", { url: "https://www.cloudflare.com/" }).
  • No API tokens or external HTTP requests required — calls run over Cloudflare's internal network.
  • Supported Quick Actions include:
    • screenshots, PDFs (custom styling, headers, footers)
    • extract HTML, convert to Markdown, extract structured JSON via AI
    • scrape elements with CSS selectors, get all links
    • capture snapshots (HTML + screenshot in a single request)
  • Keep your Worker compatibility date at or after 2026-03-24 to use quickAction().

Where to go next

  • Add the binding to your Wrangler config, update the compatibility date, and call env.BROWSER.quickAction(...) in your Worker. For full action options and parameters, see the Browser Run Quick Actions documentation.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Browser Run — Workers から直接 Browser Run Quick Actions を使用する

Browser Run — Workers から直接 Browser Run Quick Actions を使用する

公開日: 2026-05-28

概要

Cloudflare Worker の browser バインディング上で提供される quickAction() メソッドを使って、Worker から直接 Browser Run Quick Actions を呼び出せるようになりました。これにより API トークンや外部 HTTP リクエストが不要になり、Cloudflare のネットワーク経由で直接やり取りが行われるため、コードが簡潔になりレイテンシが低減します。

quickAction() でできること:

  • URL や HTML からスクリーンショットを取得
  • カスタムスタイル、ヘッダー、フッターを含む PDF を生成
  • 完全にレンダリングされたページから HTML コンテンツを抽出
  • ページを Markdown に変換
  • AI を使って構造化された JSON を抽出
  • CSS セレクタで要素をスクレイピング
  • ページ内のすべてのリンクを取得
  • スナップショット(HTML + スクリーンショットを1リクエストで取得)

セットアップ

Wrangler の設定に browser バインディングを追加します。

wrangler.jsonc

{
  "compatibility_date": "2026-03-24",
  "browser": {
    "binding": "BROWSER"
  }
}

wrangler.toml

compatibility_date = "2026-03-24"
[browser]
binding = "BROWSER"

Worker から Quick Action を呼び出す

任意の Quick Action を Worker から直接呼び出せます。例: スクリーンショットを取得する場合。

JavaScript

const screenshot = await env.BROWSER.quickAction("screenshot", {
  url: "https://www.cloudflare.com/",
});

TypeScript

const screenshot = await env.BROWSER.quickAction("screenshot", {
  url: "https://www.cloudflare.com/",
});

quickAction() メソッドは互換性日付 (compatibility date) を 2026-03-24 以降に設定することを要求します。

セットアップ手順や利用可能なアクションのフルリストについては Browser Run Quick Actions を参照してください。