Skip to content

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

fixed the highlighting check logic

Saurav Panda151de628e039
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 716eec07e..a984ca74d 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -2527,7 +2527,7 @@ class BrowserSession(BaseModel):
async def remove_highlights(self) -> None:
"""Remove highlights from the page using CDP."""
- if not self.browser_profile.highlight_elements:
+ if not self.browser_profile.highlight_elements and not self.browser_profile.dom_highlight_elements:
return
try: