Catalog / Cloudflare Developer Platform
Browser Run - Browser Run adds session and DevTools methods to browser bindings
Browser Run browser bindings now provide typed methods for session management and DevTools operations. You can acquire a session, connect a browser client, create Live View URLs, manage targets, and close sessions without constructing HTTP requests.
The new acquire() and launch() methods also accept outboundByHost. This lets you route requests for selected hostnames through another Worker, including a Worker that adds authentication or reaches a private service.
const connection = await env.BROWSER.launch({
outboundByHost: {
"private.example.test": env.OUTBOUND,
},
});const connection = await env.BROWSER.launch({
outboundByHost: {
"private.example.test": env.OUTBOUND,
},
});
Use connectSession(sessionId) when you need to acquire and connect in separate steps. The method returns a session-pinned webSocket Fetcher for a CDP client.
The binding also includes session methods for Live View, active sessions, session history, limits, session details, and cleanup. The nested devtools binding provides typed methods for browser version information, protocol descriptions, and target operations such as listing, creating, activating, and closing targets.
Refer to the Browser binding API documentation for method signatures and the outbound Worker feature guide for routing examples.