Name
GM_registerMenuCommand — add a menu item to the User Script Commands submenu
Synopsis
function GM_registerMenuCommand( |
menuText, | |
callbackFunction);
|
Description
GM_registerMenuCommand adds a menu item to the Tools → User Script Commands menu. The menuText argument is a string, the text of the menu item to add. The callbackFunction argument is a function object. When the menu item is selected, the callbackFunction function is called.
function callbackFunction(e);
The e parameter is the menu selection event. I'm not sure if this is useful for anything.
Bugs
There is no way to set a menu accelerator key. Calling GM_registerMenuCommand('Some &menu text', will create a menu item titled “myFunction)Some &menu text”. (Bug 10090)