Inherits from | |
Technology area | Safari Extensions |
Availability | Available in Safari 5.0 and later. |
Instances of the SafariExtensionToolbarItem
represent items that your extension adds to the Safari toolbar. Users can select which toolbar items are shown by selecting Customize Toolbar in the same way they can add and remove toolbar items that are provided by Safari.
The current badge number.
attribute long badge
The default value is 0, which hides the badge. If you set a value that is too long, the beginning and end of the value will be shown with an ellipsis in the middle.
Setting a value of NaN
or Infinity
is treated as 0. Non-integer values are rounded to the nearest integer.
The containing browser window.
readonly attribute SafariBrowserWindow browserWindow
The command identifier that the toolbar item sends when it is clicked.
attribute DOMString command
This attribute is optional; its value defaults to the value of identifier
.
Setting a value of null
, undefined
, or the empty string has no effect.
A Boolean value that indicates whether the toolbar item is disabled.
attribute boolean disabled
The default value is false
. Nothing happens when the user tries to interact with a toolbar item that is disabled.
The unique identifier of the toolbar item.
readonly attribute DOMString identifier
This attribute is required.
The current image URL.
attribute DOMString image
This attribute can be changed to the URL of an image in the extension bundle. Setting a value of null
, undefined
, or the empty string has no effect.
The label of the toolbar item, as shown in the toolbar’s overflow menu.
attribute DOMString label
This attribute is required. Setting a value of null
, undefined
, or the empty string has no effect.
The label of the toolbar item, as shown in the Customize palette.
readonly attribute DOMString paletteLabel
This attribute is optional; its value defaults to the value of label
.
The tooltip (help tag) of the toolbar item.
attribute DOMString toolTip
This attribute is optional; its value defaults to the value of label
.
Setting a value of null
, undefined
, or the empty string has no effect.
Dispatches a validate event for this toolbar item.
void validate (void);
You should call this method after a state change occurs that is relevant to your validate-event listeners. Safari also automatically sends validate events for many common browser actions, such as switching tabs and navigating to a new page.
Last updated: 2010-07-13