erikvold edited this page Dec 24, 2011 · 4 revisions


GM_enableMenuCommand allows a user script to enable a disabled menu item (created with GM_registerMenuCommand) in Scriptish's "User Script Commands" menu.

Note: No menu command is created when the user script is run in a iframe window. User scripts are only allowed to modify their own menu commands.


String commandID

The UUID of a menu item created with GM_registerMenuCommand.


Boolean True if the menu item was enabled. False if a matching menu item was not found.


function sayHello() { alert("Hello, world!"); }
var menuID = GM_registerMenuCommand("Hello, world (simple)", sayHello);  // adds a menu item
GM_disableMenuCommand(menuID);  // disables a menu item
GM_enableMenuCommand(menuID);  // enables a menu item

Related Pages

Manual: API