Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

chrome extension catch shortcut

// manifest.Json

"commands": {
  "push-to-talk": {
    "suggested_key": {
      "default": "Ctrl+Shift+1"
    },
    "description": "Activate push-to-talk",
    "global": true
  }
},

// Background:

chrome.commands.onCommand.addListener(function(command) {
  if(command == "push-to-talk"){
    // Do whatever you want, e.g. bring focus to browser,
    // pass commands to page with content scripts etc.
  }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #chrome #extension #catch #shortcut
ADD COMMENT
Topic
Name
1+6 =