Default activate the extension keyboard shortcut can't work for chrome.action ?

1,530 views
Skip to first unread message

Jackie Han

unread,
Mar 20, 2021, 9:41:50 AM3/20/21
to Chromium Extensions
In MV2, there are two default keyboard shortcuts for chrome.browserAction and chrome.pageAction, which used to activate the extension popup page. Like below

"commands": {
    "_execute_browser_action": {
    },
    "_execute_page_action": {
    }
}

But what is the default command for chrome.action in MV3? 
I tested "_execute_browser_action", but it doesn't work in MV3. Is this a bug? Now, users can't set a shortcut to activate the popup page.

Jackie Han

Roberto Oneto

unread,
Mar 20, 2021, 9:52:40 AM3/20/21
to Chromium Extensions, Jackie Han
Hi, 
Have you just tried "_execute_action"" ?

Jackie Han

unread,
Mar 20, 2021, 10:11:02 AM3/20/21
to Roberto Oneto, Chromium Extensions
"_execute_action" doesn't work, but it can show the setting item like "_execute_browser_action".

Roberto Oneto

unread,
Mar 20, 2021, 10:29:17 AM3/20/21
to Chromium Extensions, Jackie Han, Chromium Extensions, Roberto Oneto
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+1"
},
"description": "OpenUp",
"global": false
}

I tried with Canary and works.

Jackie Han

unread,
Mar 20, 2021, 10:29:29 AM3/20/21
to Chromium Extensions
Added an issue 1190476

Jackie Han

unread,
Mar 20, 2021, 10:38:33 AM3/20/21
to Roberto Oneto, Chromium Extensions
I tried again.

Chrome Canary 91.0.4453.0 with "_execute_action", it works. 
But it has another issue, when you change the shortcut, It doesn't take effect until you reload the extension.

My previous test is on Chrome Stable Version 89.0.4389.90 on Mac, it doesn't work.



Jackie Han

unread,
Mar 20, 2021, 10:57:07 AM3/20/21
to Roberto Oneto, Chromium Extensions
I tried again again.

On Chrome Stable Version 89.0.4389.90 on Mac, use "_execute_action" can work. 
But the same issue, when you change the shortcut manually, It doesn't take effect until you reload the extension. This makes me think it doesn't work, in fact it doesn't take effect.

Jackie Han

unread,
Mar 20, 2021, 11:29:08 AM3/20/21
to Roberto Oneto, Chromium Extensions
Final confirmation, other custom commands can take effect at once when you change the shortcut. But "_execute_action" in MV3 can't take effect when you change it.

Jackie Han

unread,
Apr 17, 2021, 2:50:31 AM4/17/21
to Chromium Extensions
After I published my MV3 extension, I have received two feedbacks from real users about why there is no "Activate the extension" shortcut. I replied to them there is a bug about it, I will add it as soon as possible once chrome fix it.

Usually, people use one hand to trigger a keyboard shortcut to activate the popup page of the extension, then use another hand to click buttons in the popup page. This is more efficient than clicking the mouse twice with one hand.

Ivan White

unread,
May 20, 2021, 1:07:08 PM5/20/21
to Chromium Extensions, Jackie Han
I'm also experiencing this issue both in mv3. Currently migrating to mv3. I'm using _execute_action in mv3 as it seems to have replaced  _execute_browser_action from mv2.

However, it seems that the suggested keys in the manifest are not being used by Chrome at all. They show up as the set keys in the keyboard shortcuts on the extensions page, but they do not work in practice. To get a shortcut to work, I have to manually override it by literally clicking the edit pencil on the extension shortcuts page, set it (to the exact same key combination as in the manifest), reload the extension, THEN it works! So, while the extension keyboard shortcuts page is recognising the shortcut from the manifest (and filling it into the shortcut box for my extension), the browser is not recognising it otherwise - unless I override it manually in on the shortcuts page.

Bruce MacDonald

unread,
Sep 29, 2021, 7:39:56 AM9/29/21
to Chromium Extensions, ivanwh...@gmail.com, Jackie Han
Just a note as of now "_execute_action" does not take effect until the extension is removed from Chrome and re-added (rather than just reloaded).

Jackie Han

unread,
Jul 5, 2022, 3:20:33 AM7/5/22
to Chromium Extensions
Kindly Remind: this issue was fixed and landed in Chrome 103.
Reply all
Reply to author
Forward
0 new messages