tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit aacb4231f4e83711eca543405ec798f6015b700d
parent c29dc57a54b34c57a1c3cde65ec7b59807f395e2
Author: Drew Willcoxon <adw@mozilla.com>
Date:   Thu, 13 Nov 2025 01:32:20 +0000

Bug 1986060 - Cache the l10n bottom-text strings for some Suggest urlbar results. r=daisuke,urlbar-reviewers

I'd like to make `cacheable` true by default, but there are some larger concerns
around that, and for now I just want to narrowly fix this flicker.

Differential Revision: https://phabricator.services.mozilla.com/D272367

Diffstat:
Mbrowser/components/urlbar/private/AddonSuggestions.sys.mjs | 5++++-
Mbrowser/components/urlbar/private/MDNSuggestions.sys.mjs | 5++++-
Mbrowser/components/urlbar/private/YelpSuggestions.sys.mjs | 5++++-
Mbrowser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs | 15++++++++++++---
4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/browser/components/urlbar/private/AddonSuggestions.sys.mjs b/browser/components/urlbar/private/AddonSuggestions.sys.mjs @@ -98,7 +98,10 @@ export class AddonSuggestions extends SuggestProvider { shouldShowUrl: true, title: suggestion.title, description: suggestion.description, - bottomTextL10n: { id: "firefox-suggest-addons-recommended" }, + bottomTextL10n: { + id: "firefox-suggest-addons-recommended", + cacheable: true, + }, helpUrl: lazy.QuickSuggest.HELP_URL, }; diff --git a/browser/components/urlbar/private/MDNSuggestions.sys.mjs b/browser/components/urlbar/private/MDNSuggestions.sys.mjs @@ -62,7 +62,10 @@ export class MDNSuggestions extends SuggestProvider { title: [suggestion.title, lazy.UrlbarUtils.HIGHLIGHT.TYPED], description: suggestion.description, shouldShowUrl: true, - bottomTextL10n: { id: "firefox-suggest-mdn-bottom-text" }, + bottomTextL10n: { + id: "firefox-suggest-mdn-bottom-text", + cacheable: true, + }, }; return new lazy.UrlbarResult({ diff --git a/browser/components/urlbar/private/YelpSuggestions.sys.mjs b/browser/components/urlbar/private/YelpSuggestions.sys.mjs @@ -202,7 +202,10 @@ export class YelpSuggestions extends SuggestProvider { let payload = { url: url.toString(), originalUrl: suggestion.url, - bottomTextL10n: { id: "firefox-suggest-yelp-bottom-text" }, + bottomTextL10n: { + id: "firefox-suggest-yelp-bottom-text", + cacheable: true, + }, iconBlob: suggestion.icon_blob, }; let payloadHighlights = {}; diff --git a/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs b/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs @@ -940,7 +940,10 @@ class _QuickSuggestTestUtils { displayUrl: url.replace(/^https:\/\//, ""), isSponsored: false, shouldShowUrl: true, - bottomTextL10n: { id: "firefox-suggest-addons-recommended" }, + bottomTextL10n: { + id: "firefox-suggest-addons-recommended", + cacheable: true, + }, helpUrl: lazy.QuickSuggest.HELP_URL, telemetryType: "amo", }, @@ -995,7 +998,10 @@ class _QuickSuggestTestUtils { description, icon: "chrome://global/skin/icons/mdn.svg", shouldShowUrl: true, - bottomTextL10n: { id: "firefox-suggest-mdn-bottom-text" }, + bottomTextL10n: { + id: "firefox-suggest-mdn-bottom-text", + cacheable: true, + }, source: "rust", provider: "Mdn", suggestionObject: new lazy.Suggestion.Mdn({ @@ -1055,7 +1061,10 @@ class _QuickSuggestTestUtils { source, provider, telemetryType: "yelp", - bottomTextL10n: { id: "firefox-suggest-yelp-bottom-text" }, + bottomTextL10n: { + id: "firefox-suggest-yelp-bottom-text", + cacheable: true, + }, url, originalUrl, title,