diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc index 2c451bda79ae3..bb39a13fe162d 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -15,6 +15,7 @@ #include "base/version.h" #include "build/branding_buildflags.h" #include "build/build_config.h" +#include "cef/libcef/common/cef_switches.h" #include "components/embedder_support/switches.h" #include "components/policy/core/common/policy_pref_names.h" #include "components/prefs/pref_service.h" @@ -248,6 +249,12 @@ blink::UserAgentBrandList GetBrandFullVersionList( } std::string GetProduct(const bool allow_version_override) { + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kUserAgentProductAndVersion)) { + return command_line->GetSwitchValueASCII( + switches::kUserAgentProductAndVersion); + } + if (allow_version_override && base::FeatureList::IsEnabled( blink::features::kForceMajorVersion100InUserAgent))