function GM_registerMenuCommand(menuText, callbackFunction);
menuText
is a string, the text of the menu item to add. callbackFunction
is a function object. When the menu item is selected, the callbackFunction
function is called.
This function was introduced in Greasemonkey 0.2.6. You should test whether it exists and degrade gracefully if it does not.
Further reading
- POST Interceptor adds menu items to toggle whether the script is active.