Skip to content

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

use all docker args if chromium_sandbox=False

Nick Sweeting986b385eb3be
diff --git a/browser_use/browser/profile.py b/browser_use/browser/profile.py
index ed195d63a..2158f8741 100644
--- a/browser_use/browser/profile.py
+++ b/browser_use/browser/profile.py
@@ -685,7 +685,7 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Bro
*default_args,
*self.args,
f'--profile-directory={self.profile_directory}',
- *(CHROME_DOCKER_ARGS if CONFIG.IN_DOCKER else []),
+ *(CHROME_DOCKER_ARGS if (CONFIG.IN_DOCKER or not self.chromium_sandbox) else []),
*(CHROME_HEADLESS_ARGS if self.headless else []),
*(CHROME_DISABLE_SECURITY_ARGS if self.disable_security else []),
*(CHROME_DETERMINISTIC_RENDERING_ARGS if self.deterministic_rendering else []),