Safari Developer Library

Developer

SafariExtensionBar Class Reference

Options
Deployment Target:

On This Page

SafariExtensionBar

Inheritance


Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.

Instances of the SafariExtensionBar class represent a bar that your extension provides. An extension can add any number of bars to Safari. Adding bars is optional.

Safari creates a separate instance of the bars from your extensions for every window. Thus, if the user opens multiple Safari windows, there are multiple SafariExtensionBar objects representing the same bar — one in each window. Also, if the user doesn’t have any Safari windows open, there are no SafariExtensionBar objects.

To access the array of all bars added by your extension, use the SafariExtension method bars.

  • visible Property

    A Boolean value that indicates whether the bar is visible.

    Declaration

    JavaScript

    readonly attribute boolean visible

    Availability

    Available in Safari 5.0 and later.

  • Hides the bar.

    Declaration

    JavaScript

    void hide (in boolean doNotRemember);

    Parameters

    doNotRemember

    If true, new bars with the same identifier should be also be hidden in the future. Defaults to false.

    Discussion

    If the bar is already hidden, does nothing.

    Availability

    Available in Safari 5.0 and later.

  • Shows the bar.

    Declaration

    JavaScript

    void show (in boolean doNotRemember);

    Parameters

    doNotRemember

    If true, new bars with the same identifier should also be shown. Defaults to false.

    Discussion

    If the bar is already being shown, does nothing.

    Availability

    Available in Safari 5.0 and later.

  • browserWindow Property

    The browser window containing the bar.

    Declaration

    JavaScript

    readonly attribute SafariBrowserWindow browserWindow

    Availability

    Available in Safari 5.0 and later.

  • contentWindow Property

    The DOM window object of the bar.

    Declaration

    JavaScript

    readonly attribute DOMWindow contentWindow

    Availability

    Available in Safari 5.0 and later.

  • identifier Property

    The unique identifier of the bar.

    Declaration

    JavaScript

    readonly attribute DOMString identifier

    Availability

    Available in Safari 5.0 and later.

  • label Property

    The title of the bar.

    Declaration

    JavaScript

    attribute DOMString label

    Discussion

    Setting an empty string, null, or undefined has no effect.

    Availability

    Available in Safari 5.0 and later.