helium/core: exclude broken/irrelevant flags

This commit is contained in:
wukko
2025-10-06 23:34:54 +06:00
parent 0fbca2dcbd
commit 5ed9e4cff3
5 changed files with 307 additions and 46 deletions

View File

@@ -29,7 +29,7 @@
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
--- a/components/webui/flags/flags_state.cc
+++ b/components/webui/flags/flags_state.cc
@@ -234,6 +234,7 @@ std::string GetCombinedOriginListValue(c
@@ -233,6 +233,7 @@ std::string GetCombinedOriginListValue(c
command_line.GetSwitchValueASCII(command_line_switch);
const std::string new_value =
flags_storage.GetOriginListFlag(internal_entry_name);
@@ -37,7 +37,7 @@
return CombineAndSanitizeOriginLists(existing_value, new_value);
}
@@ -484,6 +485,7 @@ void FlagsState::SetOriginListFlag(const
@@ -483,6 +484,7 @@ void FlagsState::SetOriginListFlag(const
const std::string& value,
FlagsStorage* flags_storage) {
const std::string new_value =

View File

@@ -11,7 +11,7 @@
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
--- a/components/webui/flags/flags_state.cc
+++ b/components/webui/flags/flags_state.cc
@@ -235,6 +235,7 @@ std::string GetCombinedOriginListValue(c
@@ -234,6 +234,7 @@ std::string GetCombinedOriginListValue(c
const std::string new_value =
flags_storage.GetOriginListFlag(internal_entry_name);
if (command_line_switch == "custom-ntp") return existing_value.empty() ? new_value : existing_value;
@@ -19,7 +19,7 @@
return CombineAndSanitizeOriginLists(existing_value, new_value);
}
@@ -486,6 +487,7 @@ void FlagsState::SetOriginListFlag(const
@@ -485,6 +486,7 @@ void FlagsState::SetOriginListFlag(const
FlagsStorage* flags_storage) {
const std::string new_value =
internal_name == "custom-ntp" ? value :

View File

@@ -1,41 +0,0 @@
--- a/components/webui/flags/flags_state.cc
+++ b/components/webui/flags/flags_state.cc
@@ -31,6 +31,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "chrome/browser/unexpire_flags.h"
#include "components/variations/field_trial_config/field_trial_util.h"
#include "components/variations/variations_associated_data.h"
#include "components/variations/variations_switches.h"
@@ -686,14 +687,19 @@ void FlagsState::GetFlagFeatureEntries(
int current_platform = GetCurrentPlatform();
for (const FeatureEntry& entry : feature_entries_) {
+ std::string desc = entry.visible_description;
if (skip_feature_entry.Run(entry)) {
+ if (flags::IsFlagExpired(flags_storage, entry.internal_name)) {
+ desc.insert(0, "!!! NOTE: THIS FLAG IS EXPIRED AND MAY STOP FUNCTIONING OR BE REMOVED SOON !!! ");
+ } else {
continue;
+ }
}
base::Value::Dict data;
data.Set("internal_name", entry.internal_name);
data.Set("name", entry.visible_name);
- data.Set("description", entry.visible_description);
+ data.Set("description", desc);
base::Value::List supported_platforms;
AddOsStrings(entry.supported_platforms, &supported_platforms);
@@ -1102,7 +1108,9 @@ bool FlagsState::IsSupportedFeature(cons
continue;
}
if (delegate_ && delegate_->ShouldExcludeFlag(storage, entry)) {
+ if (!flags::IsFlagExpired(storage, entry.internal_name)) {
continue;
+ }
}
return true;
}

View File

@@ -0,0 +1,300 @@
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -13311,11 +13311,278 @@ const FeatureEntry kFeatureEntries[] = {
// AboutFlagsHistogramTest unit test to verify this process).
};
+// Flags that either break Helium functionality or are not relevant to Helium
+constexpr auto kExcludedFlags = base::MakeFixedFlatSet<std::string_view>({
+ // Misc UI features
+ "enable-immersive-fullscreen-toolbar",
+ "windows11-mica-titlebar",
+ "omnibox-toolbelt",
+ "webium",
+ "webui-omnibox-popup",
+ "top-chrome-touch-ui",
+
+ // Google's broken canvas noising flag,
+ // replaced by Helium's fingerprinting-canvas-noise
+ "enable-canvas-noise",
+
+ // Google's fingerprinting protection blocklist
+ // Helium blocks fingerprinting by default, and these don't even work
+ "enable-fingerprinting-protection-blocklist",
+ "enable-fingerprinting-protection-blocklist-incognito",
+
+ // Google's experimental APIs that don't work in Helium
+ // due to missing model binaries
+ "translation-api",
+
+ // NTP
+ "omnibox-zero-suggest-prefetching",
+ "omnibox-mia-zps",
+ "ntp-calendar-module",
+ "ntp-drive-module-no-sync-requirement",
+ "ntp-module-sign-in-requirement",
+ "ntp-ogb-async-bar-parts",
+ "ntp-outlook-calendar-module",
+ "ntp-sharepoint-module",
+ "ntp-tab-groups-module",
+ "ntp-tab-groups-module-zero-state",
+ "ntp-microsoft-authentication-module",
+
+ // Google Account & Sync
+ "use-sync-sandbox",
+ "offer-migration-to-dice-users",
+ "web-signin-leads-to-implicitly-signed-in-state",
+ "enable-extensions-explicit-browser-signin",
+ "enable-history-sync-optin",
+ "sync-enable-bookmarks-in-transport-mode",
+ "reading-list-enable-sync-transport-mode-upon-sign-in",
+ "enable-history-sync-optin-expansion-pill",
+ "collaboration-shared-tab-group-account-data",
+ "enable-bookmarks-selected-type-on-signin-for-testing",
+ "enable-cross-device-pref-tracker",
+ "pdf-save-to-drive",
+
+ // Gemini Nano
+ "prompt-api-for-gemini-nano",
+ "prompt-api-for-gemini-nano-multimodal-input",
+ "summarization-api-for-gemini-nano",
+ "writer-api-for-gemini-nano",
+ "rewriter-api-for-gemini-nano",
+ "proofreader-api-for-gemini-nano",
+
+ // AI Mode
+ "ai-mode-omnibox-entry-point",
+ "aim-server-eligibility",
+ "hide-aim-omnibox-entrypoint-on-user-input",
+ "omnibox-allow-ai-mode-matches",
+ "omnibox-aim-shortcut-typed-state",
+ "enable-lens-search-aim-m3",
+ "ntp-compose-entrypoint",
+ "ntp-composebox",
+ "composebox-uses-chrome-compose-client",
+ "compose-selection-nudge",
+
+ // Shopping stuff
+ "product-specifications",
+ "compare-confirmation-toast",
+ "shopping-list",
+ "shopping-alternate-server",
+ "price-tracking-subscription-service-locale-key",
+ "price-tracking-subscription-service-product-version",
+ "track-by-default-mobile",
+ "price-insights",
+ "discount-on-navigation",
+ "discount-autofill",
+ "merchant-trust",
+
+ // History
+ "history-embeddings",
+ "history-embeddings-answers",
+
+ // Optimization Guide
+ "optimization-guide-debug-logs",
+ "optimization-guide-model-execution",
+ "optimization-guide-on-device-model",
+ "optimization-guide-personalized-fetching",
+ "optimization-guide-push-notifications",
+ "optimization-guide-enable-dogfood-logging",
+ "privacy-policy-insights",
+
+ // Google Lens
+ "enable-lens-overlay",
+ "enable-lens-overlay-image-context-menu-actions",
+ "enable-lens-overlay-updated-visuals",
+ "enable-lens-overlay-edu-action-chip",
+ "enable-lens-overlay-entrypoint-label-alt",
+ "enable-lens-overlay-text-selection-context-menu-entrypoint",
+ "lens-overlay-omnibox-entry-point",
+ "lens-search-side-panel-default-width-change",
+ "lens-overlay-permission-bubble-alt",
+ "enable-lens-overlay-simplified-selection",
+ "enable-lens-overlay-translate-button",
+ "enable-lens-overlay-latency-optimizations",
+ "enable-lens-overlay-translate-languages",
+ "enable-lens-overlay-side-panel-open-in-new-tab",
+ "enable-lens-search-side-panel-new-feedback",
+ "enable-lens-overlay-back-to-page",
+ "enable-lens-overlay-straight-to-srp",
+ "enable-lens-overlay-force-empty-csb-query",
+ "contextual-search-open-lens-action-uses-thumbnail",
+
+ // Google Assistant
+ "enable-assistant-dsp",
+ "enable-assistant-stereo-input",
+ "enable-assistant-aec",
+
+ // User education
+ "ntp-middle-slot-promo-dismissal",
+ "ntp-mobile-promo",
+ "force-ntp-mobile-promo",
+ "enable-educational-tip-default-browser-promo-card",
+ "force-startup-signin-promo",
+ "group-promo-prototype",
+ "group-promo-prototype-cpa",
+ "avatar-button-sync-promo",
+ "replace-sync-promos-with-sign-in-promos-desktop",
+ "replace-sync-promos-with-sign-in-promos",
+ "clank-default-browser-promo-role-manager",
+ "clank-default-browser-promo2",
+ "policy-promotion-banner-flag",
+ "management-promotion-banner-flag",
+ "enable-ntp-browser-promos",
+ "mobile-promo-on-desktop",
+ "in-product-help-demo-mode-choice",
+
+ // GLIC (AI agent stuff)
+ "glic",
+ "glic-z-order-changes",
+ "glic-actor",
+ "glic-detached",
+ "glic-panel-reset-top-chrome-button",
+ "glic-panel-reset-on-start",
+ "glic-panel-set-position-on-drag",
+ "glic-panel-reset-on-session-timeout",
+ "glic-panel-reset-size-and-location-on-open",
+ "glic-pre-warming",
+ "glic-fre-pre-warming",
+ "browsing-history-actor-integration-M1",
+
+ // Safety Hub
+ "safety-hub",
+ "safety-hub-magic-stack",
+ "safety-hub-followup",
+ "safety-hub-android-survey",
+ "safety-hub-android-survey-v2",
+ "safety-hub-weak-reused-passwords",
+ "safety-hub-local-passwords-module",
+ "safety-hub-unified-passwords-module",
+ "safety-hub-one-off-survey",
+ "safety-hub-services-on-start-up",
+ "safety-hub-disruptive-notification-revocation",
+ "safety-hub-unused-permission-revocation-for-all-surfaces",
+
+ // Privacy Sandbox
+ "privacy-sandbox-internals",
+ "privacy-sandbox-enrollment-overrides",
+ "privacy-sandbox-ads-api-ux-enhancements",
+ "privacy-sandbox-ad-topics-content-parity",
+ "privacy-guide-ai-settings",
+
+ // Password Manager
+ "biometric-reauth-password-filling",
+ "password-manual-fallback-available",
+ "save-passwords-contextual-ui",
+ "password-form-grouped-affiliations",
+ "password-form-clientside-classifier",
+ "three-button-password-save-dialog",
+ "improved-password-change-service",
+ "fill-recovery-password",
+ "apply-clientside-model-predictions-for-password-types",
+ "enable-site-isolation-for-password-sites",
+ "pwm-show-suggestions-on-autofocus",
+
+ // Reading Mode
+ "read-anything-read-aloud",
+ "read-anything-read-aloud-phrase-highlighting",
+ "read-anything-images-via-algorithm",
+ "read-anything-docs-integration",
+ "read-anything-docs-load-more-button",
+
+ // Autofill
+ "reintroduce-hybrid-passkey-entry-point",
+ "fill-on-account-select",
+ "show-autofill-type-predictions",
+ "autofill-more-prominent-popup",
+ "autofill-payments-field-swapping",
+ "autofill-show-bubbles-based-on-priorities",
+ "enable-show-autofill-signatures",
+ "enable-autofill-credit-card-upload",
+ "autofill-enable-offers-in-clank-keyboard-accessory",
+ "fedcm-autofill",
+ "autofill-enable-ranking-formula-address-profiles",
+ "autofill-enable-ranking-formula-credit-cards",
+ "sync-autofill-wallet-credential-data",
+ "autofill-enable-cvc-storage-and-filling",
+ "autofill-enable-prefetching-risk-data-for-retrieval",
+ "autofill-enable-fpan-risk-based-authentication",
+ "autofill-enable-email-or-loyalty-cards-filling",
+ "autofill-enable-loyalty-cards-filling",
+ "autofill-enable-syncing-of-loyalty-cards",
+ "autofill-enable-vcn-3ds-authentication",
+ "autofill-shared-storage-server-card-data",
+ "autofill-enable-syncing-of-pix-bank-accounts",
+ "autofill-enable-card-benefits-for-american-express",
+ "autofill-enable-card-benefits-sync",
+ "autofill-sync-ewallet-accounts",
+ "autofill-unmask-card-request-timeout",
+ "autofill-enable-cvc-storage-and-filling-enhancement",
+ "autofill-enable-buy-now-pay-later",
+ "autofill-enable-buy-now-pay-later-syncing",
+ "autofill-enable-cvc-storage-and-filling-standalone-form-enhancement",
+ "autofill-enable-card-benefits-iph",
+ "autofill-enable-card-info-runtime-retrieval",
+ "autofill-enable-save-and-fill",
+ "autofill-improved-labels",
+ "autofill-third-party-mode-content-provider",
+ "autofill-enable-card-benefits-for-bmo",
+ "autofill-enable-allowlist-for-bmo-card-category-benefits",
+ "autofill-enable-amount-extraction",
+ "autofill-enable-amount-extraction-allowlist",
+ "third-party-disable-chrome-autofill-settings-screen",
+ "iph-autofill-credit-card-benefit-feature",
+ "autofill-enable-new-fop-display-desktop",
+ "autofill-enable-amount-extraction-testing",
+ "autofill-vcn-enroll-strike-expiry-time",
+ "autofill-enable-flat-rate-card-benefits-from-curinos",
+ "autofill-enable-multiple-request-in-virtual-card-downstream-enrollment",
+ "autofill-require-cvc-for-possible-card-update",
+ "disable-autofill-strike-system",
+ "autofill-enable-buy-now-pay-later-for-klarna",
+ "autofill-enable-downstream-card-awareness-iph",
+ "autofill-enable-buy-now-pay-later-for-externally-linked",
+ "autofill-enable-separate-pix-preference-item",
+ "autofill-manual-testing-data",
+ "autofill-enable-support-for-home-and-work",
+ "autofill-enable-support-for-name-and-email-profile",
+ "autofill-update-context-for-web-contents",
+
+ // Add new entries above this line and categorize them accordingly.
+});
+
+const base::NoDestructor<std::vector<FeatureEntry>> kHeliumFeatureEntries([] {
+ std::vector<FeatureEntry> filtered;
+ for (const auto& entry : kFeatureEntries) {
+ if (!kExcludedFlags.contains(entry.internal_name)) {
+ filtered.push_back(entry);
+ }
+ }
+ return filtered;
+}());
+
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
public:
FlagsStateSingleton()
: flags_state_(
- std::make_unique<flags_ui::FlagsState>(kFeatureEntries, this)) {}
+ std::make_unique<flags_ui::FlagsState>(*kHeliumFeatureEntries, this)) {}
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
~FlagsStateSingleton() override = default;
@@ -13334,7 +13601,7 @@ class FlagsStateSingleton : public flags
void RestoreDefaultState() {
flags_state_ =
- std::make_unique<flags_ui::FlagsState>(kFeatureEntries, this);
+ std::make_unique<flags_ui::FlagsState>(*kHeliumFeatureEntries, this);
}
private:
@@ -13659,7 +13926,7 @@ base::span<const FeatureEntry> GetFeatur
!entries_for_testing->empty()) {
return *entries_for_testing;
}
- return kFeatureEntries;
+ return *kHeliumFeatureEntries;
}
} // namespace testing

View File

@@ -79,7 +79,6 @@ extra/ungoogled-chromium/add-flag-for-tabsearch-button.patch
extra/ungoogled-chromium/add-flag-for-qr-generator.patch
extra/ungoogled-chromium/add-flag-for-grab-handle.patch
extra/ungoogled-chromium/add-flag-for-close-confirmation.patch
extra/ungoogled-chromium/keep-expired-flags.patch
extra/ungoogled-chromium/add-flag-for-custom-ntp.patch
extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch
extra/ungoogled-chromium/add-flag-to-hide-tab-close-buttons.patch
@@ -145,11 +144,14 @@ helium/core/hide-extensions-via-toolbar-prefs.patch
helium/core/clean-context-menu.patch
helium/core/split-view.patch
helium/core/fix-tab-sync-unreached-error.patch
helium/core/flags-setup.patch
helium/core/add-low-power-framerate-flag.patch
helium/core/add-update-channel-flag.patch
helium/core/add-updater-preference.patch
helium/core/add-disable-ech-flag.patch
helium/core/exclude-irrelevant-flags.patch
helium/core/disable-outdated-build-detector.patch
helium/core/remove-dead-toolbar-actions.patch
helium/core/protect-browser-keyboard-shortcuts.patch