helium/core: enable autoscroll on linux by default, add a flag

closes #233
This commit is contained in:
wukko
2025-10-18 01:47:54 +06:00
parent 35fe39c483
commit ec7340c086
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
--- a/chrome/browser/helium_flag_choices.h
+++ b/chrome/browser/helium_flag_choices.h
@@ -29,6 +29,7 @@ namespace helium {
constexpr const char kDisableEchCommandLine[] = "disable-ech";
constexpr const char kCanvasNoiseCommandLine[] = "fingerprinting-canvas-noise";
constexpr const char kAudioContextJitterCommandLine[] = "fingerprinting-audio-context-jitter";
+ constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
} // namespace helium
--- a/chrome/browser/helium_flag_entries.h
+++ b/chrome/browser/helium_flag_entries.h
@@ -24,4 +24,8 @@
"Audio Context fingerprint deception",
"Adds small random jitter (±0.01%) to audio data to prevent fingerprinting. Helium flag.",
kOsAll, FEATURE_VALUE_TYPE(blink::features::kAudioContextJitter)},
+ {helium::kMiddleClickAutoscrollCommandLine,
+ "Middle Click Autoscroll",
+ "Enables autoscroll on middle click. Helium flag, Chromium feature.",
+ kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kHeliumMiddleClickAutoscroll)},
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -23,6 +23,7 @@ namespace blink {
namespace features {
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioContextJitter);
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumMiddleClickAutoscroll);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDisableLinkDrag);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kReducedSystemInfo);
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -23,6 +23,15 @@ BASE_FEATURE(kAudioContextJitter,
"AudioContextJitter",
base::FEATURE_ENABLED_BY_DEFAULT);
+BASE_FEATURE(kHeliumMiddleClickAutoscroll,
+ "HeliumMiddleClickAutoscroll",
+#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX)
+ base::FEATURE_ENABLED_BY_DEFAULT
+#else
+ base::FEATURE_DISABLED_BY_DEFAULT
+#endif
+);
+
BASE_FEATURE(kDisableLinkDrag, "DisableLinkDrag", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kReducedSystemInfo, "ReducedSystemInfo", base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kRemoveClientHints, "RemoveClientHints", base::FEATURE_DISABLED_BY_DEFAULT);
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1902,9 +1902,9 @@ void WebView::ApplyWebPreferences(const
prefs.default_maximum_page_scale_factor);
#endif
-#if BUILDFLAG(IS_WIN)
- RuntimeEnabledFeatures::SetMiddleClickAutoscrollEnabled(true);
-#endif
+ RuntimeEnabledFeatures::SetMiddleClickAutoscrollEnabled(
+ base::FeatureList::IsEnabled(features::kHeliumMiddleClickAutoscroll)
+ );
RuntimeEnabledFeatures::SetTranslateServiceEnabled(
prefs.translate_service_available);

View File

@@ -177,6 +177,7 @@ helium/core/disable-touch-ui.patch
helium/core/open-new-tabs-next-to-active-tab-option.patch
helium/core/disable-update-toast.patch
helium/core/disable-fedcm-bubble.patch
helium/core/add-middle-click-autoscroll-flag.patch
helium/settings/move-search-suggest.patch
helium/settings/remove-autofill.patch