A container which typically contains a row of buttons. It is a type of box that defaults to horizontal orientation. It can be collapsed with a
grippy when the
toolbar is placed inside a
toolbox. The toolbar should always have an
Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a
toolbox element. You can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the
toolboxid property on the toolbar.
chromeclass-toolbar class may be used to create a toolbar where its visibility depends on the
toolbar flag when opening the window with the
window interface's open() method loads the specified resource into the browsing context (window,
<iframe> or tab) with the specified name. If the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">
More information is available in the XUL tutorial.
Note: Starting in Gecko 1.9.1, toolbar items are moved from the
toolbarpalette and added to the toolbar when a toolbar is first displayed. In earlier versions, a copy of each item was created and placed on the toolbar. This means that the palette now only contains items not already in the toolbar. This introduces a potential compatibility problem for extensions that depend on being able to identify all possible toolbar items by looking in the
<toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="U" label="Users"/> <toolbarbutton id="nav-groups" accesskey="p" label="Groups"/> <toolbarbutton id="nav-events" accesskey="E" label="Events" disabled="true"/> </toolbar> </toolbox>
true, the toolbar will be invisible unless the Alt key is pressed by the user. When set to
false, the default, the toolbar is visible. This only has an effect on Windows and needs to be combined with
toolbar. This will be modified when the user customizes the toolbar. The value of this attribute should be a comma-separated list of item IDs from the
toolbarpaletteor, additionally, any of the following strings: "
iconsizeattribute defines the default for all toolbars that don't specify an icon size.
spring". An empty toolbar has a
toolbaris a member of. This will either be the toolbox's parent (if it's in a
toolbox), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the ID of the toolbox it should be considered to be part of. This makes it possible to have toolbars that are not contained within toolboxes, such as the add-on bar.
insertItem( id, beforeNode, wrapper, beforePermanent )
toolbar. The new item is added just before the item given by the second argument. If the second argument is
null, but the beforePermanent argument is
true, the item is added to the beginning of the toolbar before the first permanent item. Otherwise, if the beforePermanent argument is
false, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will be
nullas it is mainly for the use of the customize dialog.
The id should match an element in the toolbar's
toolbarpalette. Some special ids may also be used to create special spacing items:
separator: A separator, which is drawn as a vertical bar.
spacer: A non-flexible space.
spring: A flexible space.
The method returns the DOM element for the created item.
toolbaroption to no in the window.open method. Otherwise, this option will be ignored for this toolbar and it will always be visible.