summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs')
-rw-r--r--browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs20
1 files changed, 15 insertions, 5 deletions
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;