Override-UA-client-hint-for-model.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Thu, 22 Jul 2021 23:10:52 +0200
  3. Subject: Override UA client hint for model
  4. Hard-code model to SAMSUNG SM-G960U
  5. Disable permissions policy by default
  6. ---
  7. content/common/user_agent.cc | 7 +------
  8. content/public/common/content_features.cc | 2 +-
  9. 2 files changed, 2 insertions(+), 7 deletions(-)
  10. diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
  11. --- a/content/common/user_agent.cc
  12. +++ b/content/common/user_agent.cc
  13. @@ -282,12 +282,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
  14. std::string BuildModelInfo() {
  15. std::string model;
  16. -#if defined(OS_ANDROID)
  17. - // Only send the model information if on the release build of Android,
  18. - // matching user agent behaviour.
  19. - if (base::SysInfo::GetAndroidBuildCodename() == "REL")
  20. - model = base::SysInfo::HardwareModelName();
  21. -#endif
  22. + model = "SAMSUNG SM-G960U";
  23. return model;
  24. }
  25. diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
  26. --- a/content/public/common/content_features.cc
  27. +++ b/content/public/common/content_features.cc
  28. @@ -310,7 +310,7 @@ const base::Feature kExtraSafelistedRequestHeadersForOutOfBlinkCors{
  29. // Controls whether Client Hints are guarded by Permissions Policy.
  30. const base::Feature kFeaturePolicyForClientHints{
  31. - "FeaturePolicyForClientHints", base::FEATURE_ENABLED_BY_DEFAULT};
  32. + "FeaturePolicyForClientHints", base::FEATURE_DISABLED_BY_DEFAULT};
  33. // Enables fixes for matching src: local() for web fonts correctly against full
  34. // font name or postscript name. Rolling out behind a flag, as enabling this
  35. --
  36. 2.20.1