Skip to content

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

Fix: incorrect config type in BrowserContext instantiation

zhangzheng9868b4922655
diff --git a/browser_use/browser/browser.py b/browser_use/browser/browser.py
index 80702e2b2..2103bd712 100644
--- a/browser_use/browser/browser.py
+++ b/browser_use/browser/browser.py
@@ -133,7 +133,7 @@ class Browser:
async def new_context(self, config: BrowserContextConfig | None = None) -> BrowserContext:
"""Create a browser context"""
- return BrowserContext(config=config or self.config, browser=self)
+ return BrowserContext(config=config or BrowserContextConfig(**(self.config.model_dump() if self.config else {})), browser=self)
async def get_playwright_browser(self) -> PlaywrightBrowser:
"""Get a browser context"""