Skip to content

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

Update: ClickableElementDetector.is_interactive to ignore elements marked inert or aria-hidden

PredictiveManish839c1412e217
diff --git a/browser_use/dom/serializer/clickable_elements.py b/browser_use/dom/serializer/clickable_elements.py
index f274985a8..6c0eac9e0 100644
--- a/browser_use/dom/serializer/clickable_elements.py
+++ b/browser_use/dom/serializer/clickable_elements.py
@@ -18,6 +18,18 @@ class ClickableElementDetector:
if node.tag_name in {'html', 'body'}:
return False
+ # Skip elements explicitly marked as inert or aria-hidden
+ if node.attributes:
+ if 'inert' in node.attributes:
+ return False
+
+ aria_hidden = node.attributes.get('aria-hidden')
+ if isinstance(aria_hidden, str):
+ if aria_hidden.strip().lower() in {'true', '1'}:
+ return False
+ elif aria_hidden:
+ return False
+
# IFRAME elements should be interactive if they're large enough to potentially need scrolling
# Small iframes (< 100px width or height) are unlikely to have scrollable content
if node.tag_name and node.tag_name.upper() == 'IFRAME' or node.tag_name.upper() == 'FRAME':