mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix configuration of the User-Agent string during startup (issue #1275).
git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2062@1898 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -668,8 +668,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));
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user