Skip to content

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

Update browser_use/browser/profile.py

Magnus Müller3afd3ff7b2eb
diff --git a/browser_use/browser/profile.py b/browser_use/browser/profile.py
index 3c6d2bbe7..3be208003 100644
--- a/browser_use/browser/profile.py
+++ b/browser_use/browser/profile.py
@@ -594,7 +594,7 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Bro
default=100,
description='Maximum number of iframe documents to process to prevent crashes.',
)
- max_iframe_depth: int = Field(
+ max_iframe_depth: int = Field(ge=0,
default=5,
description='Maximum depth for cross-origin iframe recursion (default: 5 levels deep).',
)