Instance Method

appendMenuItem

Creates a menu item and appends it to the menu.

Declaration

SafariExtensionMenuItem appendMenuItem(in DOMString identifier, in DOMString title, in DOMString command);

Parameters

identifier

The unique identifier of the menu item.

title

The title of the menu item.

command

The command identifier to send when the menu item is activated. This parameter is optional; the default value is the menu item’s identifier.

Return Value

The menu item that was appended.

Discussion

If a menu item with the same identifier already exists, it is removed from before appending the menu item.

See Also

Adding Menu Items

appendSeparator

Creates a separator menu item and appends it to the menu.

insertMenuItem

Creates a menu item and inserts it in the menu at the given index.

insertSeparator

Creates a separator menu item and inserts it in the menu at the given index.