質問

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