开发者

Assign the Shortcut key for Chrome Extension Option page

开发者 https://www.devze.com 2023-03-29 18:01 出处:网络
How can I assign my Google 开发者_运维百科chrome extension option page with shortcut key.The following works almost as good as a shortcut,

How can I assign my Google 开发者_运维百科chrome extension option page with shortcut key.


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!


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号