Skip to content

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

fixed highlights z index

Gregor Žunič1c8789b8ef00
diff --git a/browser_use/dom/debug/highlights.py b/browser_use/dom/debug/highlights.py
index b904e5fbb..8e8a4893b 100644
--- a/browser_use/dom/debug/highlights.py
+++ b/browser_use/dom/debug/highlights.py
@@ -135,7 +135,7 @@ async def inject_highlighting_script(dom_service: DomService, interactive_elemen
// Use a high but reasonable z-index to be visible without covering important content
// High enough for most content but not maximum to avoid blocking critical popups/modals
- const HIGHLIGHT_Z_INDEX = 999999; // High but reasonable z-index
+ const HIGHLIGHT_Z_INDEX = 2147483647; // Maximum z-index for CSS (2^31-1)
// Create container for all highlights - use fixed positioning without scroll calculations
const container = document.createElement('div');