Skip to content

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

Remove Remove_highlights only use it before we screenshot

Magnus Müller3ae32e509229
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 7d586cce4..f8ce9fbeb 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1381,12 +1381,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):
cached_selector_map = await self.browser_session.get_selector_map()
cached_path_hashes = {e.hash.branch_path_hash for e in cached_selector_map.values()}
- try:
- await self.browser_session.remove_highlights()
- except TimeoutError:
- # we don't care if this times out
- self.logger.debug('Timeout to remove highlights')
-
for i, action in enumerate(actions):
# DO NOT ALLOW TO CALL `done` AS A SINGLE ACTION
if i > 0 and action.model_dump(exclude_unset=True).get('done') is not None: