Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,56 @@ sidebar:
order: 2
---

import { DirectoryListing } from "~/components";
import { DirectoryListing, TabItem, Tabs } from "~/components";

The Workers Binding API allows you to execute advanced browser rendering scripts within Cloudflare Workers. It provides developers the flexibility to automate and control complex workflows and browser interactions. The following options are available for browser rendering tasks:
The Workers Binding API allows you to execute advanced browser rendering scripts within [Cloudflare Workers](/workers/). It provides developers the flexibility to automate and control complex workflows and browser interactions.

Browser Rendering allows developers to programmatically control and interact with a headless browser instance and create automation flows for their applications and products. Once configured, the service provides access to a WebSocket endpoint that speaks the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). This protocol is what allows Cloudflare to instrument a Chromium instance running in the Cloudflare global network.

## Browser Rendering options

The following options are available for browser rendering tasks:

<DirectoryListing />

Use the Workers Binding API when you need advanced browser automation, custom workflows, or complex interactions beyond basic rendering. For quick, one-off tasks like capturing screenshots or extracting HTML, the [REST API](/browser-rendering/rest-api/) is the simpler choice.

## Chromium version

Cloudflare Browser Rendering currently uses **Chromium version 124.0.6367.257**.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This info really shouldn't be on the current page (per my previous comment). Should either be a new page or a section on a new page.

Please apply to #22043 as well.


If you want to programmatically confirm the version in your environment, you can retrieve it using either [Puppeteer](/browser-rendering/platform/puppeteer/) or [Playwright](/browser-rendering/platform/playwright/).

<Tabs syncKey="workersExamples"> <TabItem label="Puppeteer">

```javascript
const puppeteer = require("puppeteer");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be
import puppeteer from "@cloudflare/puppeteer";


(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And should this be inside a worker fetch?
Like the code here: https://developers.cloudflare.com/browser-rendering/workers-binding-api/screenshots/#5-code

const browser = await puppeteer.launch();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this: const browser = await puppeteer.launch(env.MYBROWSER);

const version = await browser.version();
console.log("Chromium version:", version);
await browser.close();
})().catch(console.error);
```

</TabItem> <TabItem label="Playwright">

```javascript
const { chromium } = require("playwright");

(async () => {
const browser = await chromium.launch();
const version = await browser.version();
console.log("Chromium version:", version);
await browser.close();
})().catch(console.error);
```

</TabItem> </Tabs>

Example output

```
Chromium version: HeadlessChrome/123.0.6312.86
```
Loading