Skip to content

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

Merge branch 'main' into bot-detection-batch

Nick Sweeting8ba3e570e670
diff --cc browser_use/browser/browser.py
index 2f819ea0b,1a27486ea..69f8200c7
--- a/browser_use/browser/browser.py
+++ b/browser_use/browser/browser.py
@@@ -132,7 -133,9 +132,10 @@@ class Browser
async def new_context(self, config: BrowserContextConfig | None = None) -> BrowserContext:
"""Create a browser context"""
- return BrowserContext(config=config or self.config.new_context_config, browser=self)
- return BrowserContext(
- config=config or BrowserContextConfig(**(self.config.model_dump() if self.config else {})), browser=self
- )
++ browser_config = dict(self.config or {})
++ context_config = dict(config or {})
++ merged_config = {**browser_config, **context_config}
++ return BrowserContext(config=BrowserContextConfig(**merged_config), browser=self)
async def get_playwright_browser(self) -> PlaywrightBrowser:
"""Get a browser context"""