Files
cromite/build/patches/Client-hints-overrides.patch
T
2022-02-21 23:50:51 +01:00

59 lines
2.5 KiB
Diff

From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Thu, 22 Jul 2021 23:10:52 +0200
Subject: Client hints overrides
Disable critical client hints
Hard-code model to SAMSUNG SM-G960U
use Google Chrome branding for client hints
---
components/embedder_support/user_agent_utils.cc | 4 +---
content/common/user_agent.cc | 7 +------
content/public/common/content_features.cc | 2 +-
3 files changed, 3 insertions(+), 10 deletions(-)
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
@@ -168,9 +168,7 @@ const blink::UserAgentBrandList GetUserAgentBrandList(
int major_version_number = 0;
DCHECK(base::StringToInt(major_version, &major_version_number));
absl::optional<std::string> brand;
-#if !BUILDFLAG(CHROMIUM_BRANDING)
- brand = version_info::GetProductName();
-#endif
+ brand = "Google Chrome";
absl::optional<std::string> maybe_brand_override =
base::GetFieldTrialParamValueByFeature(features::kGreaseUACH,
"brand_override");
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
@@ -285,12 +285,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
std::string BuildModelInfo() {
std::string model;
-#if defined(OS_ANDROID)
- // Only send the model information if on the release build of Android,
- // matching user agent behaviour.
- if (base::SysInfo::GetAndroidBuildCodename() == "REL")
- model = base::SysInfo::HardwareModelName();
-#endif
+ model = "SAMSUNG SM-G960U";
return model;
}
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -232,7 +232,7 @@ const base::Feature kCrashReporting{"CrashReporting",
// Enables support for the `Critical-CH` response header.
// https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
const base::Feature kCriticalClientHint{"CriticalClientHint",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Enable cross-origin sharing of WebAssembly modules.
const base::Feature kCrossOriginWebAssemblyModuleSharingEnabled{
--
2.25.1