Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 43bc0fd

Browse files
committed
Bug 1953498 - Add keyword for view source quickaction. r=daisuke,fluent-reviewers,urlbar-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D243025
1 parent df62174 commit 43bc0fd

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const DEFAULT_ACTIONS = {
258258
onPick: restartBrowser,
259259
},
260260
viewsource: {
261-
l10nCommands: ["quickactions-cmd-viewsource"],
261+
l10nCommands: ["quickactions-cmd-viewsource2"],
262262
icon: "chrome://global/skin/icons/settings.svg",
263263
label: "quickactions-viewsource2",
264264
isVisible: () => currentBrowser()?.currentURI.scheme !== "view-source",

browser/components/urlbar/tests/unit/test_quickactions.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ add_task(async function quickactions_match() {
3636
Assert.ok(results[0].key == "newaction", "Matched the new action");
3737
});
3838

39+
add_task(async function quickactions_match_multiple() {
40+
ActionsProviderQuickActions.addAction("multiaction", {
41+
commands: ["testcommand1", "commandtest2"],
42+
});
43+
44+
let context = createContext("testcommand1", {});
45+
let results = await ActionsProviderQuickActions.queryActions(context);
46+
Assert.ok(
47+
results[0].key == "multiaction",
48+
"Matched the action with first keyword"
49+
);
50+
51+
context = createContext("commandtest2", {});
52+
results = await ActionsProviderQuickActions.queryActions(context);
53+
Assert.ok(
54+
results[0].key == "multiaction",
55+
"Matched the action with first keyword"
56+
);
57+
58+
ActionsProviderQuickActions.removeAction("multiaction");
59+
});
60+
3961
add_task(async function duplicate_matches() {
4062
ActionsProviderQuickActions.addAction("testaction", {
4163
commands: ["testaction", "test"],

browser/locales/en-US/browser/browser.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ quickactions-update = Update { -brand-short-name }
357357
quickactions-cmd-update = update
358358
359359
# Opens the view-source UI with current pages source
360-
quickactions-viewsource2 = View Page Source
361-
quickactions-cmd-viewsource = view source, source
360+
quickactions-viewsource2 = View page source
361+
quickactions-cmd-viewsource2 = view source, source, page source
362362
363363
# Tooltip text for the help button shown in the result.
364364
quickactions-learn-more =

0 commit comments

Comments
 (0)