Skip to content

We need an API for modifying an existing iframe and webview #1898

Backlog

Description

@nedtwigg

It's currently not possible for an agent to navigate a browser or iframe to somewhere else. This is a common useful case. We either need to add this capability or at least make it easier to "swap", delete the existing and reopen a new in that spot.

Activity

  1. dormouse-bot commented on Nov 28, 2026

    @dormouse-bot
    Collaborator

    Navigating in place looks like the smaller change, since the pane already does it. Every browser renderer registers a screen controller whose chromeActions.navigate(url) is what the header's URL bar calls on Enter (SurfacePaneHeader.tsx#L89-L91). The iframe commits the URL and reloads (IframePanel.tsx#L396). The webview calls host.navigate, or queues the URL while the view is still opening (WebviewPanel.tsx#L279-L284). So a control method such as surface.navigate { surface, url } could look up the target's screen controller and call that same action. The URL would pass through the same browserSurfaceUrl check that surface.iframe and surface.webview use. The Surface id, its spot in the layout, and its render mode would all stay the same.

    What exists today:

    • agent-browser panes can already be pointed at a new page: dor agent-browser --surface surface:N open <url> drives the session bound to that Surface.
    • iframe and webview panes have no dor path. dor iframe and dor webview only open new panes, and --from replaces only an untouched terminal. docs/specs/dor-browser.md → "Placement And Lifetime" says Never replace a reference that already has a browser. So dor kill followed by dor iframe --from <neighbour> splits next to the neighbour instead of reusing the closed pane's spot.

    The "swap" option would conflict with that spec rule and with I10 (a replacement is a new Surface, so the agent's handle would change). Navigating in place keeps the handle, which suits an agent that is reusing one pane.

    Two choices need a maintainer:

    1. CLI shape. A standalone dor navigate <surface> <target> that works on any browser Surface (and hands agent-browser panes to their provider), or a --surface <handle> flag on dor iframe / dor webview that navigates instead of opening.
    2. Render mode on mismatch. If the target is a webview and the agent runs dor iframe --surface, should the pane stay a webview or switch to an iframe?

    Once the shape is settled I can implement it with its dor-cli.md / dor-browser.md changes.

  2. added
    enhancement
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions