SafariBrowserWindow Class Reference
| Inherits from | |
| Technology area | Safari Extensions |
| Availability | Available in Safari 5.0 and later. |
Overview
Instances of the SafariBrowserWindow class represent browser windows. Each window contains one or more tabs, which display web content.
Properties
activeTab
The tab currently being displayed in the window.
readonly attribute SafariBrowserTab activeTab
Availability
- Available in Safari 5.0 and later.
tabs
The tabs in the window.
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
A Boolean value that indicates whether the window is visible.
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.
Methods
activate
Brings the window to the front and gives it keyboard focus.
Availability
- Available in Safari 5.0 and later.
close
Requests that the window should 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.
insertTab
Inserts a tab into the window.
Parameters
- tab
The tab being inserted.
- index
The location where the tab is being inserted.
Availability
- Available in Safari 5.0 and later.
openTab
Opens a new tab in the window.
Parameters
- visibility
Either
foregroundif the tab should be opened in the foreground, orbackgroundif 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.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-05-09)