commit 58699211928a5ff3b7edffdeccf9f916f591d5d0
parent 3e8f3fcba8c19c743ac4508271780ea0c5449c4c
Author: iulian moraru <imoraru@mozilla.com>
Date: Tue, 11 Nov 2025 04:15:08 +0200
Revert "Bug 1999162 - Remove "Trending Searches" component from Settings r=home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit f0a6bbfae19706df20268a4b206f88e7e5f69866.
Diffstat:
3 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/browser/components/preferences/home.inc.xhtml b/browser/components/preferences/home.inc.xhtml
@@ -98,6 +98,7 @@
<vbox id="web-search" />
<vbox id="weather" />
+ <vbox id="trending-searches" />
<vbox id="topsites" />
<vbox id="topstories" />
<vbox id="support-firefox" />
diff --git a/browser/extensions/newtab/lib/AboutPreferences.sys.mjs b/browser/extensions/newtab/lib/AboutPreferences.sys.mjs
@@ -39,6 +39,28 @@ const PREFS_FOR_SETTINGS = () => [
),
},
{
+ id: "trending-searches",
+ pref: {
+ feed: "trendingSearch.enabled",
+ titleString: "home-prefs-trending-search-header",
+ descString: "home-prefs-trending-search-description",
+ },
+ eventSource: "TRENDING_SEARCH",
+ shouldHidePref:
+ // Hide if Trending Search experiment is not enabled for this user
+ !Services.prefs.getBoolPref(
+ "browser.newtabpage.activity-stream.system.trendingSearch.enabled",
+ false
+ ) ||
+ // Also hide if it's enabled but the user doesn't have Google as their default search engine
+ (Services.prefs.getBoolPref(
+ "browser.newtabpage.activity-stream.system.trendingSearch.enabled",
+ false
+ ) &&
+ Services.prefs.getStringPref("browser.urlbar.placeholderName", "") !==
+ "Google"),
+ },
+ {
id: "topsites",
pref: {
feed: "feeds.topsites",
diff --git a/browser/locales/en-US/browser/preferences/preferences.ftl b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -787,6 +787,10 @@ home-prefs-weather-header =
home-prefs-weather-description = Today’s forecast at a glance
home-prefs-weather-learn-more-link = Learn more
+home-prefs-trending-search-header =
+ .label = Trending searches
+home-prefs-trending-search-description = Popular and frequently searched topics
+
# "Support" here means to help sustain or contribute to something, especially through funding or sponsorship.
home-prefs-support-firefox-header =
.label = Support { -brand-product-name }