hi,
Is there a way i can trigger a keyboard shortcut in my extension ?
I would like to do that because i want to call an action form an other extension and i have no idea how to call it directly.
thanks
how to launch a shortcut
-
- Posts: 3664
- Joined: September 15th, 2010, 9:03 am
Re: how to launch a shortcut
Do you want to trigger a particular command, or actually mimic a keypress and let Firefox decide which command it is currently configured to execute?
-
- Posts: 3
- Joined: August 14th, 2016, 4:42 am
Re: how to launch a shortcut
The latter.
Ideally i would like to launch a particular command but it is part of an external extension i have no control over.
Ideally i would like to launch a particular command but it is part of an external extension i have no control over.
-
- Posts: 3664
- Joined: September 15th, 2010, 9:03 am
Re: how to launch a shortcut
You could hunt down the key element that you're interested in, parse out the command attribute, and fire that command.
The most general way if you absolutely don't know anything about the key command except which key it is, is to init the key event yourself. Everything should behave exactly as if the user pressed the key.
The most general way if you absolutely don't know anything about the key command except which key it is, is to init the key event yourself. Everything should behave exactly as if the user pressed the key.