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