# Webextension - how to add command programmatically?

**URL:** <https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752>\
**Category:** Add-on Support\
**Created:** [July 15, 2016, 10:32am UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752 "2016-07-15T10:32:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![h4ever](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@h4ever](https://discourse.mozilla.org/u/h4ever)\
**Post date:** [July 15, 2016, 10:32am UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/1 "2016-07-15T10:32:27Z")

</div>

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](http://stackoverflow.com/questions/13429178/override-the-bookmark-shortcut-ctrld-function-in-chrome/13430063#13430063)

So does Firefox have something similar?

---

<div class="post-metadata">

**Author:** ![jorgev](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jorgev](https://discourse.mozilla.org/u/jorgev)\
**Post date:** [July 19, 2016, 6:03pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/2 "2016-07-19T18:03:50Z")

</div>

I don’t think it does at the moment. I suggest you [file a bug here](https://bugzilla.mozilla.org/enter_bug.cgi?product=Toolkit&component=WebExtensions) with the details.

---

<div class="post-metadata">

**Author:** ![h4ever](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@h4ever](https://discourse.mozilla.org/u/h4ever)\
**Post date:** [July 19, 2016, 7:02pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/3 "2016-07-19T19:02:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jorgev](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@jorgev](https://discourse.mozilla.org/u/jorgev)\
**Post date:** [July 19, 2016, 7:44pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/4 "2016-07-19T19:44:39Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 13, 2017, 6:50pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/5 "2017-08-13T18:50:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![h4ever](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@h4ever](https://discourse.mozilla.org/u/h4ever)\
**Post date:** [August 13, 2017, 10:14pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/6 "2017-08-13T22:14:03Z")

</div>

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

BTW:  
They said it was a duplicate bug report.

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 13, 2017, 10:23pm UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/7 "2017-08-13T22:23:32Z")

</div>

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 🙂 hehe

---

<div class="post-metadata">

**Author:** ![zoqtoydr](https://avatars.discourse-cdn.com/v4/letter/z/bc79bd/32.png) [@zoqtoydr](https://discourse.mozilla.org/u/zoqtoydr)\
**Post date:** [September 19, 2017, 12:15am UTC](https://discourse.mozilla.org/t/webextension-how-to-add-command-programmatically/9752/8 "2017-09-19T00:15:44Z")

</div>

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