Index: chrome/common/extensions/api/devtools_api.json |
diff --git a/chrome/common/extensions/api/devtools_api.json b/chrome/common/extensions/api/devtools_api.json |
index 39d952fd9451bd9a20b141fbd2d62da42ca999d1..03b587ad9abb95dff591ff686590d5363d8e5138 100644 |
--- a/chrome/common/extensions/api/devtools_api.json |
+++ b/chrome/common/extensions/api/devtools_api.json |
@@ -1,6 +1,75 @@ |
[ |
{ |
"namespace": "experimental.devtools.inspectedWindow", |
+ "types": [ |
+ { |
+ "id": "Resource", |
+ "type": "object", |
+ "description": "A resource within the inspected page, such as a document, a script or an image.", |
+ "properties": { |
+ "url": { |
+ "type": "string", |
+ "description": "The URL of the resource." |
+ } |
+ }, |
+ "functions": [ |
+ { |
+ "name": "getContent", |
+ "type": "function", |
+ "description": "Gets the content of the resource.", |
+ "parameters": [ |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function that is called upon request completion.", |
+ "parameters": [ |
+ { |
+ "name": "content", |
+ "type": "string", |
+ "description": "Content of the resource (potentially encoded)." |
+ }, |
+ { |
+ "name": "encoding", |
+ "type": "string", |
+ "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported." |
+ } |
+ ] |
+ } |
+ ] |
+ }, |
+ { |
+ "name": "setContent", |
+ "type": "function", |
+ "description": "Sets the content of the resource.", |
+ "parameters": [ |
+ { |
+ "name": "content", |
+ "type": "string", |
+ "description": "New content of the resource. Only resources with the text type are currently supported." |
+ }, |
+ { |
+ "name": "commit", |
+ "type": "boolean", |
+ "description": "True if the user has finished editing the resource and the new content of the resource should be persisted, false if this is a minor change sent in progress of the user editing the resource." |
+ }, |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function called upon request completion.", |
+ "parameters": [ |
+ { |
+ "name": "error", |
+ "type": "object", |
+ "optional": true, |
+ "description": "Set to undefined if the operation completed successfully, describes error otherwise." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ], |
"properties": { |
"tabId": { |
"description": "The ID of the tab being inspected. This ID may be used with chrome.tabs.* API.", |
@@ -49,6 +118,48 @@ |
"description": "A user agent override string." |
} |
] |
+ }, |
+ { |
+ "name": "getResources", |
+ "type": "function", |
+ "description": "Retrieves the list of resources from the inspected page.", |
+ "parameters": [ |
+ { |
+ "name": "callback", |
+ "type": "function", |
+ "description": "A function that is called upon request completion.", |
+ "parameters": [ |
+ { |
+ "name": "resources", |
+ "type": "array", |
+ "items": { "$ref": "Resource" }, |
+ "description": "The resources within the page." |
+ } |
+ ] |
+ } |
+ ] |
+ } |
+ ], |
+ "events": [ |
+ { |
+ "name": "onResourceAdded", |
+ "description": "Fired when a new resource is added to the inspected page.", |
+ "parameters": [ |
+ { |
+ "name": "resource", |
+ "$ref": "Resource" |
+ } |
+ ] |
+ }, |
+ { |
+ "name": "onResourceContentCommitted", |
+ "description": "Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools).", |
+ "parameters": [ |
+ { |
+ "name": "resource", |
+ "$ref": "Resource" |
+ } |
+ ] |
} |
] |
}, |
@@ -261,7 +372,7 @@ |
{ |
"name": "encoding", |
"type": "string", |
- "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 supported." |
+ "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported." |
} |
] |
} |
@@ -315,6 +426,98 @@ |
] |
}, |
{ |
+ "namespace": "experimental.devtools.console", |
+ "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 is called upon request completion.", |
+ "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", |
"functions": [ |
{ |