Live view and take control
Every running browser has a live view: its screen, as it is now, in a page of its own. Open the browser’s
liveUrl, or press Watch beside it on the dashboard’s Sessions page.
browser = client.browsers.create(timeout=30)print(browser.live_url) # https://…/live/…The live view starts by watching. Several people can watch one browser at once, and the view reconnects by itself
after a dropped connection. When the browser stops, it says so. With enableAudio: true on the create request, the
live view plays the browser’s sound.
Take control
Section titled “Take control”Press Take control to click and type in the browser yourself: to sign in with a one-time code or a passkey, to solve a CAPTCHA BrowserReal does not, or to get an agent past a step it is stuck on. Press Pass control back when you are done.
- One person at a time. While someone has control, the button says so for the others.
- Closing the tab passes control back, as does a view that loses its connection.
- Copy and paste work. Paste text from your clipboard into the browser, and copy text out of it, with your usual shortcuts (Cmd on a Mac).
- Turnstile is left to you. BrowserReal does not click a Cloudflare Turnstile checkbox while a person has control.
What your agent sees
Section titled “What your agent sees”While a person has control, the agent stays connected, and what it reads still works: it can attach to pages and receive their events. What would change the browser is refused, so that the agent and the person do not fight over it: input, navigation, opening, closing and focusing pages, running script in them, and changing the DOM, cookies, storage, window or permissions. Each such call fails at once with a CDP error:
A person has taken control of this browser in Datum's live view: agents' actions are refused until they pass control back. Try again shortly.In Playwright the call raises an error with that message. Nothing is queued: catch it and try the step again until control is passed back.
import asynciofrom playwright.async_api import Error
async def when_free(step, tries=60): """Runs step(), waiting while a person has control of the browser.""" for _ in range(tries): try: return await step() except Error as error: if "A person has taken control" not in str(error): raise await asyncio.sleep(5) raise TimeoutError("A person still has control of the browser")
await when_free(lambda: page.click("text=Continue"))An agent’s stop is refused as well while a person has control, even with "force": true: the response is the browser,
still active, with a stopRefused message. The dashboard’s Stop still stops it.
Share a watch-only link
Section titled “Share a watch-only link”The live view has a Watch-only link: a second address that shows the screen and takes no input. Share that one
with a colleague or a customer. Adding ?readOnly=true to a liveUrl leads to the same address:
https://…/live/…?readOnly=trueAdd ui=false to either address to leave out Chrome’s tabs and toolbar and show the page alone.
Keep the addresses secret
Section titled “Keep the addresses secret”Both addresses are made for one browser and stop working when it stops. In the dashboard, the live view is open to the members of your organization, and only those who may start and stop browsers can take control.