OLD | NEW |
1 <p> | 1 <p> |
2 See <a href="devtools">DevTools APIs summary</a> for | 2 See <a href="devtools">DevTools APIs summary</a> for |
3 general introduction to using Developer Tools APIs</a>. | 3 general introduction to using Developer Tools APIs</a>. |
4 </p> | 4 </p> |
5 | 5 |
6 <h2 id="overview">Overview</h2> | 6 <h2 id="overview">Overview</h2> |
7 | 7 |
8 <p> | 8 <p> |
9 Network requests information is represented in the HTTP Archive format | 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, | 10 (<em>HAR</em>). The description of HAR is outside of scope of this document, |
(...skipping 18 matching lines...) Expand all Loading... |
29 requests returned by <code>getHAR()</code> should match that displayed in | 29 requests returned by <code>getHAR()</code> should match that displayed in |
30 the Network panel. | 30 the Network panel. |
31 <h2 id="overview-examples">Examples</h2> | 31 <h2 id="overview-examples">Examples</h2> |
32 | 32 |
33 <p>The following code logs URLs of all images larger than 40KB as they are | 33 <p>The following code logs URLs of all images larger than 40KB as they are |
34 loaded:</p> | 34 loaded:</p> |
35 | 35 |
36 <pre> | 36 <pre> |
37 chrome.devtools.network.onRequestFinished.addListener( | 37 chrome.devtools.network.onRequestFinished.addListener( |
38 function(request) { | 38 function(request) { |
39 if (request.response.bodySize > 40*1024) | 39 if (request.response.bodySize > 40*1024) { |
40 chrome.experimental.devtools.console.addMessage( | 40 chrome.devtools.inspectedWindow.eval( |
41 chrome.experimental.devtools.console.Severity.Warning, | 41 'console.log("Large image: " + unescape("' + |
42 "Large image: " + request.request.url); | 42 escape(request.request.url) + '"))'); |
| 43 } |
43 }); | 44 }); |
44 </pre> | 45 </pre> |
45 | 46 |
46 <p> | 47 <p> |
47 You can find more examples that use this API in | 48 You can find more examples that use this API in |
48 <a href="samples#search:devtools.network">Samples</a>. | 49 <a href="samples#search:devtools.network">Samples</a>. |
49 </p> | 50 </p> |
OLD | NEW |