From 662041df279d2edae3bb218e69295c60b4d41b79 Mon Sep 17 00:00:00 2001 From: jj Date: Tue, 7 Oct 2025 13:46:12 +0000 Subject: [PATCH] helium: consolidate search engine patches - move all search patches together in series - extract google re-config into separate patch - merge kagi + ddg patch into consolidated "search engine defaults" patch --- patches/helium/core/add-kagi-search.patch | 12 ------ patches/helium/core/add-native-bangs.patch | 4 +- .../core/force-eu-search-features.patch | 2 +- .../core/proxy-extension-downloads.patch | 2 +- .../remove-search-desc-snippet-deps.patch | 2 +- ...tch => restore-google-search-engine.patch} | 42 ------------------ .../helium/core/search-engine-defaults.patch | 43 +++++++++++++++++++ patches/series | 10 ++--- 8 files changed, 53 insertions(+), 64 deletions(-) delete mode 100644 patches/helium/core/add-kagi-search.patch rename patches/helium/core/{make-ddg-default.patch => restore-google-search-engine.patch} (69%) create mode 100644 patches/helium/core/search-engine-defaults.patch diff --git a/patches/helium/core/add-kagi-search.patch b/patches/helium/core/add-kagi-search.patch deleted file mode 100644 index 1dd131e6..00000000 --- a/patches/helium/core/add-kagi-search.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/third_party/search_engines_data/resources/definitions/regional_settings.json -+++ b/third_party/search_engines_data/resources/definitions/regional_settings.json -@@ -10,7 +10,8 @@ - "&ecosia", - "&bing", - "&break_stuff_google", -- "&qwant" -+ "&qwant", -+ "&kagi" - ] - } - }, diff --git a/patches/helium/core/add-native-bangs.patch b/patches/helium/core/add-native-bangs.patch index a3b97152..76736c75 100644 --- a/patches/helium/core/add-native-bangs.patch +++ b/patches/helium/core/add-native-bangs.patch @@ -676,7 +676,7 @@ --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc -@@ -1689,6 +1689,8 @@ bool TemplateURL::IsBetterThanConflictin +@@ -1685,6 +1685,8 @@ bool TemplateURL::IsBetterThanConflictin : base::Time(), // Prefer engines that CANNOT be auto-replaced. !engine->safe_for_autoreplace(), @@ -722,7 +722,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetDummyURL(); --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -1958,6 +1958,9 @@ void AddPrivacyStrings(content::WebUIDat +@@ -1956,6 +1956,9 @@ void AddPrivacyStrings(content::WebUIDat {"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE}, {"heliumServicesToggleDescription", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION}, diff --git a/patches/helium/core/force-eu-search-features.patch b/patches/helium/core/force-eu-search-features.patch index f9776ef4..826a979a 100644 --- a/patches/helium/core/force-eu-search-features.patch +++ b/patches/helium/core/force-eu-search-features.patch @@ -16,7 +16,7 @@ #include "components/safe_browsing/core/common/features.h" #include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h" #include "components/saved_tab_groups/public/features.h" -@@ -2484,14 +2482,9 @@ void AddSearchStrings(content::WebUIData +@@ -2477,14 +2475,9 @@ void AddSearchStrings(content::WebUIData html_source->AddString("searchExplanationLearnMoreURL", chrome::kOmniboxLearnMoreURL); diff --git a/patches/helium/core/proxy-extension-downloads.patch b/patches/helium/core/proxy-extension-downloads.patch index 7448814b..fb5b8351 100644 --- a/patches/helium/core/proxy-extension-downloads.patch +++ b/patches/helium/core/proxy-extension-downloads.patch @@ -201,7 +201,7 @@ --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc -@@ -1958,6 +1958,10 @@ void AddPrivacyStrings(content::WebUIDat +@@ -1956,6 +1956,10 @@ void AddPrivacyStrings(content::WebUIDat {"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE}, {"heliumServicesToggleDescription", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION}, diff --git a/patches/helium/core/remove-search-desc-snippet-deps.patch b/patches/helium/core/remove-search-desc-snippet-deps.patch index 93e9c8cf..cf623628 100644 --- a/patches/helium/core/remove-search-desc-snippet-deps.patch +++ b/patches/helium/core/remove-search-desc-snippet-deps.patch @@ -26,7 +26,7 @@ namespace { const bool kEnableBuiltinSearchProviderAssets = -@@ -1856,18 +1852,6 @@ std::string TemplateURL::GetBuiltinDescr +@@ -1854,18 +1850,6 @@ std::string TemplateURL::GetBuiltinDescr } std::optional TemplateURL::GetBuiltinMarketingSnippet() const { diff --git a/patches/helium/core/make-ddg-default.patch b/patches/helium/core/restore-google-search-engine.patch similarity index 69% rename from patches/helium/core/make-ddg-default.patch rename to patches/helium/core/restore-google-search-engine.patch index b9f7ee21..4e9a744a 100644 --- a/patches/helium/core/make-ddg-default.patch +++ b/patches/helium/core/restore-google-search-engine.patch @@ -35,17 +35,6 @@ "id": 1 }, ---- a/components/search_engines/template_url_prepopulate_data.cc -+++ b/components/search_engines/template_url_prepopulate_data.cc -@@ -235,7 +235,7 @@ std::unique_ptr GetPrep - std::vector - regional_prepopulated_engines) { - return FindPrepopulatedEngineInternal(prefs, regional_prepopulated_engines, -- google.id, -+ duckduckgo.id, - /*use_first_as_fallback=*/true); - } - --- a/components/search_engines/search_engine_utils.cc +++ b/components/search_engines/search_engine_utils.cc @@ -35,7 +35,7 @@ SearchEngineType GetEngineType(const GUR @@ -57,34 +46,3 @@ // Now check the rest of the prepopulate data. for (const auto* engine : TemplateURLPrepopulateData::kAllEngines) { ---- a/third_party/search_engines_data/resources/definitions/regional_settings.json -+++ b/third_party/search_engines_data/resources/definitions/regional_settings.json -@@ -3,6 +3,18 @@ - // found in the LICENSE file. - { - "elements": { -+ "ZZ": { -+ // Default -+ "search_engines": [ -+ "&duckduckgo", -+ "&ecosia", -+ "&bing", -+ "&break_stuff_google", -+ "&qwant" -+ ] -+ } -+ }, -+ "elements_ignored": { - "AE": { - // United Arab Emirates - "search_engines": [ -@@ -1183,7 +1195,8 @@ - "name": "kRegionalSettings", - "export_items": false, - "map_key_type": "country_codes::CountryId", -- "map_aliases": { -+ "map_aliases": {}, -+ "map_aliases_ignored": { - "AD": "ES", // Andorra - "AF": "ZZ", // Afghanistan - "AG": "ZZ", // Antigua and Barbuda diff --git a/patches/helium/core/search-engine-defaults.patch b/patches/helium/core/search-engine-defaults.patch new file mode 100644 index 00000000..c41ebb9e --- /dev/null +++ b/patches/helium/core/search-engine-defaults.patch @@ -0,0 +1,43 @@ +--- a/components/search_engines/template_url_prepopulate_data.cc ++++ b/components/search_engines/template_url_prepopulate_data.cc +@@ -235,7 +235,7 @@ std::unique_ptr GetPrep + std::vector + regional_prepopulated_engines) { + return FindPrepopulatedEngineInternal(prefs, regional_prepopulated_engines, +- google.id, ++ duckduckgo.id, + /*use_first_as_fallback=*/true); + } + +--- a/third_party/search_engines_data/resources/definitions/regional_settings.json ++++ b/third_party/search_engines_data/resources/definitions/regional_settings.json +@@ -3,6 +3,19 @@ + // found in the LICENSE file. + { + "elements": { ++ "ZZ": { ++ // Default ++ "search_engines": [ ++ "&duckduckgo", ++ "&ecosia", ++ "&bing", ++ "&break_stuff_google", ++ "&qwant", ++ "&kagi" ++ ] ++ } ++ }, ++ "elements_ignored": { + "AE": { + // United Arab Emirates + "search_engines": [ +@@ -1183,7 +1196,8 @@ + "name": "kRegionalSettings", + "export_items": false, + "map_key_type": "country_codes::CountryId", +- "map_aliases": { ++ "map_aliases": {}, ++ "map_aliases_ignored": { + "AD": "ES", // Andorra + "AF": "ZZ", // Afghanistan + "AG": "ZZ", // Antigua and Barbuda diff --git a/patches/series b/patches/series index c296d966..9276d3db 100644 --- a/patches/series +++ b/patches/series @@ -116,15 +116,16 @@ helium/core/override-chrome-protocol.patch helium/core/onboarding-page.patch helium/core/change-chromium-branding.patch helium/core/scan-chrome-native-messaging-hosts.patch -helium/core/make-ddg-default.patch -helium/core/add-kagi-search.patch +helium/core/restore-google-search-engine.patch +helium/core/search-engine-defaults.patch +helium/core/fix-search-engine-icons.patch +helium/core/force-eu-search-features.patch +helium/core/remove-search-desc-snippet-deps.patch helium/core/copy-page-url-shortcut.patch helium/core/update-default-browser-prefs.patch helium/core/proxy-extension-downloads.patch helium/core/reenable-update-checks.patch -helium/core/fix-search-engine-icons.patch helium/core/add-native-bangs.patch -helium/core/force-eu-search-features.patch helium/core/disable-bookmarks-bar.patch helium/core/reenable-spellcheck-downloads.patch helium/core/prefer-https-by-default.patch @@ -163,7 +164,6 @@ helium/core/ublock-reconfigure-defaults.patch helium/core/ublock-migrate-prefs.patch helium/core/ublock-helium-services.patch helium/core/clean-omnibox-suggestions.patch -helium/core/remove-search-desc-snippet-deps.patch helium/core/increase-incognito-storage-quota.patch helium/core/mitigate-fingerprinting-canvas.patch helium/core/mitigate-fingerprinting-audio-context.patch