I am writing a Kiosk Mode Chrome App that responds to a keyboard shortcut. The best way I have found to do this uses the Chrome commands
API.
manifest.json
{...,
"kiosk_enabled": true,
"kiosk_only": false,
"commands": {
"perform-foo": {
"description": "Performs the Foo action",
"suggested_key": {
"default": "Ctrl+Shift+0"
},
"global": true
}
},
...}
As far as I can tell from the documentation, no special permissions are required. I made sure to use a "safe" key combination as per the documentation, and figured I'd specify global
for the heck of it.
main.js
chrome.commands.onCommand.addListener(function(command) {
if (command == 'perform-foo') {
doFooFunction();
}
}
This works on my Mac as an unpacked extension, but it does not work when launched in either Single App Kiosk Mode or normal Kiosk Mode under ChromeOS. I've also written a test app that does not operate in kiosk mode. When I check out the keyboard shortcuts in chrome://extensions
, the apps seems to have successfully, globally installed the correct key combination.
Are keyboard shortcuts via the commands
API enabled for kiosk mode, or CrOS in general? What am I missing here?
From the documentation:
I have had success using commands in kiosk mode on ChromeOS without the global option.