Safari Reference Library Apple Developer
Search

SafariExtensionBar Class Reference

Inherits from
Technology area
Safari Extensions
Availability
Available in Safari 5.0 and later.

Overview

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.

Tasks

Bar Visibility

Accessing Windows

Identifying Bars

Properties

browserWindow

The browser window containing the bar.

readonly attribute SafariBrowserWindow browserWindow
Availability

contentWindow

The DOM window object of the bar.

readonly attribute DOMWindow contentWindow
Availability

identifier

The unique identifier of the bar.

readonly attribute DOMString identifier
Availability

label

The title of the bar.

attribute DOMString label
Discussion

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

Availability

visible

A Boolean value that indicates whether the bar is visible.

readonly attribute boolean visible
Availability

Methods

hide

Hides the bar.

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.

show

Shows the bar.

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.



Last updated: 2010-07-13

Did this document help you? Yes It's good, but... Not helpful...