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 --- .../urlbar/UrlbarProviderInputHistory.sys.mjs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs') diff --git a/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs b/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs index 17b6a4c9b0..a259d639cc 100644 --- a/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs @@ -144,15 +144,25 @@ class ProviderInputHistory extends UrlbarProvider { // Don't suggest switching to the current page. continue; } - let result = new lazy.UrlbarResult( - UrlbarUtils.RESULT_TYPE.TAB_SWITCH, - UrlbarUtils.RESULT_SOURCE.TABS, - ...lazy.UrlbarResult.payloadAndSimpleHighlights(queryContext.tokens, { + let payload = lazy.UrlbarResult.payloadAndSimpleHighlights( + queryContext.tokens, + { url: [url, UrlbarUtils.HIGHLIGHT.TYPED], title: [resultTitle, UrlbarUtils.HIGHLIGHT.TYPED], icon: UrlbarUtils.getIconForUrl(url), userContextId: row.getResultByName("userContextId") || 0, - }) + } + ); + if (lazy.UrlbarPrefs.get("secondaryActions.featureGate")) { + payload[0].action = { + key: "tabswitch", + l10nId: "urlbar-result-action-switch-tab", + }; + } + let result = new lazy.UrlbarResult( + UrlbarUtils.RESULT_TYPE.TAB_SWITCH, + UrlbarUtils.RESULT_SOURCE.TABS, + ...payload ); addCallback(this, result); continue; -- cgit v1.2.3