2 See
<a href=
"devtools">DevTools APIs summary
</a> for
3 general introduction to using Developer Tools APIs
</a>.
6 <h2 id=
"overview">Overview
</h2>
9 Network requests information is represented in the HTTP Archive format
10 (
<em>HAR
</em>). The description of HAR is outside of scope of this document,
11 please refer to
<a href=
12 "http://www.softwareishard.com/blog/har-12-spec/">
13 HAR v1.2 Specification
</a>.
16 <code>chrome.devtools.network.getHAR()
</code> method returns
17 entire
<em>HAR log
</em>, while
18 <code>chrome.devtools.network.onRequestFinished
</code> event
19 provides
<em>HAR entry
</em> as an argument to the event callback.
21 <p>Note that request content is not provided as part of HAR for efficieny
22 reasons. You may call request's
<code>getContent()
</code> method to retrieve
24 <p>If the Developer Tools window is opened after the page is loaded,
25 some requests may be missing
26 in the array of entries returned by
<code>getHAR()
</code>.
27 Reload the page to get all requests.
28 In general, the list of
29 requests returned by
<code>getHAR()
</code> should match that displayed in
31 <h2 id=
"overview-examples">Examples
</h2>
33 <p>The following code logs URLs of all images larger than
40KB as they are
37 chrome.devtools.network.onRequestFinished.addListener(
39 if (request.response.bodySize
> 40*
1024)
40 chrome.experimental.devtools.console.addMessage(
41 chrome.experimental.devtools.console.Severity.Warning,
42 "Large image: " + request.request.url);
47 You can find more examples that use this API in
48 <a href=
"samples#search:devtools.network">Samples
</a>.