I tried to download the Web Extension Example called Commands and it I can’t get it to run. I was able to run the Your first extension example no problem, but with Commands I get an error when I press the shortcut key in the example i.e. Ctrl+Shift+U (see below). Any thoughts? I’m running Firefox 57.0.2 if that helps. No changes were made to the original code. Thanks in advance.
Can you post the actual command?
Note that is must be uppercase U and not u (I don’t know why, I found that out when trying in one of my add-ons) so "Ctrl+Shift+U"
I believe it’s closer. I changed the shortcut key to Ctrl+Shift+J, now I don’t get an error, but I don’t see a message in the console either when I enter the shortcut key combination (which should be something like “onCommand event received for message: command”).
Isn’t this a bug though? I’ve just wasted a few hours trying to bind a command to various Ctrl+Shift+LETTER variants, only to discover that only function keys seem to function. The docs don’t mention anything about this and the given examples indicate that this should work.
Thanks for the suggestion! I’ve been trying mostly Ctrl+Shift+Z (which is reserved by Firefox, according to the link you provided, so no surprise it didn’t work) and Ctrl+Shift+X (which is supposed to be free, but isn’t).
I guess it’s working after all, even though I don’t understand why Ctrl+Shift+X isn’t working for me when running the extension with web-ext run.