mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
Add a new MV3 sample demonstrating the chrome.commands API. The sample registers custom keyboard shortcuts in the manifest, handles command events in the service worker with notifications and badge text feedback, and uses chrome.commands.getAll() in the popup to display all registered shortcuts. Closes #1126
40 lines
958 B
JSON
40 lines
958 B
JSON
{
|
|
"name": "Commands API Demo",
|
|
"version": "1.0",
|
|
"description": "Uses the chrome.commands API to define keyboard shortcuts and handle command events.",
|
|
"manifest_version": 3,
|
|
"background": {
|
|
"service_worker": "background.js"
|
|
},
|
|
"permissions": ["notifications"],
|
|
"icons": {
|
|
"16": "images/icon-16.png",
|
|
"48": "images/icon-48.png",
|
|
"128": "images/icon-128.png"
|
|
},
|
|
"action": {
|
|
"default_popup": "popup.html",
|
|
"default_icon": {
|
|
"16": "images/icon-16.png",
|
|
"48": "images/icon-48.png",
|
|
"128": "images/icon-128.png"
|
|
}
|
|
},
|
|
"commands": {
|
|
"run-action": {
|
|
"suggested_key": {
|
|
"default": "Ctrl+Shift+Y",
|
|
"mac": "Command+Shift+Y"
|
|
},
|
|
"description": "Run the sample action"
|
|
},
|
|
"toggle-feature": {
|
|
"suggested_key": {
|
|
"default": "Ctrl+Shift+U",
|
|
"mac": "Command+Shift+U"
|
|
},
|
|
"description": "Toggle a feature on or off"
|
|
}
|
|
}
|
|
}
|