Skip to content

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

removed checking of all subframes

Gregor Žuničeb41cb577de9
diff --git a/browser_use/browser/service.py b/browser_use/browser/service.py
index a755ae4ae..184135aa2 100644
--- a/browser_use/browser/service.py
+++ b/browser_use/browser/service.py
@@ -202,23 +202,6 @@ class Browser:
logger.warning('Page load failed, continuing...')
pass
- # Wait for all frames to load
- async def wait_for_frame_and_subframes(frame):
- try:
- await frame.wait_for_load_state('domcontentloaded', timeout=5_000)
- except Exception:
- logger.warning('Frame load failed, continuing...')
- pass
-
- # Recursively wait for all child frames
- for child_frame in frame.child_frames:
- await wait_for_frame_and_subframes(child_frame)
-
- # Wait for main page frames and their subframes
- frames = page.frames
- for frame in frames:
- await wait_for_frame_and_subframes(frame)
-
# Calculate remaining time to meet minimum WAIT_TIME
elapsed = time.time() - start_time
remaining = max((timeout_overwrite or self.MINIMUM_WAIT_TIME) - elapsed, 0)