diff --git a/build/patches/Disable-ua-full-version.patch b/build/patches/Disable-ua-full-version.patch new file mode 100644 index 00000000..bb944498 --- /dev/null +++ b/build/patches/Disable-ua-full-version.patch @@ -0,0 +1,58 @@ +From: uazo +Date: Wed, 16 Feb 2022 14:28:58 +0000 +Subject: Disable ua full version in getHighEntropyValues() + +getHighEntropyValues returns only the major version +--- + .../renderer/core/frame/navigator_ua_data.cc | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/third_party/blink/renderer/core/frame/navigator_ua_data.cc b/third_party/blink/renderer/core/frame/navigator_ua_data.cc +--- a/third_party/blink/renderer/core/frame/navigator_ua_data.cc ++++ b/third_party/blink/renderer/core/frame/navigator_ua_data.cc +@@ -6,6 +6,8 @@ + + #include "base/compiler_specific.h" + #include "base/task/single_thread_task_runner.h" ++#include "base/version.h" ++#include "base/strings/strcat.h" + #include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h" + #include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h" + #include "third_party/blink/public/common/privacy_budget/identifiable_surface.h" +@@ -37,6 +39,16 @@ void MaybeRecordMetric(bool record_identifiability, + .Record(execution_context->UkmRecorder()); + } + ++const String GetReducedVersionNumber(const std::string& fullVersion) { ++ base::Version version(fullVersion); ++ std::string version_str; ++ const std::vector& components = version.components(); ++ if (components.size() > 0) { ++ version_str = base::StrCat({base::NumberToString(components[0]), ".0.0.0"}); ++ } ++ return String::FromUTF8(version_str); ++} ++ + } // namespace + + NavigatorUAData::NavigatorUAData(ExecutionContext* context) +@@ -75,7 +87,7 @@ void NavigatorUAData::SetFullVersionList( + const UserAgentBrandList& full_version_list) { + for (const auto& brand_version : full_version_list) { + AddBrandFullVersion(String::FromUTF8(brand_version.brand), +- String::FromUTF8(brand_version.version)); ++ GetReducedVersionNumber(brand_version.version)); + } + } + +@@ -97,7 +109,7 @@ void NavigatorUAData::SetModel(const String& model) { + } + + void NavigatorUAData::SetUAFullVersion(const String& ua_full_version) { +- ua_full_version_ = ua_full_version; ++ ua_full_version_ = GetReducedVersionNumber(ua_full_version.Ascii()); + } + + void NavigatorUAData::SetBitness(const String& bitness) { +-- +2.25.1