/plushcap/analysis/cloudflare/browser-rendering-open-beta

Workers Browser Rendering API enters open beta

What's this blog post about?

Cloudflare Workers introduces Browser Rendering APIs that allows developers to programmatically control a headless Chrome browser instance running within their Worker. This enables developers to create applications like screenshotting websites, testing web software in CI, or gathering page load performance metrics of their applications with ease. The API provides low-level access to the DevTools Protocol and Puppeteer API allowing for complex manipulations on a live Chrome browser instance within the worker environment. It also supports other Cloudflare products like Durable Objects for reusing browser instances, Queues for handling jobs asynchronously, R2 for storing data, and KV store to cache data. To use Browser Rendering API, developers need to create a new project using wrangler generate, add the Puppeteer library dependency in their package.json file, configure the binding in wrangler.toml configuration file and write the worker code in src/index.ts file. After that, they can test their worker locally by running npx wrangler dev –remote command and publish it to production using npx wrangler publish command. The Workers Browser Rendering API is currently in open beta and will be enabled for customers in the wait list gradually with emails being sent out. Cloudflare also plans to upstream changes in their Puppeteer fork to the main project, support other browser instrumentalization libraries like Playwright, and keep an eye on WebDriver BiDi standard for future integration. Overall, this API provides a powerful toolset for developers to build sophisticated applications with ease using Workers and other Cloudflare products.

Company
Cloudflare

Date published
May 19, 2023

Author(s)
Celso Martinho

Word count
1329

Hacker News points
4

Language
English


By Matt Makai. 2021-2024.