BlogResearchturno-browser

Moving the agent cursor out of the page

In turno-browser 0.7.0 the agent cursor was an element drawn into each page; since 0.11.0 the default asks Chrome to draw a highlight and a click ripple above the page, so the cursor adds nothing to it. The highlight is a rectangle because, as a code comment records, Chrome 158 did not paint a node highlight into the live view's frames, and that rectangle is what the 0.12.1 Retina fix corrected.

5 min read

View sourceFeed

When someone can see the browser, turno-browser shows where the agent acts. The first version, in 0.7.0, drew it inside each page. Since 0.11.0 the default asks Chrome to draw it, and the cursor adds nothing to the page. This post is about that move, and about one choice in it that a later release had to correct.

The cursor in the page

turno-browser 0.7.0 added the agent cursor: an arrow with the agent's name and the identity that glides to each element the agent acts on, a ring on the target, a ripple for each click, a typing bubble by a field, and a thin frame with a badge around the page while calls run. Several sessions on one identity's Chrome each get a cursor and a color of their own.

The cursor in the page, as the docs show it: two sessions on one identity.
The cursor in the page, as the docs show it: two sessions on one identity.

It was built to stay out of the model's way. Everything it draws lives in a closed shadow root on one host element under <html>, as the comment at the top of the file says:

packages/browser/src/agent-cursor-overlay.tsTypeScript
 * What it draws lives in a closed shadow root on one host element under `<html>` (never in
 * `<body>`, so `document.body.innerText` never holds it). The host is `aria-hidden` and `inert`
 * (out of the accessibility tree, so out of every snapshot), `pointer-events: none` (never a
 * target of a click or of `elementFromPoint`, so Playwright's hit test and "covered" check see
 * through it) and `position: fixed` with `contain: strict` (no layout, no scroll of its own).

It is also hidden while browser_take_screenshot runs. The person watching sees the cursor; snapshots, screenshots and clicks do not.

That kept the cursor away from the model. It did not keep it out of the page. The host element is still a node in the site's document, next to <head> and <body>: one element the site did not build.

Asking Chrome to draw it

turno-browser 0.11.0 changed what the default, cursor: "auto", draws. When the browser can be seen (Chrome has a window, or the live view is on), turno-browser opens a DevTools protocol session on the page and asks Chrome for its own highlight on the element the agent acts on and its own ripple where each click lands:

packages/browser/src/agent-cursor-cdp.tsTypeScript
        try {
          const cdp = await page.context().newCDPSession(page);
          await cdp.send("DOM.enable");
          await cdp.send("Overlay.enable");
          // Chrome 158's experimental ripple; an older Chrome still gets the highlight.
          const send = cdp.send.bind(cdp) as (method: string, params?: object) => Promise<unknown>;
          await send("Page.setInputVisualization", { clicks: true }).catch(() => {});
          return { cdp, box: null, tone: "agent" as Tone, outline: false };
        } catch {
          return false;
        }

Both are painted by the browser above the page, like the boxes of Chrome's DevTools. The cursor inserts nothing, so it leaves the page's DOM and layout as they would be without it. That is true of the cursor only; other features still act in the page, such as the passkey watch, which wraps navigator.credentials on a sign-in page while the agent acts on it. The box is taken down while the model's screenshot is taken and drawn again after it. When Chrome refuses the protocol calls, the session is false and the cursor in the page is drawn instead.

In 0.11.0 the box was always turno's blue. turno-browser 0.12.0 gave it the color of the action: blue for a click, violet while the agent types, red for a moment when the call fails, and amber while the browser waits for the person.

cursorWhat is drawnWhat the cursor adds to the page
auto (default)Chrome's highlight and click ripple, when the browser can be seennothing (the on element when Chrome refuses the protocol calls)
onthe named arrow, the ring, the ripple, the typing bubble, the frame and the badgeone element, turno-agent-cursor, with a closed shadow root
offnothingnothing

A rectangle, not a node

Chrome's overlay can highlight a DOM node (Overlay.highlightNode) or a rectangle given by its coordinates (Overlay.highlightRect). turno-browser draws a rectangle. The comment at the top of the file, from commit c2a8cbc (2026-11-26 UTC), records why; it does not say how this was measured:

packages/browser/src/agent-cursor-cdp.tsTypeScript
 * Measured on Chrome 158: `Overlay.highlightNode` is not painted into screencast frames, so the
 * live view would not show it; `highlightRect` is, which is why the box is drawn as a rectangle.

The rectangle has two costs. The first is in the docs: the box is drawn at the element's place, and if the page moves under it during the action, the box stays where the element was.

The second was fixed in 0.12.1. 0.11.0 and 0.12.0 sent the CSS box as it was, so on a Retina screen it landed at twice its place; the highlight that landed at twice its place has the measurement and the fix in 0.12.1.

What the default does not show

The default draws less than the cursor in the page. There is no arrow with the agent's name, no frame around the page while calls run, no badge and no typing bubble, and, as a comment added in 0.12.0 (a41a13e) notes, Chrome draws one highlight at a time, so each replaces the last. With several agents in one browser, a box in the default mode does not say whose it is. Those parts are still there with cursor: "on", at the price of the element in the page.

The comment from c2a8cbc records, for Chrome 158, that the ripple is painted into screencast frames and screenshots alike; turno-browser does not hide it.

The ripple needs Chrome 158 or later; an older Chrome gets the highlight without it. Nothing is drawn in read mode, which lays out no page.

Sources

The change to Chrome's highlight is commit c2a8cbc.