Safari Reference Library Apple Developer
Search

SafariExtensionGlobalPage Class Reference

Technology area
Safari Extensions
Availability
Available in Safari 5.0 and later.

Overview

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 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 consistant 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.

Tasks

Accessing the Global Page

Properties

contentWindow

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

readonly attribute DOMWindow contentWindow
Availability



Last updated: 2010-07-02

Did this document help you? Yes It's good, but... Not helpful...