Skip to content

GM_enableMenuCommand

supahgreg edited this page May 29, 2011 · 4 revisions

Description

GM_enableMenuCommand allows a user script to enable a disabled menu item from Scriptish's "User Script Commands" menu, which is created with GM_registerMenuCommand.

Note: No menu command is created when the user script is run in a iframe window.

Arguments

String commandID

The UUID of a menu item created with GM_registerMenuCommand.

Returns

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

Examples

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
Clone this wiki locally