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.
7 "namespace": "experimental.devtools.audits",
8 "description": "Use the <code>chrome.experimental.devtools.audits</code> API to add new audit categories to the Developer Tools' Audit panel.",
12 "name": "addCategory",
14 "description": "Adds an audit category.",
16 { "name": "displayName", "type": "string", "description": "A display name for the category." },
17 { "name": "resultCount", "type": "number", "description": "The expected number of audit results in the category." }
20 "$ref": "AuditCategory"
26 "id": "AuditCategory",
28 "description": "A group of logically related audit checks.",
31 "name": "onAuditStarted",
33 "description": "If the category is enabled, this event is fired when the audit is started. The event handler is expected to initiate execution of the audit logic that will populate the <code>results</code> collection.",
35 { "name": "results", "$ref": "AuditResults" }
41 "id": "FormattedValue",
43 "additionalProperties": { "type": "any" },
44 "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 $(ref:AuditResults.createSnippet) and $(ref:AuditResults.createURL)."
49 "description": "A collection of audit results for the current run of the audit category.",
54 "description": "Adds an audit result. The results are rendered as bulleted items under the audit category assoicated with the <code>AuditResults</code> object.",
57 "name": "displayName",
59 "description": "A concise, high-level description of the result."
62 "name": "description",
64 "description": "A detailed description of what the displayName means."
68 "$ref": "AuditResultSeverity"
72 "$ref": "AuditResultNode",
74 "description": "A subtree that appears under the added result that may provide additional details on the violations found."
79 "name": "createResult",
81 "description": "Creates a result node that may be used as the <code>details</code> parameters to the <code>addResult()</code> method.",
87 { "$ref": "FormattedValue" }
89 "description": "Either string or formatted values returned by one of the AuditResult formatters (a URL, a snippet etc). If multiple arguments are passed, these will be concatenated into a single node."
93 "$ref": "AuditResultNode"
99 "description": "Signals the DevTools Audits panel that the run of this 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 created."
104 "description": "Render passed value as a URL in the Audits panel.",
106 { "name": "href", "type": "string", "description": "A URL that appears as the href value on the resulting link." },
107 { "name": "displayText", "type": "string", "description": "Text that appears to the user.", "optional": true }
109 "returns": { "$ref": "FormattedValue" }
112 "name": "createSnippet",
114 "description": "Render passed text as a code snippet in the Audits panel.",
116 { "name": "text", "type": "string", "description": "Snippet text." }
118 "returns": { "$ref": "FormattedValue" }
123 "$ref": "AuditResultSeverity",
124 "description": "A class that contains possible values for the audit result severities."
128 "description": "The contents of the node."
133 "items": { "$ref": "AuditResultNode" },
134 "description": "Children of this node."
139 "description": "Whether the node is expanded by default."
144 "id": "AuditResultNode",
146 "description": "A node in the audit result tree. Displays content and may optionally have children nodes.",
150 "description": "Adds a child node to this node.",
155 { "type": "string" },
156 { "$ref": "FormattedValue" }
158 "description": "Either string or formatted values returned by one of the AuditResult formatters (URL, snippet etc). If multiple arguments are passed, these will be concatenated into a single node."
162 "$ref": "AuditResultNode"
169 "description": "If set, the subtree will always be expanded."
174 "id": "AuditResultSeverity",
176 "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.",