Вопрос

Is it possible to specify a hotkey that will activate a Google Chrome browser action?

Это было полезно?

Решение

No, you can manipulate almost every other aspect of the browserAction and the popup (including closing it) but it cannot be triggered programatically.

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

However you will not be able to make those keystrokes (or anything else) trigger the browserAction.

Другие советы

I think you should look to Vimium project source. Global hotkeys are done by binding keyboard events in content script and communicate to background page. As authors say in Wiki there is no way "to add global keyboard shortcuts (without using a content script)".

Unfortunately I have found related issue in the bugtracker and it seems there is no way to so so.

The chrome.commands api enables the user to bind hotkeys (with your suggestion for the hotkey) that will trigger commands such as opening the browser action.

Duplicate of answer.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top