Safari Developer Library

Developer

SafariBrowserTab Class Reference

Options
Deployment Target:

On This Page

SafariBrowserTab

Inheritance


Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.

Instances of the SafariBrowserTab class represent tabs in the user’s browser window.

  • browserWindow Property

    The browser window containing this tab.

    Declaration

    JavaScript

    readonly attribute SafariBrowserWindow browserWindow

    Availability

    Available in Safari 5.0 and later.

  • reader Property

    The Reader view associated with this tab.

    Declaration

    JavaScript

    readonly attribute SafariReader reader

    Availability

    Available in Safari 5.1 and later.

  • title Property

    The tab’s current title.

    Declaration

    JavaScript

    readonly attribute DOMString title

    Discussion

    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.

    Availability

    Available in Safari 5.0 and later.

  • page Property

    A proxy object for the the web content displayed in the tab.

    Declaration

    JavaScript

    readonly attribute SafariWebPageProxy page

    Availability

    Available in Safari 5.0 and later.

  • url Property

    The URL loaded in this tab.

    Declaration

    JavaScript

    attribute DOMString url

    Discussion

    Setting this attribute to a new value loads the page at the new URL in the tab.

    Availability

    Available in Safari 5.0 and later.

  • Fetches a data URL for an image of the tab’s visible contents.

    Declaration

    JavaScript

    DOMString visibleContentsAsDataURL ();

    Parameters

    callback

    A function that takes a single DOMString argument, the image of the visible contents of the tab as a data URL.

    Discussion

    The data URL is a base-64 encoded PNG.

    Availability

    Available in Safari 5.0 and later.

  • Selects the tab.

    Declaration

    JavaScript

    void activate ();

    Discussion

    Depending on the content that is currently loaded in the tab, this method may change the keyboard focus.

    Availability

    Available in Safari 5.0 and later.

  • Requests that the tab should close.

    Declaration

    JavaScript

    void close ();

    Discussion

    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.

    Availability

    Available in Safari 5.0 and later.