This API method allows user scripts to add a menu command to the "User Script Commands" submenu a.k.a the Monkey Menu.
⬆ ⬇ | Examples | See Also | Notes
GM_registerMenuCommand( commandName, commandFunc, accessKey )
Value: Function
Returns: undefined
Compatibility: Greasemonkey 0.2.5 - 3.12.0
Access: @grant
Parameters
| Properties | Event Handlers |
|---|---|
| commandName | commandFunc |
| accessKey |
Value: String
Usage: commandName = "Some Name";
Value: Function
Usage: commandFunc = function () { _/* some code */_ };
Value: String
Usage: accessKey = "g";
GM_registerMenuCommand("Hello, world (simple)", helloSimple);
or
GM_registerMenuCommand("Hello, world!", hello, "h");
Wiki: Greasemonkey_Manual:API
Wiki: Greasemonkey_Manual:Monkey_Menu
Wiki: Version_history