Webextension - how to add command programmatically?

I know there is possible to add comands (hotkeys) with manifes.json) but how to do it when I want user to specify his own hotkeys? He will type his hotkey to form, so I need to add the hotkey dynamically.

Can you give example?

Edit:
So far as I found, it is not possible to do it.

But as I found, it is possible to define commands with no hotkeys and Chrome already has solution because user can redefine the extension hotkeys:
http://stackoverflow.com/questions/13429178/override-the-bookmark-shortcut-ctrld-function-in-chrome/13430063#13430063

So does Firefox have something similar?

I don’t think it does at the moment. I suggest you file a bug here with the details.

I think I did so. But I posted more bugs recently so I am quite not sure about this one. Is there way how could I find out the bugs which I have posted? Something like search by email.

There should be a link at the footer of the page labeled “My Bugs”. You can also use the Search tool and filter by reporter (using your email address).

Could you add the link for the bugzilla please? I would like to up-vote it :slight_smile:
Thanks!

Try to search google with my login name:
bugzilla12345678 commands
You’ll find this link:
https://bugzilla.mozilla.org/show_bug.cgi?id=1303384

BTW:
They said it was a duplicate bug report.

Thank you, I was searching bugzilla with your name “h4ever” but with no luck.
Now just get 100 more votes for that issue and we are good :slight_smile: hehe

how about predefine all possible key combinations in manifest.json? (maybe some hundreds key combinations.)

1 Like