diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 57f011764..8b4c19f44 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -686,8 +686,9 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( switches::kLocalesDirPath, switches::kLogFile, switches::kLogSeverity, - switches::kResourcesDirPath, switches::kProductVersion, + switches::kResourcesDirPath, + switches::kUserAgent, }; command_line->CopySwitchesFrom(browser_cmd, kSwitchNames, arraysize(kSwitchNames)); diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index f9bada753..d4558c701 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -114,6 +114,9 @@ std::string CefContentClient::GetUserAgent() const { std::string product_version; const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kUserAgent)) + return command_line.GetSwitchValueASCII(switches::kUserAgent); + if (command_line.HasSwitch(switches::kProductVersion)) { product_version = command_line.GetSwitchValueASCII(switches::kProductVersion);