Technology area | Safari Extensions |
Availability | Available in Safari 5.0 and later. |
Instances of the SafariBrowserTab
class represent tabs in the user’s browser window.
The browser window containing this tab.
readonly attribute SafariBrowserWindow browserWindow
A proxy object for the the web content displayed in the tab.
readonly attribute SafariWebPageProxy page
The tab’s current title.
readonly attribute DOMString title
The tab’s title is the same as the title of the webpage in most cases. For example, the title of the webpage may be truncated for display, but the value of this property is not truncated.
The URL loaded in this tab.
attribute DOMString url
Setting this attribute to a new value loads the page at the new URL in the tab.
Selects the tab.
void activate (void);
Depending on the content that is currently loaded in the tab, this method may change the keyboard focus.
Requests that the tab should close.
void close (void);
This method behaves like clicking the tab’s close button—it does not necessarily cause the tab to close. After a tab closes, the value of all of its properties is undefined
and all of its prototype’s methods return undefined
.
Returns a data URL for an image of the visible contents of the tab.
DOMString visibleContentsAsDataURL (void);
A data URL for an image of the visible contents of the tab.
The image is returned as a base-64 encoded PNG.
Last updated: 2010-06-30