Index: chrome/common/extensions/docs/server2/templates/intros/devtools_network.html |
diff --git a/chrome/common/extensions/docs/server2/templates/intros/devtools_network.html b/chrome/common/extensions/docs/server2/templates/intros/devtools_network.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dd493cbe2a561fcab89cd5c77a5385e00a28bdef |
--- /dev/null |
+++ b/chrome/common/extensions/docs/server2/templates/intros/devtools_network.html |
@@ -0,0 +1,56 @@ |
+<!-- BEGIN AUTHORED CONTENT --> |
+<p id="classSummary"> |
+Use the <code>chrome.devtools.network</code> module to retrieve |
+the information about network requests displayed by the Developer Tools |
+in the Network panel. |
+</p><p> |
+See <a href="devtools.html">DevTools APIs summary</a> for |
+general introduction to using Developer Tools APIs</a>. |
+</p> |
+ |
+<h2>Overview</h2> |
+ |
+<p> |
+Network requests information is represented in the HTTP Archive format |
+(<em>HAR</em>). The description of HAR is outside of scope of this document, |
+please refer to <a href= |
+"http://www.softwareishard.com/blog/har-12-spec/"> |
+HAR v1.2 Specification</a>. |
+</p><p> |
+In terms of HAR, the |
+<code>chrome.devtools.network.getHAR()</code> method returns |
+entire <em>HAR log</em>, while |
+<code>chrome.devtools.network.onRequestFinished</code> event |
+provides <em>HAR entry</em> as an argument to the event callback. |
+</p> |
+<p>Note that request content is not provided as part of HAR for efficieny |
+reasons. You may call request's <code>getContent()</code> method to retrieve |
+content. |
+<p>If the Developer Tools window is opened after the page is loaded, |
+some requests may be missing |
+in the array of entries returned by <code>getHAR()</code>. |
+Reload the page to get all requests. |
+In general, the list of |
+requests returned by <code>getHAR()</code> should match that displayed in |
+the Network panel. |
+<h2 id="overview-examples">Examples</h2> |
+ |
+<p>The following code logs URLs of all images larger than 40KB as they are |
+loaded:</p> |
+ |
+<pre> |
+chrome.devtools.network.onRequestFinished.addListener( |
+ function(request) { |
+ if (request.response.bodySize > 40*1024) |
+ chrome.experimental.devtools.console.addMessage( |
+ chrome.experimental.devtools.console.Severity.Warning, |
+ "Large image: " + request.request.url); |
+}); |
+</pre> |
+ |
+<p> |
+You can find more examples that use this API in |
+<a href="samples.html#devtools.network">Samples</a>. |
+</p> |
+ |
+<!-- END AUTHORED CONTENT --> |