Skip to content

Commit 21d9893

Browse files
authored
Update index.mdx
updated content added output more explanation on how to use
1 parent 22d37ea commit 21d9893

File tree

1 file changed

+36
-14
lines changed
  • src/content/docs/browser-rendering/workers-binding-api

1 file changed

+36
-14
lines changed

src/content/docs/browser-rendering/workers-binding-api/index.mdx

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,49 @@ The Workers Binding API allows you to execute advanced browser rendering scripts
1111

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

14-
### Checking chromium version
14+
## Browser Rendering options
1515

16-
Choose one of the following options to confirm the Chromium version powering your rendering tasks:
16+
The following options are available for browser rendering tasks:
1717

18-
1. **Check directly in your browser**
18+
<DirectoryListing />
19+
20+
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.
1921

20-
Open Developer Tools in a full Chrome or Chromium browser instance. Navigate to `chrome://version` or open the menu > Help > About Google Chrome to view the exact version.
22+
### Chromium version
23+
Cloudflare Browser Rendering currently uses Chromium version 124.0.6367.257.
2124

22-
2. **Use `browser.version()` for automation tools like [Playwright](/browser-rendering/platform/playwright/) or [Puppeteer](/browser-rendering/platform/puppeteer/)**
25+
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/).
2326

24-
If you're using automation frameworks, you can programmatically retrieve the version:
27+
#### Using [Puppeteer](/browser-rendering/platform/puppeteer/)
2528

2629
```javascript
27-
const version = await browser.version();
28-
console.log("Chromium version:", version);
30+
const puppeteer = require('puppeteer');
31+
32+
(async () => {
33+
const browser = await puppeteer.launch();
34+
const version = await browser.version();
35+
console.log('Chromium version:', version);
36+
await browser.close();
37+
})().catch(console.error);
38+
```
39+
Example output
40+
```
41+
Chromium version: 136.0.7103.25
2942
```
3043

31-
## Browser Rendering options
32-
33-
The following options are available for browser rendering tasks:
34-
35-
<DirectoryListing />
44+
#### Using [Playwright](/browser-rendering/platform/playwright/)
3645

37-
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.
46+
```javascript
47+
const { chromium } = require('playwright');
48+
49+
(async () => {
50+
const browser = await chromium.launch();
51+
const version = await browser.version();
52+
console.log('Chromium version:', version);
53+
await browser.close();
54+
})().catch(console.error);
55+
```
56+
Example output
57+
```
58+
Chromium version: HeadlessChrome/123.0.6312.86
59+
```

0 commit comments

Comments
 (0)