Skip to content

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

Adjust intersection logic in DomService to extend vertical bounds by 1000 pixels for improved frame detection.

Magnus Müllerc1ea8ffa3688
diff --git a/browser_use/dom/service.py b/browser_use/dom/service.py
index dfa8245d0..c00b1edcb 100644
--- a/browser_use/dom/service.py
+++ b/browser_use/dom/service.py
@@ -235,8 +235,8 @@ class DomService:
frame_intersects = (
adjusted_x < viewport_right
and adjusted_x + current_bounds.width > viewport_left
- and adjusted_y < viewport_bottom
- and adjusted_y + current_bounds.height > viewport_top
+ and adjusted_y < viewport_bottom + 1000
+ and adjusted_y + current_bounds.height > viewport_top - 1000
)
if not frame_intersects: