Skip to content

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

faster scroll

mertunsall2e3aed30456c
diff --git a/browser_use/browser/watchdogs/default_action_watchdog.py b/browser_use/browser/watchdogs/default_action_watchdog.py
index 1af2f4b72..a698a3ef7 100644
--- a/browser_use/browser/watchdogs/default_action_watchdog.py
+++ b/browser_use/browser/watchdogs/default_action_watchdog.py
@@ -1793,14 +1793,14 @@ class DefaultActionWatchdog(BaseWatchdog):
# (opposite of mouseWheel deltaY convention)
y_distance = -pixels
- # Synthesize scroll gesture with faster speed
+ # Synthesize scroll gesture - use very high speed for near-instant scrolling
await cdp_client.send.Input.synthesizeScrollGesture(
params={
'x': center_x,
'y': center_y,
'xDistance': 0,
'yDistance': y_distance,
- 'speed': 1200, # pixels per second (faster than default 800)
+ 'speed': 50000, # pixels per second (high = near-instant scroll)
},
session_id=session_id,
)
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index 600611991..e5af4d1e1 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -846,7 +846,7 @@ You will be given a query and the markdown of a webpage that has been filtered t
completed_scrolls += 1
# Small delay to ensure scroll completes before next one
- await asyncio.sleep(0.3)
+ await asyncio.sleep(0.15)
except Exception as e:
logger.warning(f'Scroll {i + 1}/{num_full_pages} failed: {e}')