Difference between revisions of "GM.registerMenuCommand"
(Starting from: http://greasemonkey.mozdev.org/authoring.html)
m (title underscore template)
|Line 1:||Line 1:|
= Syntax =
= Syntax =
Revision as of 23:09, 3 November 2006
GM_registerMenuCommand( commandName, commandFunc, accelKey, accelModifiers, accessKey )
Userscripts can call GM_registerMenuCommand to add a menu command to the "User Script Commands" submenu. The first two arguments are required; the others are optional.
- Name to display in the menu
- Function to call
- A single character (e.g. 'g') or keycode that can trigger the command
- A string listing modifiers that must be pressed with the accelKey. If there's more than one, then they should be separated with spaces. For example,
'ctrl alt'. Available modifiers are: shift, alt, meta, control, and accel.
- A single character (e.g. 'g') that can be used to jump to the command when the menu is open. It should be a letter in commandName
GM_registerMenuCommand( "Hello world!", hello, "e", "control", "h" );
GM_registerMenuCommand( "Hello world! (again)", hello2, "e", "shift alt", "w" );
GM_registerMenuCommand( "Hello world (simple)", helloSimple );