OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 [ | |
6 { | |
7 "namespace": "devtools.network", | |
8 "nocompile": true, | |
9 "types": [ | |
10 { | |
11 "id": "Request", | |
12 "type": "object", | |
13 "description": "Represents a network request for a document resource (sc ript, image and so on). See HAR Specification for reference.", | |
14 "functions": [ | |
15 { | |
16 "name": "getContent", | |
17 "type": "function", | |
18 "description": "Returns content of the response body.", | |
19 "parameters": [ | |
20 { | |
21 "name": "callback", | |
22 "type": "function", | |
23 "description": "A function that receives the response body when the request completes.", | |
24 "parameters": [ | |
25 { | |
26 "name": "content", | |
27 "type": "string", | |
28 "description": "Content of the response body (potentially en coded)." | |
29 }, | |
30 { | |
31 "name": "encoding", | |
32 "type": "string", | |
33 "description": "Empty if content is not encoded, encoding na me otherwise. Currently, only base64 is supported." | |
34 } | |
35 ] | |
36 } | |
37 ] | |
38 } | |
39 ] | |
40 } | |
41 ], | |
42 "functions": [ | |
43 { | |
44 "name": "getHAR", | |
45 "type": "function", | |
46 "description": "Returns HAR log that contains all known network requests .", | |
47 "parameters": [ | |
48 { | |
49 "name": "callback", | |
50 "type": "function", | |
51 "description": "A function that receives the HAR log when the reques t completes.", | |
52 "parameters": [ | |
53 { | |
54 "name": "harLog", | |
55 "type": "any", | |
cduvall
2012/07/19 22:54:16
FYI, I changed this and a few others from "object"
not at google - send to devlin
2012/07/20 00:26:35
I'm not sure this is right though. Looking at HAR,
cduvall
2012/07/20 00:31:09
It throws the exception here: http://code.google.c
| |
56 "description": "A HAR log. See HAR specification for details." | |
57 } | |
58 ] | |
59 } | |
60 ] | |
61 } | |
62 ], | |
63 "events": [ | |
64 { | |
65 "name": "onRequestFinished", | |
66 "type": "function", | |
67 "description": "Fired when a network request is finished and all request data are available.", | |
68 "parameters": [ | |
69 { "name": "request", "$ref": "Request", "description": "Description of a network request in the form of a HAR entry. See HAR specification for details ." } | |
70 ] | |
71 }, | |
72 { | |
73 "name": "onNavigated", | |
74 "type": "function", | |
75 "description": "Fired when the inspected window navigates to a new page. ", | |
76 "parameters": [ | |
77 { | |
78 "name": "url", | |
79 "type": "string", | |
80 "description": "URL of the new page." | |
81 } | |
82 ] | |
83 } | |
84 ] | |
85 }, | |
86 { | |
87 "namespace": "experimental.devtools.console", | |
88 "nocompile": true, | |
89 "functions": [ | |
90 { | |
91 "name": "addMessage", | |
92 "type": "function", | |
93 "description": "Adds a message to the console.", | |
94 "parameters": [ | |
95 { "name": "severity", "$ref": "Severity", "description": "The severity of the message." }, | |
96 { "name": "text", "type": "string", "description": "The text of the me ssage." } | |
97 ] | |
98 }, | |
99 { | |
100 "name": "getMessages", | |
101 "type": "function", | |
102 "description": "Retrieves console messages.", | |
103 "parameters": [ | |
104 { | |
105 "name": "callback", | |
106 "type": "function", | |
107 "description": "A function that receives console messages when the r equest completes.", | |
108 "parameters": [ | |
109 { | |
110 "name": "messages", | |
111 "type": "array", | |
112 "items": { "$ref": "ConsoleMessage" }, | |
113 "description": "Console messages." | |
114 } | |
115 ] | |
116 } | |
117 ] | |
118 } | |
119 ], | |
120 "types": [ | |
121 { | |
122 "id": "ConsoleMessage", | |
123 "type": "object", | |
124 "description": "A console message.", | |
125 "properties": { | |
126 "severity": { | |
127 "$ref": "Severity", | |
128 "description": "Message severity." | |
129 }, | |
130 "text": { | |
131 "type": "string", | |
132 "description": "The text of the console message, as represented by t he first argument to the console.log() or a similar method (no parameter substit ution performed)." | |
133 }, | |
134 "url": { | |
135 "type": "string", | |
136 "optional": true, | |
137 "description": "The URL of the script that originated the message, i f available." | |
138 }, | |
139 "line": { | |
140 "type": "number", | |
141 "optional": true, | |
142 "description": "The number of the line where the message originated, if available." | |
143 } | |
144 } | |
145 }, | |
146 { | |
147 "id": "Severity", | |
148 "type": "object", | |
149 "properties": { | |
150 "Tip": { | |
151 "type": "string" | |
152 }, | |
153 "Debug": { | |
154 "type": "string" | |
155 }, | |
156 "Log": { | |
157 "type": "string" | |
158 }, | |
159 "Warning": { | |
160 "type": "string" | |
161 }, | |
162 "Error": { | |
163 "type": "string" | |
164 } | |
165 } | |
166 } | |
167 ], | |
168 "events": [ | |
169 { | |
170 "name": "onMessageAdded", | |
171 "type": "function", | |
172 "description": "Fired when a new message is added to the console.", | |
173 "parameters": [ | |
174 { "name": "message", "$ref": "ConsoleMessage" } | |
175 ] | |
176 } | |
177 ] | |
178 }, | |
179 { | |
180 "namespace": "experimental.devtools.audits", | |
181 "nocompile": true, | |
182 "functions": [ | |
183 { | |
184 "name": "addCategory", | |
185 "type": "function", | |
186 "description": "Adds an audit category.", | |
187 "parameters": [ | |
188 { "name": "displayName", "type": "string", "description": "A display n ame for the category." }, | |
189 { "name": "resultCount", "type": "number", "description": "The expecte d number of audit results in the category." } | |
190 ], | |
191 "returns": { | |
192 "$ref": "AuditCategory" | |
193 } | |
194 } | |
195 ], | |
196 "types": [ | |
197 { | |
198 "id": "AuditCategory", | |
199 "type": "object", | |
200 "description": "A group of logically related audit checks.", | |
201 "events": [ | |
202 { | |
203 "name": "onAuditStarted", | |
204 "type": "function", | |
205 "description": "If the category is enabled, this event is fired when the audit is started. The event handler is expected to initiate execution of th e audit logic that will populate the <code>results</code> collection.", | |
206 "parameters": [ | |
207 { "name": "results", "$ref": "AuditResults" } | |
208 ] | |
209 } | |
210 ] | |
211 }, | |
212 { | |
213 "id": "FormattedValue", | |
214 "type": "object", | |
215 "description": "A value returned from one of the formatters (a URL, code snippet etc), to be passed to <code>createResult()</code> or <code>addChild()</ code>. See <a href=\"#method-AuditResults-createSnippet\"><code>createSnippet()< /code></a> and <a href=\"#method-AuditResults-createURL\"><code>createURL()</cod e></a>." | |
216 }, | |
217 { | |
218 "id": "AuditResults", | |
219 "type": "object", | |
220 "description": "A collection of audit results for the current run of the audit category.", | |
221 "functions": [ | |
222 { | |
223 "name": "addResult", | |
224 "type": "function", | |
225 "description": "Adds an audit result. The results are rendered as bu lleted items under the audit category assoicated with the <code>AuditResults</co de> object.", | |
226 "parameters": [ | |
227 { | |
228 "name": "displayName", | |
229 "type": "string", | |
230 "description": "A concise, high-level description of the result. " | |
231 }, | |
232 { | |
233 "name": "description", | |
234 "type": "string", | |
235 "description": "A detailed description of what the displayName m eans." | |
236 }, | |
237 { | |
238 "name": "severity", | |
239 "$ref": "AuditResultSeverity" | |
240 }, | |
241 { | |
242 "name": "details", | |
243 "$ref": "AuditResultNode", | |
244 "optional": true, | |
245 "description": "A subtree that appears under the added result th at may provide additional details on the violations found." | |
246 } | |
247 ] | |
248 }, | |
249 { | |
250 "name": "createResult", | |
251 "type": "function", | |
252 "description": "Creates a result node that may be used as the <code> details</code> parameters to the <code>addResult()</code> method.", | |
253 "parameters": [ | |
254 { | |
255 "name": "content ...", | |
256 "choices": [ | |
257 { "type": "string" }, | |
258 { "$ref": "FormattedValue" } | |
259 ], | |
260 "description": "Either string or formatted values returned by on e of the AuditResult formatters (a URL, a snippet etc). If multiple arguments ar e passed, these will be concatenated into a single node." | |
261 } | |
262 ], | |
263 "returns": { | |
264 "$ref": "AuditResultNode" | |
265 } | |
266 }, | |
267 { | |
268 "name": "done", | |
269 "type": "function", | |
270 "description": "Signals the DevTools Audits panel that the run of th is category is over. The audit run also completes automatically when the number of added top-level results is equal to that declared when AuditCategory was crea ted." | |
271 }, | |
272 { | |
273 "name": "createURL", | |
274 "type": "function", | |
275 "description": "Render passed value as a URL in the Audits panel.", | |
276 "parameters": [ | |
277 { "name": "href", "type": "string", "description": "A URL that app ears as the href value on the resulting link." }, | |
278 { "name": "displayText", "type": "string", "description": "Text th at appears to the user.", "optional": true } | |
279 ], | |
280 "returns": { "$ref": "FormattedValue" } | |
281 }, | |
282 { | |
283 "name": "createSnippet", | |
284 "type": "function", | |
285 "description": "Render passed text as a code snippet in the Audits p anel.", | |
286 "parameters": [ | |
287 { "name": "text", "type": "string", "description": "Snippet text." } | |
288 ], | |
289 "returns": { "$ref": "FormattedValue" } | |
290 } | |
291 ], | |
292 "properties": { | |
293 "Severity": { | |
294 "$ref": "AuditResultSeverity", | |
295 "description": "A class that contains possible values for the audit result severities." | |
296 }, | |
297 "text": { | |
298 "type": "string", | |
299 "description": "The contents of the node." | |
300 }, | |
301 "children": { | |
302 "optional": true, | |
303 "type": "array", | |
304 "items": { "$ref": "AuditResultNode" }, | |
305 "description": "Children of this node." | |
306 }, | |
307 "expanded": { | |
308 "optional": "true", | |
309 "type": "boolean", | |
310 "description": "Whether the node is expanded by default." | |
311 } | |
312 } | |
313 }, | |
314 { | |
315 "id": "AuditResultNode", | |
316 "type": "object", | |
317 "description": "A node in the audit result tree. Displays content and ma y optionally have children nodes.", | |
318 "functions": [ | |
319 { | |
320 "name": "addChild", | |
321 "description": "Adds a child node to this node.", | |
322 "parameters": [ | |
323 { | |
324 "name": "content ...", | |
325 "choices": [ | |
326 { "type": "string" }, | |
327 { "$ref": "FormattedValue" } | |
328 ], | |
329 "description": "Either string or formatted values returned by on e of the AuditResult formatters (URL, snippet etc). If multiple arguments are pa ssed, these will be concatenated into a single node." | |
330 } | |
331 ], | |
332 "returns": { | |
333 "$ref": "AuditResultNode" | |
334 } | |
335 } | |
336 ], | |
337 "properties": { | |
338 "expanded": { | |
339 "type": "boolean", | |
340 "description": "If set, the subtree will always be expanded." | |
341 } | |
342 } | |
343 }, | |
344 { | |
345 "id": "AuditResultSeverity", | |
346 "type": "object", | |
347 "description": "This type contains possible values for a result severity . The results of different severities are distinguished by colored bullets near the result's display name.", | |
348 "properties": { | |
349 "Info": { | |
350 "type": "string" | |
351 }, | |
352 "Warning": { | |
353 "type": "string" | |
354 }, | |
355 "Severe": { | |
356 "type": "string" | |
357 } | |
358 } | |
359 } | |
360 ] | |
361 } | |
362 ] | |
OLD | NEW |