codex - 💡(How to fix) Fix Browser Use cannot inspect, screenshot, or click visible cross-origin iframe content in Codex app [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#21144Fetched 2026-05-06 06:26:00
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

In the Codex app, Browser Use with the in-app browser (iab) can attach to the selected tab and inspect the parent page, but cannot operate on the visible content when the meaningful app surface is inside a cross-origin iframe.

This caused a Browser Use task to become impossible without changing the page or using a non-Browser-Use workaround. The agent could see the parent page and the iframe element, but could not inspect the iframe DOM, could not click into the iframe, and screenshot capture returned the Codex shell/sidebar rather than the actual browser viewport.

Error Message

Timed out after 3000ms waiting for selector iframe >> internal:control=enter-frame >> body: Browser Use encountered an error interacting with this webpage: Error: No element matched selector

Root Cause

This is a Codex/Browser Use issue because the failure is in the browser-control surface, not the website logic:

  • The parent page rendered and exposed the iframe.
  • The iframe was visible and active.
  • Browser Use explicitly reported that cross-origin/inaccessible iframe targets are not currently supported.
  • Screenshot capture did not capture the selected browser content, so Browser Use could not fall back to visual control.

The practical result is that agents fall back to scripts, source inspection, or direct runner URLs instead of using the built-in browser, which is exactly the behavior Browser Use is intended to avoid.

Fix Action

Fix / Workaround

This caused a Browser Use task to become impossible without changing the page or using a non-Browser-Use workaround. The agent could see the parent page and the iframe element, but could not inspect the iframe DOM, could not click into the iframe, and screenshot capture returned the Codex shell/sidebar rather than the actual browser viewport.

Unable to translate Input.dispatchMouseEvent in the in-app browser: Input targets inside cross-origin or inaccessible iframes are not currently supported in the in-app browser
waiting on click for selector iframe[title="Vibe Runner"]

Code Example

{
  "ok": true,
  "title": "Ultimate Tic-Tak-Toe | Vibecodr Player",
  "url": "https://vibecodr.space/player/110503ee-044c-43e2-ab0d-ea8235f08b04"
}

---

- heading "Ultimate Tic-Tak-Toe" [level=1]
- generic "Dedicated cross-origin sandbox on vxbe.space keeps the runtime isolated from the main Vibecodr app."
- text: Dedicated sandbox
- iframe [active]
- button "Restart vibe"
- button "Stop vibe"
- generic: Running

---

{
  "count": 1,
  "attrs": {
    "title": "Vibe Runner",
    "class": "block w-full h-full border-0 bg-transparent h-full w-full border-0",
    "sandbox": "allow-scripts allow-forms allow-modals allow-pointer-lock allow-orientation-lock allow-presentation allow-same-origin",
    "allow": "fullscreen"
  }
}

---

{
  "htmlCount": 0,
  "rootCount": 0,
  "anyCount": 0,
  "buttons": 0
}

---

Timed out after 3000ms waiting for selector iframe >> internal:control=enter-frame >> body: Browser Use encountered an error interacting with this webpage: Error: No element matched selector

---

Unable to translate Input.dispatchMouseEvent in the in-app browser: Input targets inside cross-origin or inaccessible iframes are not currently supported in the in-app browser
waiting on click for selector iframe[title="Vibe Runner"]

---

await tab.cua.get_visible_screenshot()
await tab.playwright.screenshot({ fullPage: false })

---

Unknown command: tab_content_export
RAW_BUFFERClick to expand / collapse

Summary

In the Codex app, Browser Use with the in-app browser (iab) can attach to the selected tab and inspect the parent page, but cannot operate on the visible content when the meaningful app surface is inside a cross-origin iframe.

This caused a Browser Use task to become impossible without changing the page or using a non-Browser-Use workaround. The agent could see the parent page and the iframe element, but could not inspect the iframe DOM, could not click into the iframe, and screenshot capture returned the Codex shell/sidebar rather than the actual browser viewport.

Environment / Context

  • Product surface: Codex desktop app / in-app browser
  • Browser Use backend: iab
  • Current tab URL: https://vibecodr.space/player/110503ee-044c-43e2-ab0d-ea8235f08b04
  • Page title reported by Browser Use: Ultimate Tic-Tak-Toe | Vibecodr Player
  • Meaningful app content is embedded in a cross-origin iframe: https://c-f405ee78-99b0-4ed2-a897-e1d00bb0d44c-rt.vxbe.space/__vibecodr/frame?artifactId=41bc68d9-351e-4c86-be84-7fe6b52c98d3
  • The user explicitly required preserving the current page, not opening the iframe directly, not reading source code, not changing settings, and not navigating away.

What Worked

Browser Use successfully attached to the selected in-app browser tab:

{
  "ok": true,
  "title": "Ultimate Tic-Tak-Toe | Vibecodr Player",
  "url": "https://vibecodr.space/player/110503ee-044c-43e2-ab0d-ea8235f08b04"
}

The parent DOM exposed the player shell and iframe:

- heading "Ultimate Tic-Tak-Toe" [level=1]
- generic "Dedicated cross-origin sandbox on vxbe.space keeps the runtime isolated from the main Vibecodr app."
- text: Dedicated sandbox
- iframe [active]
- button "Restart vibe"
- button "Stop vibe"
- generic: Running

Iframe attributes were visible from the parent page:

{
  "count": 1,
  "attrs": {
    "title": "Vibe Runner",
    "class": "block w-full h-full border-0 bg-transparent h-full w-full border-0",
    "sandbox": "allow-scripts allow-forms allow-modals allow-pointer-lock allow-orientation-lock allow-presentation allow-same-origin",
    "allow": "fullscreen"
  }
}

What Failed

1. Browser Use could not enter the iframe DOM

frameLocator('iframe') and frameLocator('iframe[title="Vibe Runner"]') did not expose the iframe document/content:

{
  "htmlCount": 0,
  "rootCount": 0,
  "anyCount": 0,
  "buttons": 0
}

A scoped body lookup failed with:

Timed out after 3000ms waiting for selector iframe >> internal:control=enter-frame >> body: Browser Use encountered an error interacting with this webpage: Error: No element matched selector

2. Browser Use could not click into the visible iframe

Clicking the visible iframe itself failed before the click reached the app:

Unable to translate Input.dispatchMouseEvent in the in-app browser: Input targets inside cross-origin or inaccessible iframes are not currently supported in the in-app browser
waiting on click for selector iframe[title="Vibe Runner"]

3. Browser Use screenshots captured the Codex shell, not the browser page

Both screenshot APIs returned an image of the Codex desktop shell/sidebar rather than the visible in-app browser content:

await tab.cua.get_visible_screenshot()
await tab.playwright.screenshot({ fullPage: false })

This removed the normal visual fallback path. Even if DOM access is intentionally blocked by cross-origin iframe boundaries, a screenshot of the actual visible browser viewport plus coordinate clicks would have allowed the agent to proceed.

4. Browser Use page export command was unavailable

Trying the content export fallback failed with:

Unknown command: tab_content_export

Expected Behavior

For Browser Use in the Codex app, at least one of these should work reliably:

  1. Attach directly to the visible cross-origin iframe as the active Browser Use target without changing the user's current page.
  2. Forward coordinate clicks into visible iframe content from the parent page.
  3. Capture screenshots of the actual in-app browser viewport, including cross-origin iframe pixels, so visual reasoning and coordinate interaction can work.
  4. Provide a clear documented capability error and recovery path when cross-origin iframe interaction is unsupported.

Actual Behavior

Browser Use attached to the parent tab but could not inspect, screenshot, or interact with the meaningful app surface inside the iframe. Under a user requirement to preserve the current page and avoid direct iframe navigation/source inspection, the task became impossible through Browser Use.

Why this matters

This is a Codex/Browser Use issue because the failure is in the browser-control surface, not the website logic:

  • The parent page rendered and exposed the iframe.
  • The iframe was visible and active.
  • Browser Use explicitly reported that cross-origin/inaccessible iframe targets are not currently supported.
  • Screenshot capture did not capture the selected browser content, so Browser Use could not fall back to visual control.

The practical result is that agents fall back to scripts, source inspection, or direct runner URLs instead of using the built-in browser, which is exactly the behavior Browser Use is intended to avoid.

Suggested direction

A robust fix could be any of:

  • Add cross-origin iframe target selection/attachment for the in-app browser.
  • Add compositor-correct viewport screenshots for the actual selected browser pane.
  • Add coordinate mapping/click forwarding into visible iframe bounds, with appropriate safety gates.
  • Improve Browser Use diagnostics so the agent can tell the user immediately that the current visible iframe is not controllable and what action is needed.

extent analysis

TL;DR

The most likely fix involves enhancing Browser Use to handle cross-origin iframes by either allowing direct attachment, forwarding coordinate clicks, or capturing accurate screenshots of the in-app browser viewport.

Guidance

  1. Investigate iframe attachment: Enhance Browser Use to attach directly to visible cross-origin iframes without changing the user's current page, potentially by improving the frameLocator function.
  2. Implement click forwarding: Develop a mechanism to forward coordinate clicks into visible iframe content from the parent page, ensuring safety gates are in place to prevent unintended interactions.
  3. Improve screenshot capture: Modify the screenshot API to capture the actual in-app browser viewport, including cross-origin iframe pixels, to enable visual reasoning and coordinate interaction.
  4. Enhance diagnostics: Improve Browser Use diagnostics to provide clear capability errors and recovery paths when cross-origin iframe interaction is unsupported, guiding the user on necessary actions.

Example

No specific code example is provided due to the complexity and variability of potential solutions, but enhancements to frameLocator and screenshot capture functions are likely necessary.

Notes

The solution requires careful consideration of security implications, especially when interacting with cross-origin iframes, to prevent unintended access or actions.

Recommendation

Apply a workaround by enhancing Browser Use diagnostics to clearly indicate when cross-origin iframe interaction is unsupported and guide the user on alternative actions, while concurrently developing a more robust fix to handle cross-origin iframes directly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Browser Use cannot inspect, screenshot, or click visible cross-origin iframe content in Codex app [1 comments, 2 participants]