Repository navigation
Description
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:
- Attach directly to the visible cross-origin iframe as the active Browser Use target without changing the user's current page.
- Forward coordinate clicks into visible iframe content from the parent page.
- Capture screenshots of the actual in-app browser viewport, including cross-origin iframe pixels, so visual reasoning and coordinate interaction can work.
- 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.
Activity
github-actions commentedon May 5, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
theophanemayaud commentedon Jun 11, 2026
Same here, it's a bummer cuz some test logins I use depend on that. Back to being a button pusher so the agent can continue its work properly 🤦
webtoots commentedon Sep 17, 2026
Reproduced on Windows 10.0.26200.9445 with Codex Desktop 26.911.7940.0 and the in-app browser.
Target: Microsoft Power Apps Studio 3.26091.9.381733538. The Studio UI is hosted in a cross-origin
EmbeddedStudioiframe.Observed:
count=1,visible=true, andenabled=true.force: trueclick all fail withClick target is no longer available.Impact:
This blocks live Power Apps authoring and visual QA in Codex, even though Canvas Authoring MCP synchronization and compilation work. Manual intervention is required for every Studio navigation step.
Please investigate recent changes to cross-origin iframe target lifetime and click forwarding in the in-app browser.
sashalab commentedon Oct 7, 2026
Additional reproduction on macOS, Codex Desktop 26.930.61225 (build 13232), in-app browser
iab. This looks particularly close to the Power Apps report above: DOM/AX inspection finds the control, but clicking it fails withClick target is no longer available.The real-world case was an embedded ONLYOFFICE editor on a different subdomain of the same site. However, ONLYOFFICE is not required to reproduce this: a plain HTML button in a local iframe is sufficient.
Narrowed reproduction
127.0.0.1parent →localhostchild)127.0.0.1on two different ports)Click target is no longer availableOrigin-Agent-Cluster: ?1on the child originThe failing baseline still failed when retested after the successful header experiment. Both AX-based clicking and a frame-scoped Playwright locator exposed through Browser Use reproduced the failure.
Diagnostic evidence
Inspection of the installed
browser-service.mjspoints to the input guard resolving a child frame's node in the target root frame's isolated-world execution context (browser-use-input-guard), rather than the node's owning frame context.A read-only CDP experiment on the minimal local page confirmed the relevant distinction for the same child button backendNodeId:
DOM.resolveNodewith the top frame's isolated-worldexecutionContextIdreturned{type: "object", subtype: "null", value: null}.executionContextIdreturned anHTMLButtonElementremote object.That is consistent with the guard reporting a missing/stale node even though the node still exists. A possible upstream fix is to make the guard's context selection frame-aware for same-process cross-origin frames, while retaining its existing input/shadow-root checks.
The real editor also produced
Keyboard focus root is no longer availablefor some operations. I have not isolated that keyboard symptom as completely: entering the local child frame with Tab and then typing worked. The reliable minimal failure here is clicking.Local workaround and limits
Adding
Origin-Agent-Cluster: ?1only to the child origin made both click and targeted input work in a fresh local test tab. No Codex installation files were patched. This is a tested local workaround, not yet production validation for ONLYOFFICE and not a universal guarantee of separate browser processes. See Chromium's Origin-Agent-Cluster documentation.Self-contained reproduction
Save the following as
probe.py(Python standard library only). Use fresh, independent IAB tabs and different port pairs for the two runs:Ask Browser Use to click
Test buttoninsideiframe#otherport. With the documented frame locator API, the action is:Expected: the button changes to
Clicked. The baseline fails before the click reaches the button; the child-header variant works in the tested build.probe.py
Posting the additional evidence here rather than opening a duplicate.