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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 343 } |
344 </pre> | 344 </pre> |
345 <a name="H3-9"></a><h3>Opening a sandboxed page in a window</h3> | 345 <a name="H3-9"></a><h3>Opening a sandboxed page in a window</h3> |
346 <p> | 346 <p> |
347 Just like any other app pages, | 347 Just like any other app pages, |
348 you can create a window that the sandboxed page opens in. | 348 you can create a window that the sandboxed page opens in. |
349 Here's a sample that creates two windows, | 349 Here's a sample that creates two windows, |
350 one for the main app window that isn't sandboxed, | 350 one for the main app window that isn't sandboxed, |
351 and one for the sandboxed page: | 351 and one for the sandboxed page: |
352 </p> | 352 </p> |
353 <pre>chrome.experimental.app.onLaunched.addListener(function() { | 353 <pre>chrome.app.runtime.onLaunched.addListener(function() { |
354 chrome.app.window.create('window.html', { | 354 chrome.app.window.create('window.html', { |
355 'width': 400, | 355 'width': 400, |
356 'height': 400, | 356 'height': 400, |
357 'left': 0, | 357 'left': 0, |
358 'top': 0 | 358 'top': 0 |
359 }); | 359 }); |
360 chrome.app.window.create('sandboxed.html', { | 360 chrome.app.window.create('sandboxed.html', { |
361 'width': 400, | 361 'width': 400, |
362 'height': 400, | 362 'height': 400, |
363 'left': 400, | 363 'left': 400, |
(...skipping 22 matching lines...) Expand all Loading... |
386 </p> | 386 </p> |
387 <a name="H3-12"></a><h3>Post message</h3> | 387 <a name="H3-12"></a><h3>Post message</h3> |
388 <p> | 388 <p> |
389 You can use <code>postMessage</code> to communicate | 389 You can use <code>postMessage</code> to communicate |
390 between your app and sandboxed content. | 390 between your app and sandboxed content. |
391 Here's a sample background script | 391 Here's a sample background script |
392 that posts a message to the sandboxed page it | 392 that posts a message to the sandboxed page it |
393 opens: | 393 opens: |
394 </p> | 394 </p> |
395 <pre>var myWin = null; | 395 <pre>var myWin = null; |
396 chrome.experimental.app.onLaunched.addListener(function() { | 396 chrome.app.runtime.onLaunched.addListener(function() { |
397 chrome.app.window.create('sandboxed.html', { | 397 chrome.app.window.create('sandboxed.html', { |
398 'width': 400, | 398 'width': 400, |
399 'height': 400 | 399 'height': 400 |
400 }, function(win) { | 400 }, function(win) { |
401 myWin = win; | 401 myWin = win; |
402 myWin.postMessage('Just wanted to say hey.', '*'); | 402 myWin.postMessage('Just wanted to say hey.', '*'); |
403 }); | 403 }); |
404 }); | 404 }); |
405 </pre> | 405 </pre> |
406 <p> | 406 <p> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 _uff=0; | 471 _uff=0; |
472 urchinTracker(); | 472 urchinTracker(); |
473 } | 473 } |
474 catch(e) {/* urchinTracker not available. */} | 474 catch(e) {/* urchinTracker not available. */} |
475 </script> | 475 </script> |
476 <!-- end analytics --> | 476 <!-- end analytics --> |
477 </div> | 477 </div> |
478 </div> <!-- /gc-footer --> | 478 </div> <!-- /gc-footer --> |
479 </div> <!-- /gc-container --> | 479 </div> <!-- /gc-container --> |
480 </body></html> | 480 </body></html> |
OLD | NEW |