browser-agent template runs a Chromium browser and a graphical desktop, and Celesto gives you two short-lived connections to them:
- A browser connection: a Chrome DevTools Protocol (CDP) WebSocket URL. Connect Playwright or Puppeteer to it and drive the browser from your own code.
- A display connection: a VNC-over-WebSocket URL for the computer’s screen. Watch an agent work, or take over the mouse and keyboard.
Before you start
- Create the computer from the
browser-agenttemplate. Computers created from other templates have no browser or display. - Authenticate with
celesto auth login, or setCELESTO_API_KEYto an API key from Settings → Security in the console. - Install Playwright to drive the browser:
pip install playwrightornpm i playwright.
Drive the browser with Playwright
Request a browser connection, then connect Playwright to its CDP URL. Reuse the browser’s existing page when it has one.The connection expires at
expires_at. If Playwright cannot connect, request a new connection and try again.Watch or control the desktop
From the console
Open Computers in the Celesto console and select Display on a runningbrowser-agent computer. The live view opens read-only. Switch to read-write to use the mouse and keyboard.
From your own code
Request a display connection to embed the screen in your own tool. The URL is a VNC-over-WebSocket address for a viewer such as noVNC, not an HTML page you can open directly.read_only is enforced by the display service, so a viewer with a read-only URL cannot send input.
Troubleshooting
Related
- Publish ports to share a web app running inside the computer.
- Computer lifecycle to stop and start a computer between sessions.
