From 3bd94d641dfad9c38cce92d308f4fc814dfbcdb8 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Fri, 7 Feb 2025 13:46:55 +0100 Subject: [PATCH] Prevent mouse wheel fingerprinting on Windows --- build/cromite_patches_list.txt | 1 + ...ouse-wheel-fingerprinting-on-Windows.patch | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 build/patches/Prevent-mouse-wheel-fingerprinting-on-Windows.patch diff --git a/build/cromite_patches_list.txt b/build/cromite_patches_list.txt index fa04d05e..7efc4742 100644 --- a/build/cromite_patches_list.txt +++ b/build/cromite_patches_list.txt @@ -293,6 +293,7 @@ PublicKeyCredential-fingerprinting-mitigations.patch Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch Enable-Cert-Management-UI.patch Enable-ProcessBoundStringEncryption-by-default.patch +Prevent-mouse-wheel-fingerprinting-on-Windows.patch # temporary or wip patches Temp-PerformanceNavigationTiming-privacy-fix.patch diff --git a/build/patches/Prevent-mouse-wheel-fingerprinting-on-Windows.patch b/build/patches/Prevent-mouse-wheel-fingerprinting-on-Windows.patch new file mode 100644 index 00000000..9eec6eb2 --- /dev/null +++ b/build/patches/Prevent-mouse-wheel-fingerprinting-on-Windows.patch @@ -0,0 +1,22 @@ +From: uazo +Date: Fri, 7 Feb 2025 11:27:51 +0000 +Subject: Prevent mouse wheel fingerprinting on Windows + +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html +--- + ui/events/blink/web_input_event_builders_win.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ui/events/blink/web_input_event_builders_win.cc b/ui/events/blink/web_input_event_builders_win.cc +--- a/ui/events/blink/web_input_event_builders_win.cc ++++ b/ui/events/blink/web_input_event_builders_win.cc +@@ -297,6 +297,8 @@ WebMouseWheelEvent WebMouseWheelEventBuilder::Build( + // |wheel_delta| is expressed in multiples or divisions of WHEEL_DELTA, + // divide this out here to get the number of wheel ticks. + float num_ticks = wheel_delta / WHEEL_DELTA; ++ if (num_ticks > 0) num_ticks = 1; ++ else if (num_ticks < 0) num_ticks = -1; + float scroll_delta = num_ticks; + if (horizontal_scroll) { + unsigned long scroll_chars = kDefaultScrollCharsPerWheelDelta; +--