Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Side by Side Diff: chrome/common/extensions/docs/server2/templates/articles/background_pages.html

Issue 10834130: Extensions Docs Server: Doc conversion script - SVN (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <div id="pageData-name" class="pageData">Background Pages</div> 1 <h1>Background Pages</h1>
2 <div id="pageData-showTOC" class="pageData">true</div> 2
3 3
4 <p id="eventPageWarning" class="warning"> 4 <p id="eventPageWarning" class="warning">
5 <em>Caution:</em> Consider using event pages instead. 5 <em>Caution:</em> Consider using event pages instead.
6 <a href="event_pages.html">Learn more</a>. 6 <a href="event_pages.html">Learn more</a>.
7 </p> 7 </p>
8 8
9 <p> 9 <p>
10 A common need for extensions is to have 10 A common need for extensions is to have
11 a single long-running script to manage some task or state. 11 a single long-running script to manage some task or state.
12 Background pages to the rescue. 12 Background pages to the rescue.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 such as user clicks. 107 such as user clicks.
108 </p> 108 </p>
109 109
110 <p> 110 <p>
111 The extension in this example 111 The extension in this example
112 has a background page 112 has a background page
113 and multiple pages created 113 and multiple pages created
114 (with 114 (with
115 <a href="tabs.html#method-create"><code>chrome.tabs.create()</code></a>) 115 <a href="tabs.html#method-create"><code>chrome.tabs.create()</code></a>)
116 from a file named <code>image.html</code>. 116 from a file named <code>image.html</code>.
117 <!-- [PENDING: Once we have our set of samples, we should point to the example t his is from and to other relevant examples. This is currently untested code der ived from the screenshot sample.] --> 117
118 </p> 118 </p>
119 119
120 <pre> 120 <pre>
121 <em>//In background.js:</em> 121 <em>//In background.js:</em>
122 // React when a browser action's icon is clicked. 122 // React when a browser action's icon is clicked.
123 chrome.browserAction.onClicked.addListener(function(tab) { 123 chrome.browserAction.onClicked.addListener(function(tab) {
124 var viewTabUrl = chrome.extension.getURL('image.html'); 124 var viewTabUrl = chrome.extension.getURL('image.html');
125 var imageUrl = <em>/* an image's URL */</em>; 125 var imageUrl = <em>/* an image's URL */</em>;
126 126
127 // Look through all the pages in this extension to find one we can use. 127 // Look through all the pages in this extension to find one we can use.
(...skipping 22 matching lines...) Expand all
150 150
151 &lt;body> 151 &lt;body>
152 &lt;p> 152 &lt;p>
153 Image here: 153 Image here:
154 &lt;/p> 154 &lt;/p>
155 155
156 &lt;img id="target" src="white.png" width="640" height="480"> 156 &lt;img id="target" src="white.png" width="640" height="480">
157 157
158 &lt;/body> 158 &lt;/body>
159 &lt;/html> 159 &lt;/html>
160 </pre> 160 </pre>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698