SafariExtensionGlobalPage Class Reference
Available in Safari 5.0 and later.
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.
Accessing the Global Page
The DOM window object of the extension’s global page.
readonly attribute DOMWindow contentWindow
- Available in Safari 5.0 and later.