Chromium Code Reviews| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 | 291 |
| 292 <div class="g-unit" id="gc-pagecontent"> | 292 <div class="g-unit" id="gc-pagecontent"> |
| 293 <div id="pageTitle"> | 293 <div id="pageTitle"> |
| 294 <h1 class="page_title">chrome.experimental.devtools.inspectedWindow.* AP Is</h1> | 294 <h1 class="page_title">chrome.experimental.devtools.inspectedWindow.* AP Is</h1> |
| 295 </div> | 295 </div> |
| 296 <!-- TABLE OF CONTENTS --> | 296 <!-- TABLE OF CONTENTS --> |
| 297 <div id="toc"> | 297 <div id="toc"> |
| 298 <h2>Contents</h2> | 298 <h2>Contents</h2> |
| 299 <ol> | 299 <ol> |
| 300 <li> | 300 <li> |
| 301 <a href="#H2-0">Notes</a> | 301 <a href="#H2-0">Overview</a> |
| 302 <ol> | 302 <ol> |
| 303 <li style="display: none; "> | 303 <li style="display: none; "> |
| 304 <a>h3Name</a> | 304 <a>h3Name</a> |
| 305 </li> | 305 </li> |
| 306 </ol> | 306 </ol> |
| 307 </li><li> | 307 </li><li> |
| 308 <a href="#overview-examples">Examples</a> | 308 <a href="#overview-examples">Examples</a> |
| 309 <ol> | 309 <ol> |
| 310 <li style="display: none; "> | 310 <li style="display: none; "> |
| 311 <a>h3Name</a> | 311 <a>h3Name</a> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 <!-- Standard content lead-in for experimental API pages --> | 382 <!-- Standard content lead-in for experimental API pages --> |
| 383 <p id="classSummary"> | 383 <p id="classSummary"> |
| 384 For information on how to use experimental APIs, see the <a href="expe rimental.html">chrome.experimental.* APIs</a> page. | 384 For information on how to use experimental APIs, see the <a href="expe rimental.html">chrome.experimental.* APIs</a> page. |
| 385 </p> | 385 </p> |
| 386 | 386 |
| 387 <!-- STATIC CONTENT PLACEHOLDER --> | 387 <!-- STATIC CONTENT PLACEHOLDER --> |
| 388 <div id="static"><div id="pageData-name" class="pageData">chrome.experim ental.devtools.inspectedWindow.* APIs</div> | 388 <div id="static"><div id="pageData-name" class="pageData">chrome.experim ental.devtools.inspectedWindow.* APIs</div> |
| 389 | 389 |
| 390 <p> | 390 <p> |
| 391 Use <code>chrome.experimental.devtools.inspectedWindow</code> to interact with | 391 Use <code>chrome.experimental.devtools.inspectedWindow</code> to interact with |
| 392 the inspected window: obtain tab ID for the inspected page, evaluate the code | 392 the inspected window: obtain tab ID for the inspected page, evaluate the code |
|
kathyw
2011/11/09 17:43:22
tab ID -> the tab ID
mkearney
2011/11/09 21:19:15
Done.
| |
| 393 in the context of inspected window, reload the page. | 393 in the context of inspected window, reload the page, |
| 394 obtain the list of resources within the page. | |
|
kathyw
2011/11/09 17:43:22
we need a conjunction ("or"?) to finish off this l
mkearney
2011/11/09 21:19:15
Done.
| |
| 394 </p><p> | 395 </p><p> |
| 395 See <a href="experimental.devtools.html">DevTools APIs summary</a> for | 396 See <a href="experimental.devtools.html">DevTools APIs summary</a> for |
| 396 general introduction to using Developer Tools APIs. | 397 general introduction to using Developer Tools APIs. |
| 397 </p> | 398 </p> |
| 398 | 399 |
| 399 <a name="H2-0"></a><h2>Notes</h2> | 400 <a name="H2-0"></a><h2>Overview</h2> |
| 400 <p> | 401 <p> |
| 401 The <a href="#property-tabId"><code>tabId</code></a> property | 402 The <a href="#property-tabId"><code>tabId</code></a> property |
| 402 provides tab identifier that may be used with the <a href="tabs.html"> | 403 provides the tab identifier that may be used with the <a href="tabs.html"> |
|
kathyw
2011/11/09 17:43:22
may be used with the -> you can use if you need to
caseq
2011/11/09 18:22:41
just "you can use with the", perhaps?
mkearney
2011/11/09 21:19:15
worded a little differently - that you can use if
mkearney
2011/11/09 21:19:15
Done.
| |
| 403 <code>chrome.tabs.*</code></a> API calls. | 404 <code>chrome.tabs.*</code></a> API calls. |
| 404 However, please note that <code>chrome.tabs.*</code> API is not | 405 However, please note that <code>chrome.tabs.*</code> API is not |
| 405 exposed to the Developer Tools extension pages due to security considerations | 406 exposed to the Developer Tools extension pages due to security considerations |
| 406 — you will need to pass the tab ID to the background page and invoke | 407 — you will need to pass the tab ID to the background page and invoke |
| 407 the <code>chrome.tabs.*</code> API functions from there. | 408 the <code>chrome.tabs.*</code> API functions from there. |
| 408 </p><p></p> | 409 </p> |
| 410 <p> | |
| 409 The <code>eval()</code> method provides the ability for extensions to execute | 411 The <code>eval()</code> method provides the ability for extensions to execute |
| 410 JavaScript code in the context of the main frame of the inspected page. | 412 JavaScript code in the context of the main frame of the inspected page. |
| 411 This method is different from | 413 This method if powerful when used in the right context, |
|
caseq
2011/11/09 10:24:07
if -> is
also, are you sure we need comma before d
mkearney
2011/11/09 21:19:15
Done.
| |
| 412 <code>chrome.tabs.executeScript()</code> in the following aspects: | 414 and dangerous when used inappropriately. |
| 413 <p></p><ul> | 415 In key instances, |
|
caseq
2011/11/09 10:24:07
"key instances" sounds a bit unclear (what are the
kathyw
2011/11/09 17:43:22
caseq's suggestion sounds good to me.
mkearney
2011/11/09 21:19:15
Done.
mkearney
2011/11/09 21:19:15
Done.
| |
| 416 the <code>chrome.tabs.executeScript()</code> should be used instead. | |
| 417 </p> | |
| 418 <p>Here are the main differences between the | |
| 419 <code>eval()</code> and <code>chrome.tabs.executeScript()</code> methods: | |
| 420 </p><ul> | |
| 414 <li>The <code>eval()</code> method does not | 421 <li>The <code>eval()</code> method does not |
| 415 use an isolated world for the code being evaluated, so the JavaScript state | 422 use an isolated world for the code being evaluated, so the JavaScript state |
| 416 of the inspected window is accessible to the code. | 423 of the inspected window is accessible to the code. |
| 424 Use this method when access to the JavaScript state of the inspected page | |
| 425 is required. | |
| 426 </li><li> | |
| 427 The execution context of the code being evaluated includes the | |
| 428 <a href="http://code.google.com/chrome/devtools/docs/console.html">Developer | |
| 429 Tools console API</a> (e.g. <code>inspect()</code>, <code>$0</code> etc). | |
|
kathyw
2011/11/09 17:43:22
We avoid Latin abbreviations ("e.g.", "i.e.", "etc
mkearney
2011/11/09 21:19:15
Done.
| |
| 417 </li><li> | 430 </li><li> |
| 418 The evaluated code may return a value that is passed to the extension callback. | 431 The evaluated code may return a value that is passed to the extension callback. |
| 419 The returned value has to be a valid JSON object (i.e. may contain only | 432 The returned value has to be a valid JSON object (i.e. may contain only |
| 420 primitive JavaScript types and acyclic references to other JSON | 433 primitive JavaScript types and acyclic references to other JSON |
| 421 objects). | 434 objects). |
| 422 | 435 |
| 423 <em>Please observe extra care while processing the data received from the | 436 <em>Please observe extra care while processing the data received from the |
| 424 inspected page — the execution context is essentially controlled by the | 437 inspected page — the execution context is essentially controlled by the |
| 425 inspected page; a malicious page may affect the data being returned to the | 438 inspected page; a malicious page may affect the data being returned to the |
| 426 extension.</em> | 439 extension.</em> |
| 427 </li><li> | 440 </li></ul> |
| 428 The execution context of the code being evaluated includes the | |
| 429 <a href="http://code.google.com/chrome/devtools/docs/console.html">Developer | |
| 430 Tools console API</a> (e.g. <code>inspect()</code>, <code>$0</code> etc). | |
| 431 </li> | |
| 432 </ul> | |
| 433 <p class="caution"> | 441 <p class="caution"> |
| 434 <strong>Important:</strong> | 442 <strong>Important:</strong> |
| 435 Due to the security considerations explained above, the | 443 Due to the security considerations explained above, the |
| 436 <a href="tabs.html#method-executeScript"><code>chrome.tabs.executeScript()</code ></a> method is the preferred way for an | 444 <a href="tabs.html#method-executeScript"><code>chrome.tabs.executeScript()</code ></a> method is the preferred way for an |
| 437 extension to access DOM data of the inspected page in cases where the access to | 445 extension to access DOM data of the inspected page in cases where the access to |
| 438 JavaScript state of the inspected page is not required. | 446 JavaScript state of the inspected page is not required. |
| 439 </p><p> | 447 </p><p> |
| 440 The <code>reload()</code> method may be used to reload the inspected page. | 448 The <code>reload()</code> method may be used to reload the inspected page. |
| 441 Additionally, the caller can specify an override for the user agent string, | 449 Additionally, the caller can specify an override for the user agent string, |
| 442 a script that will be injected early upon page load, and an option to force | 450 a script that will be injected early upon page load, and an option to force |
| (...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2462 _uff=0; | 2470 _uff=0; |
| 2463 urchinTracker(); | 2471 urchinTracker(); |
| 2464 } | 2472 } |
| 2465 catch(e) {/* urchinTracker not available. */} | 2473 catch(e) {/* urchinTracker not available. */} |
| 2466 </script> | 2474 </script> |
| 2467 <!-- end analytics --> | 2475 <!-- end analytics --> |
| 2468 </div> | 2476 </div> |
| 2469 </div> <!-- /gc-footer --> | 2477 </div> <!-- /gc-footer --> |
| 2470 </div> <!-- /gc-container --> | 2478 </div> <!-- /gc-container --> |
| 2471 </body></html> | 2479 </body></html> |
| OLD | NEW |