Any command registered with Venkman's command manager can be placed in a menu. The menuSpecs property of the console object defines the list of menus available in Venkman.

Venkman's Debug menu is shown in the example below. The label property is a string containing the textual label for this menu. In this example, MSG_MNU_DEBUG is the string ``&Debug''. The items property is an array of commands to include in the menu.

The first column in the items array is either a command name, a menu name, or a spacer. Menu names are differentiated from command names by a leading greater-than character, '>' (notice the ">popup:emode" entry in the example.) A spacer is denoted by a dash, '-'.

Condition Meaning
enabledif Must evaluate to true in order for the menu item to be enabled.
visibleif Must evaluate to true in order for the menu item to be shown in the menu.
checkedif If the condition evaluates to true, the checked attribute of this menu item will be set, otherwise the attribute will be removed.
The optional second column of the items array is a list of attributes to set on the <xul:menuitem> node that will eventually represent this menu item. Commands can specify JavaScript expressions in special attributes that will govern how the menu item is displayed. The table above enumerates these special attributes.

From venkman-menus.js...
function initMenus()
{    
<... snip ...>
    console.menuSpecs["mainmenu:debug"] = {
        label: MSG_MNU_DEBUG,
        items:
        [
         ["stop",
                 {type: "checkbox",
                  checkedif: "console.jsds.interruptHook"}],
         ["cont"],
         ["next"],
         ["step"],
         ["finish"],
         ["-"],
         [">popup:emode"],
         [">popup:tmode"],
         ["-"],
         ["toggle-chrome",
                 {type: "checkbox",
                  checkedif: "console.prefs['enableChromeFilter']"}]
        ]
    };
<... snip ...>
}