mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
Merge pull request #57 from minj/commands-CSU
switch to using Ctrl+Shift+U in commands example
This commit is contained in:
@@ -6,7 +6,7 @@ This extension includes:
|
||||
|
||||
All it does is:
|
||||
|
||||
* register a shortcut (Ctrl+Shift+Y) to send a command to the extension (Command+Shift+Y on a Mac).",
|
||||
* register a shortcut (Ctrl+Shift+U) to send a command to the extension (Command+Shift+U on a Mac).",
|
||||
|
||||
It shows:
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* [{
|
||||
* name: "toggle-feature",
|
||||
* description: "Send a 'toggle-feature' event to the extension"
|
||||
* shortcut: "Ctrl+Shift+Y"
|
||||
* shortcut: "Ctrl+Shift+U"
|
||||
* }]
|
||||
*/
|
||||
chrome.commands.getAll(function(commands) {
|
||||
@@ -19,8 +19,8 @@ chrome.commands.getAll(function(commands) {
|
||||
/**
|
||||
* Fired when a registered command is activated using a keyboard shortcut.
|
||||
*
|
||||
* In this sample extension, there is only one registered command: "Ctrl+Shift+Y".
|
||||
* On Mac, this command will automatically be converted to "Command+Shift+Y".
|
||||
* In this sample extension, there is only one registered command: "Ctrl+Shift+U".
|
||||
* On Mac, this command will automatically be converted to "Command+Shift+U".
|
||||
*/
|
||||
chrome.commands.onCommand.addListener(function(command) {
|
||||
console.log("onCommand event received for message: ", command);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Sample Commands Extension",
|
||||
"description": "Press Ctrl+Shift+Y to send an event (Command+Shift+Y on a Mac).",
|
||||
"description": "Press Ctrl+Shift+U to send an event (Command+Shift+U on a Mac).",
|
||||
"homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/commands",
|
||||
"manifest_version": 2,
|
||||
"version": "1.0",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"commands": {
|
||||
"toggle-feature": {
|
||||
"suggested_key": { "default": "Ctrl+Shift+Y" },
|
||||
"suggested_key": { "default": "Ctrl+Shift+U" },
|
||||
"description": "Send a 'toggle-feature' event to the extension"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user