Skip to content

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

fixed `user_agent` param

Gregor Žunič484062bd8384
diff --git a/browser_use/browser/profile.py b/browser_use/browser/profile.py
index b7c9f89df..eaf117a24 100644
--- a/browser_use/browser/profile.py
+++ b/browser_use/browser/profile.py
@@ -746,6 +746,10 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Bro
if proxy_bypass:
pre_conversion_args.append(f'--proxy-bypass-list={proxy_bypass}')
+ # User agent flag
+ if self.user_agent:
+ pre_conversion_args.append(f'--user-agent={self.user_agent}')
+
# convert to dict and back to dedupe and merge duplicate args
final_args_list = BrowserLaunchArgs.args_as_list(BrowserLaunchArgs.args_as_dict(pre_conversion_args))
return final_args_list