Safari Developer Library

Developer

SafariExtensionGlobalPage Class Reference

Options
Deployment Target:

On This Page

SafariExtensionGlobalPage

Safari extensions have a global page, represented by the SafariExtensionGlobalPage class. The global page is loaded once when the extension is loaded, but it is never displayed to the user. It can contain resources such as scripts, images, and HTML content.

The global page is a good place to run scripts that should be run only once for all of Safari and to store data that is displayed in multiple locations. For example, a stock ticker extension could use a script on its global page fetch and store the stock prices. This makes it easier to keep the user interface consistent by allowing the extension to maintain only one source data; this also uses less memory than making a copy of the data for each window.

Inheritance


  • SafariExtensionGlobalPage

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.
  • contentWindow Property

    The DOM window object of the extension’s global page.

    Declaration

    JavaScript

    readonly attribute DOMWindow contentWindow

    Availability

    Available in Safari 5.0 and later.