From 7505376c457d020a60b2f986558350d2c0f70247 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Thu, 23 Jan 2025 15:32:25 +1300 Subject: [PATCH 1/5] Clarify details returned in commands.Command --- .../webextensions/api/commands/command/index.md | 12 ++++++------ .../add-ons/webextensions/api/commands/index.md | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md index de19a0bc30cb798..311fd5d04cabfb3 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md @@ -7,20 +7,20 @@ browser-compat: webextensions.api.commands.Command {{AddonSidebar}} -Information about a command. This contains the information specified for the command in the [`commands` manifest.json key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). +Information about a command's settings. An array of these objects is returned from {{WebExtAPIRef('commands.getAll()')}}. ## Type -Values of this type are objects. They contain the following properties: +A value of this type is an object containing these properties: -- `name` {{optional_inline}} - - : `string`. Name of this command. This will be passed into the {{WebExtAPIRef('commands.onCommand')}} event listener. +- `name` + - : `string`. Name of the command. This is passed into the {{WebExtAPIRef('commands.onCommand')}} event listener. - `description` {{optional_inline}} - - : `string`. Description of this command. This is primarily used to explain to the user what this command does. + - : `string`. Description of the command. This is used to explain to the user what this command does. - `shortcut` {{optional_inline}} - - : `string`. Key(s) used to execute this command, specified as a string like "Ctrl+Shift+Y". + - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values][/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values] section of the `commands` manifest key documentation for more details. ## Browser compatibility diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/index.md index bbd9ae3ef4db90b..6c62ded53198267 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/index.md @@ -7,21 +7,21 @@ browser-compat: webextensions.api.commands {{AddonSidebar}} -Listen for the user executing commands that you have registered using the [`commands` manifest.json key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). +Listen for the user executing commands that your extension registered using the [`commands` manifest.json key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). ## Types - {{WebExtAPIRef("commands.Command")}} - - : Object representing a command. This contains the information specified for the command in the [`commands` manifest.json key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). + - : Object containing a command's settings. ## Functions - {{WebExtAPIRef("commands.getAll")}} - - : Gets all registered commands for this extension. + - : Gets all registered commands for the extension. - {{WebExtAPIRef("commands.reset")}} - - : Reset the given command's description and shortcut to the values given in the manifest key. + - : Reset a command's description and shortcut to the values given in the manifest key. - {{WebExtAPIRef("commands.update")}} - - : Change the description or shortcut for the given command. + - : Change the description or shortcut for a command. ## Events From c4d598313be324fd82d71c9ce145bbb5e29c9733 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Fri, 7 Feb 2025 11:22:55 +1300 Subject: [PATCH 2/5] Feedback updates --- .../add-ons/webextensions/api/commands/command/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md index 311fd5d04cabfb3..f3b50b1302c0884 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md @@ -7,13 +7,13 @@ browser-compat: webextensions.api.commands.Command {{AddonSidebar}} -Information about a command's settings. +Information about the settings for the commands specified in the [`commands` manifest.json key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands). An array of these objects is returned from {{WebExtAPIRef('commands.getAll()')}}. ## Type -A value of this type is an object containing these properties: +A value of this type is an object containing these properties for the commands: - `name` - : `string`. Name of the command. This is passed into the {{WebExtAPIRef('commands.onCommand')}} event listener. @@ -22,6 +22,8 @@ A value of this type is an object containing these properties: - `shortcut` {{optional_inline}} - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values][/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values] section of the `commands` manifest key documentation for more details. +`description` and `shortcut' reflect the values given in the`commands`manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user. + ## Browser compatibility {{Compat}} From 8f0262bb4b163fd2c7b9b4046009eba9f849432f Mon Sep 17 00:00:00 2001 From: rebloor Date: Fri, 7 Feb 2025 11:47:26 +1300 Subject: [PATCH 3/5] Typo fix --- .../mozilla/add-ons/webextensions/api/commands/command/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md index f3b50b1302c0884..9978920e2efb280 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md @@ -22,7 +22,7 @@ A value of this type is an object containing these properties for the commands: - `shortcut` {{optional_inline}} - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values][/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values] section of the `commands` manifest key documentation for more details. -`description` and `shortcut' reflect the values given in the`commands`manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user. +`description` and `shortcut' reflect the values given in the `commands` manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user. ## Browser compatibility From b9d7398d3a9aa44936aaf4b81ec5c8efdba29d53 Mon Sep 17 00:00:00 2001 From: rebloor Date: Fri, 7 Feb 2025 13:52:49 +1300 Subject: [PATCH 4/5] Correct quote to back tick --- .../mozilla/add-ons/webextensions/api/commands/command/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md index 9978920e2efb280..39d33ff4a79e228 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md @@ -22,7 +22,7 @@ A value of this type is an object containing these properties for the commands: - `shortcut` {{optional_inline}} - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values][/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values] section of the `commands` manifest key documentation for more details. -`description` and `shortcut' reflect the values given in the `commands` manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user. +`description` and `shortcut` reflect the values given in the `commands` manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user. ## Browser compatibility From 41b8509d19bb44969f97f95c933a1b007cc2b147 Mon Sep 17 00:00:00 2001 From: rebloor Date: Mon, 24 Feb 2025 09:53:04 +1300 Subject: [PATCH 5/5] Fixed issue identified by linter --- .../mozilla/add-ons/webextensions/api/commands/command/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md index 39d33ff4a79e228..e460dd74899c47f 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.md @@ -20,7 +20,7 @@ A value of this type is an object containing these properties for the commands: - `description` {{optional_inline}} - : `string`. Description of the command. This is used to explain to the user what this command does. - `shortcut` {{optional_inline}} - - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values][/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values] section of the `commands` manifest key documentation for more details. + - : `string`. Keys used to execute the command, specified as a string. See the [shortcut values](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#shortcut_values) section of the `commands` manifest key documentation for more details. `description` and `shortcut` reflect the values given in the `commands` manifest.json key unless they have been updated with {{WebExtAPIRef('commands.update()')}}` or, in the case of the shortcut, customized by the user.