Skip to content

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

fix: fixing highlighted elements not show,Make sure to use the maximum valid value in zIndex to avoid being blocked by other elements

mingzhong.li5a11b8f1cd2b
diff --git a/browser_use/dom/dom_tree/index.js b/browser_use/dom/dom_tree/index.js
index a1350d683..d23dc3aaf 100644
--- a/browser_use/dom/dom_tree/index.js
+++ b/browser_use/dom/dom_tree/index.js
@@ -140,7 +140,8 @@
container.style.left = "0";
container.style.width = "100%";
container.style.height = "100%";
- container.style.zIndex = "2147483640";
+ // Make sure to use the maximum valid value in zIndex to avoid being blocked by other elements
+ container.style.zIndex = "2147483647";
container.style.backgroundColor = 'transparent';
document.body.appendChild(container);
}