Try to search your question here, if you can't find : Ask Any Question Now ?

make customizable keyboard shortcuts chrome extensions

HomeCategory: stackoverflowmake customizable keyboard shortcuts chrome extensions
Avatarjulie asked 4 months ago

I am making a chrome extension with a keyboard shortcut to open a pop-up and the code below works fine. It’s just that I want the user to be able to specify the keyboard shortcut to open the browser action via the options.html page. How might I go about this?

  • Note: I am not open to using Jquery, other 3rd party plugins, or content-scripts.

I would prefer to use a dropdown w/ the allowed shortcut keys (Ctrl+Shift+Alt, Ctrl+Shift, Ctrl+Alt, Ctrl, & Alt) mixed with a textbox only allowing one key to be entered.

That last part is a sub-question, but the main thing here is:

How Can I make Customizable Keyboard shortcuts within options page?

Manifest.json:

|  ...  |
"browser_action": {
  "default_icon": "png/Icon-128.png",
  "default_title": "Gamez.io",  
  "default_popup": "popup.html"
},
"background": {
  "scripts": ["background.js"],
  "persistent": false
},
"permissions": [
   "activeTab",
    "tabs"
],
"commands": {
  "_execute_browser_action": {
    "suggested_key": {
      "windows": "Alt+X",
      "mac": "Alt+X",
      "chromeos": "Alt+X",
      "linux": "Alt+X"
    }
  }
}
1 Answers
Best Answer
AvatarJyoti answered 4 months ago
Your Answer

8 + 10 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com