Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix: allow cross-origin iframe targets with empty URLs through _is_valid_target()

Saurav Panda10b5d1cd8854
diff --git a/README.md b/README.md
index b54258bce..32fcf1ef7 100644
--- a/README.md
+++ b/README.md
@@ -34,8 +34,6 @@
<a href="https://link.browser-use.com/discord"><img src="https://media.browser-use.tools/badges/discord" alt="Discord"></a>
<img width="4" height="1" alt="">
<a href="https://cloud.browser-use.com"><img src="https://media.browser-use.tools/badges/cloud" height="48" alt="Browser-Use Cloud"></a>
-<img width="4" height="1" alt="">
-<a href="https://www.producthunt.com/products/browser-use?embed=true&amp;utm_source=badge-featured&amp;utm_medium=badge&amp;utm_campaign=badge-bu" target="_blank" rel="noopener noreferrer"><img alt="BU - Openclaw in the cloud | Product Hunt" width="250" height="54" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1087770&amp;theme=light&amp;t=1772349539172"></a>
</div>
</br>
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 7a7a3b8ca..6a2e43f88 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -3466,6 +3466,11 @@ class BrowserSession(BaseModel):
if target_type in ('iframe', 'webview') and include_iframes:
type_allowed = True
+ # Chrome often reports empty URLs for cross-origin iframe targets (OOPIFs)
+ # initially via attachedToTarget, but they are still valid and accessible via CDP.
+ # Allow them through so get_all_frames() can resolve their frame trees.
+ if not url:
+ url_allowed = True
return url_allowed and type_allowed