How can I specify a hotkey for my browser action?

3 answers

No, you can manipulate almost all other aspects of browserAction and the popup (including closing it), but it cannot be run programmatically.

@hamczu is right that the only way to bind global keyboard shortcuts is to add a Content Script that listens for keystrokes on every page.

However, you cannot force these keystrokes (or anything else) to invoke browserAction.

+2
source

I think you should look for Vimium . Global hot keys are performed by binding keyboard events in the script content and exchange information on the background screen. As the authors of the Wiki note, itโ€™s not possible to add global keyboard shortcuts (without using the contents of the script). "

Unfortunately, I found a related problem in bugtracker, and there seems to be no way to do this.

0
source

The chrome.commands api allows the user to associate hotkeys (with your suggestion for a hotkey) that will run commands such as opening a browser action.

Duplicate answer .

0
source

Source: https://habr.com/ru/post/1388873/


All Articles