chrome.commands keyboard shortcuts not working

前端 未结 10 1325
有刺的猬
有刺的猬 2020-12-03 07:57

I am trying to add some keyboard shortcuts to my Chrome extension, specifically to allow the user to use hotkeys to open up a browser action/popup. I\'ve read the d

10条回答
  •  旧时难觅i
    2020-12-03 08:03

    I was struggling with the same issue of the "_execute_browser_action" keyboard shortcut not being set automatically despite not conflicting with any existing shortcuts.

    It turns out my problem was caused by the following:

    ...
    "commands" : {
    "_execute_browser_action": {
            "suggested_key": {
              "mac": "Alt+J",
              "linux": "Ctrl+Shift+J"
            },
          "global": true <-- this shouldn't be here
          }
    ...
    

    Removing the "global": true resolved my issue. Hope this helps.

提交回复
热议问题