Technology area | Safari Extensions |
Availability | Available in Safari 5.0 and later. |
Instances of the SafariBrowserWindow
class represent browser windows. Each window contains one or more tabs, which display web content.
The tab currently being displayed in the window.
readonly attribute SafariBrowserTab activeTab
The tabs in the window.
readonly attribute array tabs
The tabs are ordered in the array from left to right.
A Boolean value that indicates whether the window is visible.
readonly attribute boolean visible
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.
Brings the window to the front and gives it keyboard focus.
void activate (void);
Requests that the window should close.
void close (void);
This method behaves like clicking the window’s close button—it 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
.
Inserts a tab into the window.
void insertTab (in SafariBrowserTab tab, in long index);
The tab being inserted.
The location where the tab is being inserted.
Opens a new tab in the window.
SafariBrowserTab openTab (in DOMString visibility, in long index);
Either foreground
if the tab should be opened in the foreground, or background
if it should be opened in the background. Optional.
The desired location of the new tab. Optional.
A new tab.
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.
Last updated: 2010-06-29