Skip to content

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

Remove highlights before action

magmuellerfcbd9a8cd7d8
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index a8a40f703..14f7da990 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -185,6 +185,8 @@ class Controller:
try:
for action_name, params in action.model_dump(exclude_unset=True).items():
if params is not None:
+ # remove highlights
+ await self.browser.remove_highlights()
result = await self.registry.execute_action(
action_name, params, browser=self.browser
)