CF-Incidents Browser Run - Use Browser Run Quick Actions directly from Workers

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
You can now call Browser Run Quick Actions directly from a Cloudflare Worker using the quickAction() method on the browser binding. This simplifies how Workers interact with Browser Run by removing the need for API tokens or external HTTP requests. Your Worker communicates with Browser Run directly over Cloudflare's network, resulting in simpler code and lower latency.

With the quickAction() method you can:


To get started, add a browser binding to your Wrangler configuration:


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

Code:
compatibility_date = "2026-03-24"

[browser]
binding = "BROWSER"

Then call any Quick Action directly from your Worker. For example, to capture a screenshot:


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

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

The quickAction() method requires a compatibility date of 2026-03-24 or later.

For setup instructions and the full list of available actions, refer to Browser Run Quick Actions.

Continue reading...
 
Back
Top