|
@@ -0,0 +1,55 @@
|
|
|
+From: Yifeng <wuyifeng@nd.com.cn>
|
|
|
+Date: Fri, 5 Nov 2021 05:53:00 +0000
|
|
|
+Subject: AP9-4099 Google Web Apps shows Unsupported Message
|
|
|
+
|
|
|
+This ensures that when we open the google web apps (like docs.google.com), there is not a message at the top that says “Unsupported Browser”.
|
|
|
+The modified content is to add 'Chrome/xx' and 'Firefox/xx' to the User-Agent.
|
|
|
+
|
|
|
+---
|
|
|
+ content/common/user_agent.cc | 4 ++--
|
|
|
+ components/embedder_support/user_agent_utils.cc | 16 -----
|
|
|
+ 2 files changed, 2 insertions(+), 18 deletions(-)
|
|
|
+
|
|
|
+diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
|
|
|
+--- a/content/common/user_agent.cc
|
|
|
++++ b/content/common/user_agent.cc
|
|
|
+@@ -328,7 +328,7 @@ std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
|
|
|
+ std::string user_agent;
|
|
|
+ base::StringAppendF(&user_agent,
|
|
|
+ "Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
|
+- "%s Safari/537.36",
|
|
|
+- os_info.c_str(), "");
|
|
|
++ "%s Safari/537.36 Firefox/97.2.0",
|
|
|
++ os_info.c_str(), product.c_str());
|
|
|
+ return user_agent;
|
|
|
+ }
|
|
|
+diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc
|
|
|
+--- a/components/embedder_support/user_agent_utils.cc
|
|
|
++++ b/components/embedder_support/user_agent_utils.cc
|
|
|
+@@ -267,14 +267,3 @@
|
|
|
+ std::string GetUserAgent() {
|
|
|
+- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
|
|
+- if (command_line->HasSwitch(kUserAgent)) {
|
|
|
+- std::string ua = command_line->GetSwitchValueASCII(kUserAgent);
|
|
|
+- if (net::HttpUtil::IsValidHeaderValue(ua))
|
|
|
+- return ua;
|
|
|
+- LOG(WARNING) << "Ignored invalid value for flag --" << kUserAgent;
|
|
|
+- }
|
|
|
+-
|
|
|
+- if (base::FeatureList::IsEnabled(blink::features::kReduceUserAgent))
|
|
|
+- return GetReducedUserAgent();
|
|
|
+-
|
|
|
+ return GetFullUserAgent();
|
|
|
+ }
|
|
|
+@@ -291,9 +280,4 @@
|
|
|
+ std::string GetFullUserAgent() {
|
|
|
+ std::string product = GetProduct(/*allow_version_override=*/true);
|
|
|
+-#if defined(OS_ANDROID)
|
|
|
+- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
+- switches::kUseMobileUserAgent))
|
|
|
+- product += " Mobile";
|
|
|
+-#endif
|
|
|
+ return content::BuildUserAgentFromProduct(product);
|
|
|
+ }
|
|
|
+--
|
|
|
+2.17.1
|