Index: chrome/common/extensions/api/devtools/network.json |
diff --git a/chrome/common/extensions/api/devtools/network.json b/chrome/common/extensions/api/devtools/network.json |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5b5ee96f3b53d40ce09cb224441ea6b846d6e833 |
--- /dev/null |
+++ b/chrome/common/extensions/api/devtools/network.json |
@@ -0,0 +1,362 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+[ |
+ { |
+ "namespace": "devtools.network", |
+ "nocompile": true, |
+ "types": [ |
+ { |
+ "id": "Request", |
+ "type": "object", |
+ "description": "Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.", |
+ "functions": [ |
+ { |
+ "name": "getContent", |
+ "type": "function", |
+ "description": "Returns content of the response body.", |
+ "parameters": [ |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function that receives the response body when the request completes.", |
+ "parameters": [ |
+ { |
+ "name": "content", |
+ "type": "string", |
+ "description": "Content of the response body (potentially encoded)." |
+ }, |
+ { |
+ "name": "encoding", |
+ "type": "string", |
+ "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ], |
+ "functions": [ |
+ { |
+ "name": "getHAR", |
+ "type": "function", |
+ "description": "Returns HAR log that contains all known network requests.", |
+ "parameters": [ |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function that receives the HAR log when the request completes.", |
+ "parameters": [ |
+ { |
+ "name": "harLog", |
+ "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
|
+ "description": "A HAR log. See HAR specification for details." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ], |
+ "events": [ |
+ { |
+ "name": "onRequestFinished", |
+ "type": "function", |
+ "description": "Fired when a network request is finished and all request data are available.", |
+ "parameters": [ |
+ { "name": "request", "$ref": "Request", "description": "Description of a network request in the form of a HAR entry. See HAR specification for details." } |
+ ] |
+ }, |
+ { |
+ "name": "onNavigated", |
+ "type": "function", |
+ "description": "Fired when the inspected window navigates to a new page.", |
+ "parameters": [ |
+ { |
+ "name": "url", |
+ "type": "string", |
+ "description": "URL of the new page." |
+ } |
+ ] |
+ } |
+ ] |
+ }, |
+ { |
+ "namespace": "experimental.devtools.console", |
+ "nocompile": true, |
+ "functions": [ |
+ { |
+ "name": "addMessage", |
+ "type": "function", |
+ "description": "Adds a message to the console.", |
+ "parameters": [ |
+ { "name": "severity", "$ref": "Severity", "description": "The severity of the message." }, |
+ { "name": "text", "type": "string", "description": "The text of the message." } |
+ ] |
+ }, |
+ { |
+ "name": "getMessages", |
+ "type": "function", |
+ "description": "Retrieves console messages.", |
+ "parameters": [ |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function that receives console messages when the request completes.", |
+ "parameters": [ |
+ { |
+ "name": "messages", |
+ "type": "array", |
+ "items": { "$ref": "ConsoleMessage" }, |
+ "description": "Console messages." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ], |
+ "types": [ |
+ { |
+ "id": "ConsoleMessage", |
+ "type": "object", |
+ "description": "A console message.", |
+ "properties": { |
+ "severity": { |
+ "$ref": "Severity", |
+ "description": "Message severity." |
+ }, |
+ "text": { |
+ "type": "string", |
+ "description": "The text of the console message, as represented by the first argument to the console.log() or a similar method (no parameter substitution performed)." |
+ }, |
+ "url": { |
+ "type": "string", |
+ "optional": true, |
+ "description": "The URL of the script that originated the message, if available." |
+ }, |
+ "line": { |
+ "type": "number", |
+ "optional": true, |
+ "description": "The number of the line where the message originated, if available." |
+ } |
+ } |
+ }, |
+ { |
+ "id": "Severity", |
+ "type": "object", |
+ "properties": { |
+ "Tip": { |
+ "type": "string" |
+ }, |
+ "Debug": { |
+ "type": "string" |
+ }, |
+ "Log": { |
+ "type": "string" |
+ }, |
+ "Warning": { |
+ "type": "string" |
+ }, |
+ "Error": { |
+ "type": "string" |
+ } |
+ } |
+ } |
+ ], |
+ "events": [ |
+ { |
+ "name": "onMessageAdded", |
+ "type": "function", |
+ "description": "Fired when a new message is added to the console.", |
+ "parameters": [ |
+ { "name": "message", "$ref": "ConsoleMessage" } |
+ ] |
+ } |
+ ] |
+ }, |
+ { |
+ "namespace": "experimental.devtools.audits", |
+ "nocompile": true, |
+ "functions": [ |
+ { |
+ "name": "addCategory", |
+ "type": "function", |
+ "description": "Adds an audit category.", |
+ "parameters": [ |
+ { "name": "displayName", "type": "string", "description": "A display name for the category." }, |
+ { "name": "resultCount", "type": "number", "description": "The expected number of audit results in the category." } |
+ ], |
+ "returns": { |
+ "$ref": "AuditCategory" |
+ } |
+ } |
+ ], |
+ "types": [ |
+ { |
+ "id": "AuditCategory", |
+ "type": "object", |
+ "description": "A group of logically related audit checks.", |
+ "events": [ |
+ { |
+ "name": "onAuditStarted", |
+ "type": "function", |
+ "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.", |
+ "parameters": [ |
+ { "name": "results", "$ref": "AuditResults" } |
+ ] |
+ } |
+ ] |
+ }, |
+ { |
+ "id": "FormattedValue", |
+ "type": "object", |
+ "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()</code></a>." |
+ }, |
+ { |
+ "id": "AuditResults", |
+ "type": "object", |
+ "description": "A collection of audit results for the current run of the audit category.", |
+ "functions": [ |
+ { |
+ "name": "addResult", |
+ "type": "function", |
+ "description": "Adds an audit result. The results are rendered as bulleted items under the audit category assoicated with the <code>AuditResults</code> object.", |
+ "parameters": [ |
+ { |
+ "name": "displayName", |
+ "type": "string", |
+ "description": "A concise, high-level description of the result." |
+ }, |
+ { |
+ "name": "description", |
+ "type": "string", |
+ "description": "A detailed description of what the displayName means." |
+ }, |
+ { |
+ "name": "severity", |
+ "$ref": "AuditResultSeverity" |
+ }, |
+ { |
+ "name": "details", |
+ "$ref": "AuditResultNode", |
+ "optional": true, |
+ "description": "A subtree that appears under the added result that may provide additional details on the violations found." |
+ } |
+ ] |
+ }, |
+ { |
+ "name": "createResult", |
+ "type": "function", |
+ "description": "Creates a result node that may be used as the <code>details</code> parameters to the <code>addResult()</code> method.", |
+ "parameters": [ |
+ { |
+ "name": "content ...", |
+ "choices": [ |
+ { "type": "string" }, |
+ { "$ref": "FormattedValue" } |
+ ], |
+ "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." |
+ } |
+ ], |
+ "returns": { |
+ "$ref": "AuditResultNode" |
+ } |
+ }, |
+ { |
+ "name": "done", |
+ "type": "function", |
+ "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." |
+ }, |
+ { |
+ "name": "createURL", |
+ "type": "function", |
+ "description": "Render passed value as a URL in the Audits panel.", |
+ "parameters": [ |
+ { "name": "href", "type": "string", "description": "A URL that appears as the href value on the resulting link." }, |
+ { "name": "displayText", "type": "string", "description": "Text that appears to the user.", "optional": true } |
+ ], |
+ "returns": { "$ref": "FormattedValue" } |
+ }, |
+ { |
+ "name": "createSnippet", |
+ "type": "function", |
+ "description": "Render passed text as a code snippet in the Audits panel.", |
+ "parameters": [ |
+ { "name": "text", "type": "string", "description": "Snippet text." } |
+ ], |
+ "returns": { "$ref": "FormattedValue" } |
+ } |
+ ], |
+ "properties": { |
+ "Severity": { |
+ "$ref": "AuditResultSeverity", |
+ "description": "A class that contains possible values for the audit result severities." |
+ }, |
+ "text": { |
+ "type": "string", |
+ "description": "The contents of the node." |
+ }, |
+ "children": { |
+ "optional": true, |
+ "type": "array", |
+ "items": { "$ref": "AuditResultNode" }, |
+ "description": "Children of this node." |
+ }, |
+ "expanded": { |
+ "optional": "true", |
+ "type": "boolean", |
+ "description": "Whether the node is expanded by default." |
+ } |
+ } |
+ }, |
+ { |
+ "id": "AuditResultNode", |
+ "type": "object", |
+ "description": "A node in the audit result tree. Displays content and may optionally have children nodes.", |
+ "functions": [ |
+ { |
+ "name": "addChild", |
+ "description": "Adds a child node to this node.", |
+ "parameters": [ |
+ { |
+ "name": "content ...", |
+ "choices": [ |
+ { "type": "string" }, |
+ { "$ref": "FormattedValue" } |
+ ], |
+ "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." |
+ } |
+ ], |
+ "returns": { |
+ "$ref": "AuditResultNode" |
+ } |
+ } |
+ ], |
+ "properties": { |
+ "expanded": { |
+ "type": "boolean", |
+ "description": "If set, the subtree will always be expanded." |
+ } |
+ } |
+ }, |
+ { |
+ "id": "AuditResultSeverity", |
+ "type": "object", |
+ "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.", |
+ "properties": { |
+ "Info": { |
+ "type": "string" |
+ }, |
+ "Warning": { |
+ "type": "string" |
+ }, |
+ "Severe": { |
+ "type": "string" |
+ } |
+ } |
+ } |
+ ] |
+ } |
+] |