From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../components/urlbar/UrlbarProviderPlaces.sys.mjs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'browser/components/urlbar/UrlbarProviderPlaces.sys.mjs') diff --git a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs index c94ebee80a..0787d4c209 100644 --- a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs @@ -330,17 +330,25 @@ function makeUrlbarResult(tokens, info) { action.params.searchSuggestion.toLocaleLowerCase(), }) ); - case "switchtab": + case "switchtab": { + let payload = lazy.UrlbarResult.payloadAndSimpleHighlights(tokens, { + url: [action.params.url, UrlbarUtils.HIGHLIGHT.TYPED], + title: [info.comment, UrlbarUtils.HIGHLIGHT.TYPED], + icon: info.icon, + userContextId: info.userContextId, + }); + if (lazy.UrlbarPrefs.get("secondaryActions.featureGate")) { + payload[0].action = { + key: "tabswitch", + l10nId: "urlbar-result-action-switch-tab", + }; + } return new lazy.UrlbarResult( UrlbarUtils.RESULT_TYPE.TAB_SWITCH, UrlbarUtils.RESULT_SOURCE.TABS, - ...lazy.UrlbarResult.payloadAndSimpleHighlights(tokens, { - url: [action.params.url, UrlbarUtils.HIGHLIGHT.TYPED], - title: [info.comment, UrlbarUtils.HIGHLIGHT.TYPED], - icon: info.icon, - userContextId: info.userContextId, - }) + ...payload ); + } case "visiturl": return new lazy.UrlbarResult( UrlbarUtils.RESULT_TYPE.URL, -- cgit v1.2.3