Safari Developer Library

Developer

SafariExtensionBar Class Reference

Options
Deployment Target:

On This Page

SafariExtensionBar

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

    readonly attribute boolean visible

  • Hides the bar.

    Declaration

    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.

  • Shows the bar.

    Declaration

    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.

  • identifier Property

    The unique identifier of the bar.

    Declaration

    readonly attribute DOMString identifier

  • label Property

    The title of the bar.

    Declaration

    attribute DOMString label

    Discussion

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