Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug-1538451 documentation for commands.openShortcutSetting #38234

Merged

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Feb 19, 2025

Description

Addresses the dev-docs-needed requirements of Bug 1538451 Make extension shortcut management page accessible by a link/URL for a WebExtension by adding documentation for commands.openShortcutSetting along with accompanying release note.

Related issues and pull requests

BCD for commands.openShortcutSetting added in mdn/browser-compat-data#25944

@rebloor rebloor added the Content:WebExt WebExtensions docs label Feb 19, 2025
@rebloor rebloor requested review from dotproto and Rob--W February 19, 2025 16:46
@rebloor rebloor self-assigned this Feb 19, 2025
@rebloor rebloor requested review from a team as code owners February 19, 2025 16:46
@rebloor rebloor requested review from pepelsbey and removed request for a team February 19, 2025 16:46
@github-actions github-actions bot added the Content:Firefox Content in the Mozilla/Firefox subtree label Feb 19, 2025
@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Feb 19, 2025
@rebloor rebloor requested review from willdurand and a team February 19, 2025 16:47
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased documentation to make it more generic, and added browser-specific guidance.

@rebloor rebloor requested a review from Rob--W February 20, 2025 18:02

In Firefox, this function opens the [Manage Extension Shortcuts](https://support.mozilla.org/en-US/kb/manage-extension-shortcuts-firefox) view.

Chrome doesn't support this function yet. In Chrome, `chrome://extensions/shortcuts` can be opened using the `tabs.create` function.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a quick search and it appears that Safari does not allow users to change keyboard shortcuts for web extensions. (Corroborated in the commands compatibility note for Safari). Should we call this out here?

Copy link
Contributor Author

@rebloor rebloor Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there's probably a broader issue here in that we don't call out in the API overview that only Firefox supports updating and resetting the shortcut keys programmatically. At the same time it's probably also worth pointing out that Safari doesn't provide for changing them at all. I'll update the PR.

@rebloor rebloor requested a review from dotproto February 21, 2025 16:09
@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Feb 21, 2025
Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved provided that the feedback below is addressed.

@@ -9,6 +9,8 @@ browser-compat: webextensions.api.commands

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).

In Firefox, this API provides features to update the shortcut key settings. In Chrome, the user can update shortcut key settings through the extension options UI. Safari doesn't support user modification of extension shortcut keys.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentences about Chrome and Safari are not about API behavior, but browser UI. I'm not sure if that text belongs here. If we drop that, then the only remaining sentence is about Firefox's API support for updating shortcuts.

If you'd like to emphasize the update behavior and browser UI, I suggest adding a brief note that connects the relevant APIs, along with the existing note at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#updating_shortcuts

Here is an example, rephrase as needed:

Suggested change
In Firefox, this API provides features to update the shortcut key settings. In Chrome, the user can update shortcut key settings through the extension options UI. Safari doesn't support user modification of extension shortcut keys.
Shortcuts can be [updated](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#updating_shortcuts) through {{WebExtAPIRef("commands.update")}}, or by the user via browser UI (see {{WebExtAPIRef("commands.openShortcutSettings")}}).

@@ -9,6 +9,8 @@ browser-compat: webextensions.api.commands

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).
Copy link
Member

@Rob--W Rob--W Feb 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also reference the new method from the existing commands documentation on updating shortcuts at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands#updating_shortcuts

E.g. by appending a note,

To open this browser UI, use {{WebExtAPIRef("commands.openShortcutSettings")}}.

You can also put Safari-specific notes here, as a follow-up to #38234 (comment)

Copy link
Collaborator

@dotproto dotproto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No additional comments beyond what @Rob--W identified.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Feb 23, 2025
@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed merge conflicts 🚧 [PR only] size/m [PR only] 51-500 LoC changed labels Feb 23, 2025
@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Feb 23, 2025
@rebloor rebloor merged commit fa98e7a into mdn:main Feb 23, 2025
8 checks passed
@rebloor rebloor deleted the Bug-1538451-add-commands.openShortcutSettings branch February 23, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants