diff options
Diffstat (limited to 'chrome/common/extensions/docs/static/background_pages.html')
-rwxr-xr-x | chrome/common/extensions/docs/static/background_pages.html | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/chrome/common/extensions/docs/static/background_pages.html b/chrome/common/extensions/docs/static/background_pages.html index 3d99295..b412635 100755 --- a/chrome/common/extensions/docs/static/background_pages.html +++ b/chrome/common/extensions/docs/static/background_pages.html @@ -1,16 +1,26 @@ <div id="pageData-title" class="pageData">Background Pages</div> -<p>A common need for extensions is to have a single long-running script to manage some task or state. Toolstrips don't quite fit this need, because there can be multiple toolstrips active at any one time (one per browser window). Background pages to the rescue.</p> - -<p>The background page is similar to a toolstrip, in that it is an HTML page that runs in the extension process. The difference is that the background page exists for the lifetime of your extension, and there is only one instance of it active at a time.</p> - -<h3>Status</h3> - -<p>Implemented.</p> - -<h3>Details</h3> - -<p>Register your background page in the extension manifest, like this:</p> +<p> +A common need for extensions is to have +a single long-running script to manage some task or state. +Toolstrips don't quite fit this need, +because multiple toolstrips can be active at any one time +(one per browser window). +Background pages to the rescue. +</p> + +<p> +The background page is similar to a toolstrip, +in that it is an HTML page that runs in the extension process. +The difference is that the background page exists +for the lifetime of your extension, +and only one instance of it at a time is active.</p> + +<h2>Details</h2> + +<p> +Register your background page in the extension manifest, like this: +</p> <pre>{ "name": "My First Extension", @@ -20,9 +30,18 @@ "toolstrips": ["toolstrip.html"] }</pre> -<p>Your toolstrip will likely contain only the necessary code to display the toolstrip UI, with all your extension logic contained in the background page. You can communicate between your various pages using direct script calls, similar to how frames can communicate. The chrome.self.getViews() function returns a list of window objects for every active page belonging to your extension.</p> - -<h3>Example</h3> +<p> +Your toolstrip will likely contain +only the necessary code to display the toolstrip UI, +with all your extension logic contained in the background page. +You can communicate between your various pages using direct script calls, +similar to how frames can communicate. +The chrome.self.getViews() function +returns a list of window objects +for every active page belonging to your extension. +</p> + +<h2>Example</h2> <pre>background_page.html (snippet): function updateUI(checked) { |