Chromium Code Reviews| Index: chrome/common/extensions/docs/experimental.devtools.inspectedWindow.html |
| =================================================================== |
| --- chrome/common/extensions/docs/experimental.devtools.inspectedWindow.html (revision 109075) |
| +++ chrome/common/extensions/docs/experimental.devtools.inspectedWindow.html (working copy) |
| @@ -298,7 +298,7 @@ |
| <h2>Contents</h2> |
| <ol> |
| <li> |
| - <a href="#H2-0">Notes</a> |
| + <a href="#H2-0">Overview</a> |
| <ol> |
| <li style="display: none; "> |
| <a>h3Name</a> |
| @@ -390,31 +390,44 @@ |
| <p> |
| Use <code>chrome.experimental.devtools.inspectedWindow</code> to interact with |
| 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.
|
| -in the context of inspected window, reload the page. |
| +in the context of inspected window, reload the page, |
| +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.
|
| </p><p> |
| See <a href="experimental.devtools.html">DevTools APIs summary</a> for |
| general introduction to using Developer Tools APIs. |
| </p> |
| -<a name="H2-0"></a><h2>Notes</h2> |
| +<a name="H2-0"></a><h2>Overview</h2> |
| <p> |
| The <a href="#property-tabId"><code>tabId</code></a> property |
| -provides tab identifier that may be used with the <a href="tabs.html"> |
| +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.
|
| <code>chrome.tabs.*</code></a> API calls. |
| However, please note that <code>chrome.tabs.*</code> API is not |
| exposed to the Developer Tools extension pages due to security considerations |
| — you will need to pass the tab ID to the background page and invoke |
| the <code>chrome.tabs.*</code> API functions from there. |
| -</p><p></p> |
| +</p> |
| +<p> |
| The <code>eval()</code> method provides the ability for extensions to execute |
| JavaScript code in the context of the main frame of the inspected page. |
| -This method is different from |
| -<code>chrome.tabs.executeScript()</code> in the following aspects: |
| -<p></p><ul> |
| +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.
|
| +and dangerous when used inappropriately. |
| +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.
|
| +the <code>chrome.tabs.executeScript()</code> should be used instead. |
| +</p> |
| +<p>Here are the main differences between the |
| +<code>eval()</code> and <code>chrome.tabs.executeScript()</code> methods: |
| +</p><ul> |
| <li>The <code>eval()</code> method does not |
| use an isolated world for the code being evaluated, so the JavaScript state |
| of the inspected window is accessible to the code. |
| +Use this method when access to the JavaScript state of the inspected page |
| +is required. |
| </li><li> |
| +The execution context of the code being evaluated includes the |
| +<a href="http://code.google.com/chrome/devtools/docs/console.html">Developer |
| +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.
|
| +</li><li> |
| The evaluated code may return a value that is passed to the extension callback. |
| The returned value has to be a valid JSON object (i.e. may contain only |
| primitive JavaScript types and acyclic references to other JSON |
| @@ -424,12 +437,7 @@ |
| inspected page — the execution context is essentially controlled by the |
| inspected page; a malicious page may affect the data being returned to the |
| extension.</em> |
| -</li><li> |
| -The execution context of the code being evaluated includes the |
| -<a href="http://code.google.com/chrome/devtools/docs/console.html">Developer |
| -Tools console API</a> (e.g. <code>inspect()</code>, <code>$0</code> etc). |
| -</li> |
| -</ul> |
| +</li></ul> |
| <p class="caution"> |
| <strong>Important:</strong> |
| Due to the security considerations explained above, the |