Chrome://extensions/shortcuts shows shortcut as assigned even if chrome.commands.getAll returns empty for execute_action

59 views
Skip to first unread message

Red ross

unread,
Feb 27, 2023, 1:36:39 AM2/27/23
to Chromium Extensions
I'm seeing that for some users chrome.commands.getAll() returns `execute_action` as an empty string on Chrome 110.

https://developer.chrome.com/docs/extensions/reference/commands/#verify-commands-registered suggests that we should prompt the user that the command is unassigned.

If we do add such a prompt, the only way to correct it is for the user to go to chrome://extensions/shortcuts and reset the shortcut.

chrome://extensions/shortcuts however still shows the shortcut as registered when in-practice it isn't. This can be misleading for the user when troubleshooting.

Is there any another way to refresh the shortcut / prompt the user to reset the command shortcut for execute_action?

Also, what are the causes for execute_action to be empty apart from another extension already having claimed the shortcut command.

Jackie Han

unread,
Feb 27, 2023, 11:08:55 AM2/27/23
to Red ross, Chromium Extensions
chrome://extensions/shortcuts however still shows the shortcut as registered when in-practice it isn't. This can be misleading for the user when troubleshooting.

If `commands.getAll()` returns `command.shortcut` is empty, but in chrome://extensions/shortcuts it shows a shortcut that has been set (not empty). I think it is a bug.

In any case, if the shortcuts conflict (fail), guiding users to chrome://extensions/shortcuts is the best solution. For example, 

const extName = chrome.i18n.getMessage('extName');
const url = 'chrome://extensions/shortcuts#:~:text=' + encodeURIComponent(extName);
chrome.tabs.create({url});


I have proposed an API for the above workaround.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/00003c10-e5c0-45e8-a0c0-e0f2d0f530f0n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages