Safari Developer Library

Developer

SafariBrowserWindow Class Reference

Options
Deployment Target:

On This Page

SafariBrowserWindow

Instances of the SafariBrowserWindow class represent browser windows. Each window contains one or more tabs, which display web content.

Inheritance


Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.
  • tabs Property

    The tabs in the window.

    Declaration

    JavaScript

    readonly attribute array tabs

    Discussion

    The tabs are ordered in the array from left to right.

    Availability

    Available in Safari 5.0 and later.

  • visible Property

    A Boolean value that indicates whether the window is visible.

    Declaration

    JavaScript

    readonly attribute boolean visible

    Discussion

    This attribute is true if the window is being displayed, even if it is covered by other windows. It is false if the window has been minimized.

    Availability

    Available in Safari 5.0 and later.

  • Brings the window to the front and gives it keyboard focus.

    Declaration

    JavaScript

    void activate ();

    Availability

    Available in Safari 5.0 and later.

  • activeTab Property

    The tab currently being displayed in the window.

    Declaration

    JavaScript

    readonly attribute SafariBrowserTab activeTab

    Availability

    Available in Safari 5.0 and later.

  • Requests that the window should close.

    Declaration

    JavaScript

    void close ();

    Discussion

    This method has the same behavior as clicking a window’s close button—clicking does not necessarily cause the window to close. After a window closes, the value of all of its properties is undefined and all of its prototype’s methods return undefined.

    Availability

    Available in Safari 5.0 and later.

  • Opens a new tab in the window.

    Declaration

    JavaScript

    SafariBrowserTab openTab (in DOMString visibility, in unsigned long index);

    Parameters

    visibility

    Either foreground if the tab should be opened in the foreground, or background if it should be opened in the background. Optional.

    index

    The desired location of the new tab. Optional.

    Return Value

    A new tab.

    Discussion

    The default visibility is foreground, used when visibility is omitted or undefined. An invalid value causes an exception.

    Tab indexes start at 0 on the far left and increases going to the right. The default location is at the far right. If index is negative, the tab is inserted at the far left; if index is greater than the number of tabs currently open, the tab is inserted at the far right.

    Availability

    Available in Safari 5.0 and later.

  • Inserts a tab into the window.

    Declaration

    JavaScript

    void insertTab (in SafariBrowserTab tab, in unsigned long index);

    Parameters

    tab

    The tab being inserted.

    index

    The location where the tab is being inserted.

    Availability

    Available in Safari 5.0 and later.