#2153

snapshot: Iframe nodes show no name or title, so a content frame cannot be told from an empty helper frame

Openbundyfxopened 11d ago

In a snapshot, an Iframe node carries only its ref. Its name, title and src are not shown, so an agent has no way to tell a content frame from an empty helper frame without switching into each one.

Repro (0.39.1)

<!-- index.html -->
<iframe name="relabaseframe" src="/menu.html" style="width:1200px;height:650px"></iframe>
<!-- menu.html -->
<a href="/uren.html" target="contentframe">Urenregistratie</a>
<iframe name="contentframe" src="/home.html"></iframe>
agent-browser open http://localhost:8791/index.html
agent-browser snapshot -i
- Iframe [ref=e1]
  - link "Urenregistratie" [ref=e5]
  - Iframe [ref=e4]

Both frames have a name, and neither name appears.

Why it matters

We drive a legal practice-management web app built from same-origin frames. Its main screen holds three nested Iframe nodes next to each other. One is the content frame. The others are helper frames that stay empty, so frame @eN into them returns (no interactive elements) and get text body returns nothing.

An agent that picks the wrong one concludes the page has no results. In our run, the search results were on screen and visible in a screenshot while the agent sat in a helper frame. Telling the frames apart took get attr @eN name on each one, or a screenshot.

Suggestion

Print what the element already has on the Iframe line, for example:

- Iframe "contentframe" [ref=e4]
- Iframe [ref=e9, hidden]

That means the name (or title) attribute as the node's name, plus a marker when the frame has no layout box or is display:none. The src path would help too, but it can carry query strings with tokens, so leaving it out by default seems safer.

Related: #1784 (nested frames), #1831 (presentational iframes).

Activity

1
Ehsan-hash11d ago

I'll work on a narrow fix with agent assistance: preserve an existing iframe title/accessibility name and show its name when no label is available, so content and helper frames can be distinguished. I'll reproduce it through an isolated real Chrome/CLI session and check ref operations and anonymous frames. Frame URLs will stay out of the output; hidden-frame markers are outside this patch.