Instance Method

insertSeparator

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

Declaration

SafariExtensionMenuItem insertSeparator(in unsigned long index, in DOMString identifier);

Parameters

index

The index at which the menu item is being inserted.

identifier

The unique identifier of the menu item being inserted.

Return Value

The menu item that was inserted.

Discussion

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

If the value of index is NaN, Infinity, a negative number, or a number greater than the number of items in the menu, the separator is appended at the end of the menu.

See Also

Adding Menu Items

appendMenuItem

Creates a menu item and appends it to the menu.

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.