OLD | NEW |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: |
2 1) The <head> information in this page is significant, should be uniform | 2 1) The <head> information in this page is significant, should be uniform |
3 across api docs and should be edited only with knowledge of the | 3 across api docs and should be edited only with knowledge of the |
4 templating mechanism. | 4 templating mechanism. |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a |
6 browser, it will be re-generated from the template, json schema and | 6 browser, it will be re-generated from the template, json schema and |
7 authored overview content. | 7 authored overview content. |
8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 "foo.js", | 248 "foo.js", |
249 "background.js" | 249 "background.js" |
250 ] | 250 ] |
251 } | 251 } |
252 </pre> | 252 </pre> |
253 <p> | 253 <p> |
254 Your event page must include the <code>onLaunched()</code> function. | 254 Your event page must include the <code>onLaunched()</code> function. |
255 This function is called | 255 This function is called |
256 when your application is launched in any way: | 256 when your application is launched in any way: |
257 </p> | 257 </p> |
258 <pre>chrome.experimental.app.onLaunched.addListener(function() { | 258 <pre>chrome.app.runtime.onLaunched.addListener(function() { |
259 // Tell your app what to launch and how. | 259 // Tell your app what to launch and how. |
260 }); | 260 }); |
261 </pre> | 261 </pre> |
262 <a name="H3-3"></a><h3>Create windows</h3> | 262 <a name="H3-3"></a><h3>Create windows</h3> |
263 <p> | 263 <p> |
264 An event page may create one or more windows at its discretion. | 264 An event page may create one or more windows at its discretion. |
265 By default, these windows are created with a script connection | 265 By default, these windows are created with a script connection |
266 to the event page and are directly scriptable by the event page. | 266 to the event page and are directly scriptable by the event page. |
267 </p> | 267 </p> |
268 <p> | 268 <p> |
269 Windows can either be shells or panels. | 269 Windows can either be shells or panels. |
270 Shell windows have no browser chrome. | 270 Shell windows have no browser chrome. |
271 Panel windows are the same as shell windows, | 271 Panel windows are the same as shell windows, |
272 except they have different size and position restrictions, | 272 except they have different size and position restrictions, |
273 for example, a chat panel. | 273 for example, a chat panel. |
274 </p> | 274 </p> |
275 <p>Here's a sample <code>background.js</code> | 275 <p>Here's a sample <code>background.js</code> |
276 with a 'shell' window:</p> | 276 with a 'shell' window:</p> |
277 <pre>chrome.experimental.app.onLaunched.addListener(function() { | 277 <pre>chrome.app.runtime.onLaunched.addListener(function() { |
278 chrome.app.window.create('main.html', { | 278 chrome.app.window.create('main.html', { |
279 width: 800, | 279 width: 800, |
280 height: 600, | 280 height: 600, |
281 minWidth: 800, | 281 minWidth: 800, |
282 minHeight: 600, | 282 minHeight: 600, |
283 left: 100, | 283 left: 100, |
284 top: 100, | 284 top: 100, |
285 type: 'shell' | 285 type: 'shell' |
286 }); | 286 }); |
287 }); | 287 }); |
288 </pre> | 288 </pre> |
289 <p>Here's a sample <code>background.js</code> | 289 <p>Here's a sample <code>background.js</code> |
290 with a 'panel' window: | 290 with a 'panel' window: |
291 </p> | 291 </p> |
292 <pre>chrome.experimental.app.onLaunched.addListener(function() { | 292 <pre>chrome.app.runtime.onLaunched.addListener(function() { |
293 chrome.app.window.create('index.html', { | 293 chrome.app.window.create('index.html', { |
294 width: 400, | 294 width: 400, |
295 height: 200, | 295 height: 200, |
296 type: 'panel' | 296 type: 'panel' |
297 }); | 297 }); |
298 }); | 298 }); |
299 </pre> | 299 </pre> |
300 <a name="H3-4"></a><h3>Including Launch Data</h3> | 300 <a name="H3-4"></a><h3>Including Launch Data</h3> |
301 <p> | 301 <p> |
302 Depending on how your app is launched, | 302 Depending on how your app is launched, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 _uff=0; | 423 _uff=0; |
424 urchinTracker(); | 424 urchinTracker(); |
425 } | 425 } |
426 catch(e) {/* urchinTracker not available. */} | 426 catch(e) {/* urchinTracker not available. */} |
427 </script> | 427 </script> |
428 <!-- end analytics --> | 428 <!-- end analytics --> |
429 </div> | 429 </div> |
430 </div> <!-- /gc-footer --> | 430 </div> <!-- /gc-footer --> |
431 </div> <!-- /gc-container --> | 431 </div> <!-- /gc-container --> |
432 </body></html> | 432 </body></html> |
OLD | NEW |