Reputation: 399
How can I assign my Google chrome extension option page with shortcut key.
Upvotes: 2
Views: 862
Reputation: 347
You could use this autohotkey script:
#IfWinActive, ahk_class Chrome_WidgetWin_1 ; Shortcut functions only on Chrome
^q::Send, ^t chrome://extensions/ {enter} ; functioning script
#IfWinActive
The second line is the script and means that if you press Ctrl+q (^ stays for Crtl) the script opens a new Tab (Ctrl+t), type the address (chrome://extensions/) and press enter. You can change the shortcut key changing what is before the ::.
Then I suggest you to put the file .exe in the startup folder.
Upvotes: 0
Reputation: 590
I think the options page is meant to be open only from the extension control panel links. However, to solve the shortcut part of the problem you can use the new commands API which will free you from having javascript listeners injected on every page. The shortcuts will work even if you don't have a page loaded in your tab.
Upvotes: 1
Reputation: 662
The following works almost as good as a shortcut,
Go to location bar, press Ctrl+L Type "ce" OR "cs", Press Enter.
After setting it up as follows,
What I do is, I set them up as search engines on chrome://settings/searchEngines
Name - Shortcut - URL Chrome Extensions - ce - chrome://extensions/
Name - Shortcut - URL Chrome Settings - cs - chrome://settings/
http://productforums.google.com/forum/#!topic/chrome/hqYtz15LrgQ
Hope this helps!
Upvotes: 2
Reputation: 111365
Currently there is no better way other than injecting content script to all pages with keypress listener. As you would imagine this approach not only isn't very effective, but wouldn't work on some pages (chrome://newtab
would be the most annoying one).
Unless assigning a shortcut to your options page is crucial, I wouldn't bother doing it.
Upvotes: 1