Skip to content

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

Refactor iframe dimension retrieval in DomService

Magnus Müller016a1709de0b
diff --git a/browser_use/dom/service.py b/browser_use/dom/service.py
index 03b600001..a29590ec7 100644
--- a/browser_use/dom/service.py
+++ b/browser_use/dom/service.py
@@ -649,8 +649,8 @@ class DomService:
# Check iframe dimensions
if dom_tree_node.snapshot_node and dom_tree_node.snapshot_node.bounds:
bounds = dom_tree_node.snapshot_node.bounds
- width = bounds.get('width', 0)
- height = bounds.get('height', 0)
+ width = bounds.width
+ height = bounds.height
# Only process if iframe is at least 200px in both dimensions
if width >= 200 and height >= 200: