Skip to content

Commit

Permalink
esr128.2 part II
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponchale committed Sep 11, 2024
1 parent 1fa9fe9 commit 35c9d14
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 160 deletions.
4 changes: 2 additions & 2 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3614,9 +3614,9 @@ var XULBrowserWindow = {
};

// If the location is changed due to switching tabs,
// ensure we close any open tabspecific panels.
// ensure we close any open tabspecific popups.
if (aIsSimulated) {
closeOpenPanels("panel[tabspecific='true']");
closeOpenPanels(":is(panel, menupopup)[tabspecific='true']");
}

// Ensure we close any remaining open locationspecific panels
Expand Down
2 changes: 1 addition & 1 deletion browser/components/preferences/search.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<checkbox id="showSearchSuggestionsPrivateWindows"
data-l10n-id="search-show-suggestions-private-windows"/>
<hbox align="center" id="showTrendingSuggestionsBox">
<checkbox id="showTrendingSuggestions" data-l10n-id="search-show-trending-suggestions" preference="browser.urlbar.suggest.trending" class="tail-with-learn-more" />
<checkbox id="showTrendingSuggestions" data-l10n-id="addressbar-locbar-showtrendingsuggestions-option" preference="browser.urlbar.suggest.trending" class="tail-with-learn-more" />
<html:a is="moz-support-link" support-page="google-trending-searches-on-awesomebar" />
</hbox>
<hbox id="urlBarSuggestionPermanentPBLabel"
Expand Down
15 changes: 2 additions & 13 deletions browser/components/preferences/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Preferences.addAll([
{ id: "browser.search.separatePrivateDefault.ui.enabled", type: "bool" },
{ id: "browser.urlbar.suggest.trending", type: "bool" },
{ id: "browser.urlbar.trending.featureGate", type: "bool" },
{ id: "browser.urlbar.trending.enabledLocales", type: "string" },
{ id: "browser.urlbar.recentsearches.featureGate", type: "bool" },
{ id: "browser.urlbar.suggest.recentsearches", type: "bool" },
]);
Expand Down Expand Up @@ -284,18 +283,8 @@ var gSearchPane = {
let trendingSupported = (
await Services.search.getDefault()
).supportsResponseType(lazy.SearchUtils.URL_TYPE.TRENDING_JSON);
let trendingEnabled = Preferences.get(
"browser.urlbar.trending.featureGate"
).value;
let enabledLocales = Preferences.get(
"browser.urlbar.trending.enabledLocales"
).value;
if (trendingEnabled && enabledLocales) {
trendingEnabled = enabledLocales.includes(
Services.locale.appLocaleAsBCP47
);
}
trendingBox.hidden = !trendingEnabled;
trendingBox.hidden = !Preferences.get("browser.urlbar.trending.featureGate")
.value;
trendingCheckBox.disabled = suggestDisabled || !trendingSupported;
},

Expand Down
5 changes: 0 additions & 5 deletions browser/components/urlbar/UrlbarPrefs.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,6 @@ const PREF_URLBAR_DEFAULTS = new Map([
// Feature gate pref for trending suggestions in the urlbar.
["trending.featureGate", true],

// Only enable trending suggestions if the users browser locale is contained
// in this list; enable in all locales if empty.
// (if the value was "en-US", trending would only be enabled for en-US users).
["trending.enabledLocales", ""],

// The maximum number of trending results to show while not in search mode.
["trending.maxResultsNoSearchMode", 10],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,16 +601,9 @@ class ProviderSearchSuggestions extends UrlbarProvider {
* Whether we should fetch trending results.
*/
#shouldFetchTrending(queryContext) {
let trendingEnabled = lazy.UrlbarPrefs.get("trending.featureGate");
let enabledLocales = lazy.UrlbarPrefs.get("trending.enabledLocales");
if (trendingEnabled && enabledLocales) {
trendingEnabled = enabledLocales.includes(
Services.locale.appLocaleAsBCP47
);
}
return !!(
queryContext.searchString == "" &&
trendingEnabled &&
lazy.UrlbarPrefs.get("trending.featureGate") &&
lazy.UrlbarPrefs.get("suggest.trending") &&
(queryContext.searchMode ||
!lazy.UrlbarPrefs.get("trending.requireSearchMode"))
Expand Down
26 changes: 0 additions & 26 deletions browser/components/urlbar/content/enUS-searchFeatures.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -343,32 +343,6 @@ firefox-suggest-onboarding-main-reject-option-description-3 = Leave the default
firefox-suggest-onboarding-main-submit-button = Save preferences
firefox-suggest-onboarding-main-skip-link = Not now
## Strings for trending suggestions that are currently only used in
## en-US based experiments.

# Shown in preferences to enabled and disable trending suggestions.
search-show-trending-suggestions =
.label = Show trending search suggestions
.accesskey = t
# The header shown above trending results.
# Variables:
# $engine (String): the name of the search engine providing the trending suggestions
urlbar-group-trending =
.label = Trending on { $engine }
# The result menu labels shown next to trending results.
urlbar-result-menu-trending-dont-show =
.label = Don’t show trending searches
.accesskey = D
urlbar-result-menu-trending-why =
.label = Why am I seeing this?
.accesskey = W
# A message that replaces a result when the user dismisses all suggestions of a
# particular type.
urlbar-trending-dismissal-acknowledgment = Thanks for your feedback. You won’t see trending searches anymore.
urlbar-firefox-suggest-contextual-opt-in-title-1 =
Find the best of the web, faster
urlbar-firefox-suggest-contextual-opt-in-title-2 =
Expand Down
16 changes: 16 additions & 0 deletions browser/locales/en-US/browser/browser.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,22 @@ urlbar-group-quickactions =
urlbar-group-recent-searches =
.label = Recent Searches
# The header shown above trending results.
# Variables:
# $engine (String): the name of the search engine providing the trending suggestions
urlbar-group-trending =
.label = Trending on { $engine }
# The result menu labels shown next to trending results.
urlbar-result-menu-trending-dont-show =
.label = Don’t show trending searches
.accesskey = D
urlbar-result-menu-trending-why =
.label = Why am I seeing this?
.accesskey = W
# A message that replaces a result when the user dismisses all suggestions of a
# particular type.
urlbar-trending-dismissal-acknowledgment = Thanks for your feedback. You won’t see trending searches anymore.
## Reader View toolbar buttons

# This should match menu-view-enter-readerview in menubar.ftl
Expand Down
3 changes: 3 additions & 0 deletions browser/locales/en-US/browser/preferences/preferences.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,9 @@ addressbar-locbar-quickactions-option =
addressbar-locbar-showrecentsearches-option =
.label = Show recent searches
.accesskey = r
addressbar-locbar-showtrendingsuggestions-option =
.label = Show trending search suggestions
.accesskey = t
addressbar-quickactions-learn-more = Learn more
Expand Down
Loading

0 comments on commit 35c9d14

Please sign in to comment.