docs for chrome.devtools.panels & inspectedWindow

I'm refiling the CL from https://codereview.chromium.org/283603003/ on behalf of mem.

BUG=

Review URL: https://codereview.chromium.org/391243004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283792 0039d316-1c4b-4281-b951-d872f2087c98
parent d0eb7c9e
...@@ -88,13 +88,36 @@ ...@@ -88,13 +88,36 @@
{ {
"name": "eval", "name": "eval",
"type": "function", "type": "function",
"description": "Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown.", "description": "Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the <code>result</code> parameter of the callback is <code>undefined</code>. In the case of a DevTools-side error, the <code>isException</code> parameter is non-null and has <code>isError</code> set to true and <code>code</code> set to an error code. In the case of a JavaScript error, <code>isException</code> is set to true and <code>value</code> is set to the string value of thrown object.",
"parameters": [ "parameters": [
{ {
"name": "expression", "name": "expression",
"type": "string", "type": "string",
"description": "An expression to evaluate." "description": "An expression to evaluate."
}, },
{
"name": "options",
"type": "object",
"optional": true,
"description": "The options parameter can contain one or more options.",
"properties": {
"frameURL": {
"type": "string",
"optional": true,
"description": "If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evaluated in the top frame of the inspected page."
},
"useContentScriptContext": {
"type": "boolean",
"optional": true,
"description": "Evaluate the expression in the context of the content script of the calling extension, provided that the content script is already injected into the inspected page. If not, the expression is not evaluated and the callback is invoked with the exception parameter set to an object that has the <code>isError</code> field set to true and the <code>code</code> field set to <code>E_NOTFOUND</code>."
},
"contextSecurityOrigin": {
"type": "string",
"optional": true,
"description": "Evaluate the expression in the context of a content script of an extension that matches the specified origin. If given, contextSecurityOrigin overrides the 'true' setting on userContentScriptContext."
}
}
},
{ {
"name": "callback", "name": "callback",
"type": "function", "type": "function",
...@@ -108,9 +131,36 @@ ...@@ -108,9 +131,36 @@
"description": "The result of evaluation." "description": "The result of evaluation."
}, },
{ {
"name": "isException", "name": "exceptionInfo",
"type": "boolean", "type": "object",
"description": "Set if an exception was caught while evaluating the expression." "description": "An object providing details if an exception occurred while evaluating the expression.",
"properties": {
"isError": {
"type": "boolean",
"description": "Set if the error occurred on the DevTools side before the expression is evaluated."
},
"code": {
"type": "string",
"description": "Set if the error occurred on the DevTools side before the expression is evaluated."
},
"description": {
"type": "string",
"description": "Set if the error occurred on the DevTools side before the expression is evaluated."
},
"details": {
"type": "array",
"items": { "type": "any" },
"description": "Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error."
},
"isException": {
"type": "boolean",
"description": "Set if the evaluated code produces an unhandled exception."
},
"value": {
"type": "string",
"description": "Set if the evaluated code produces an unhandled exception."
}
}
} }
] ]
} }
...@@ -140,6 +190,11 @@ ...@@ -140,6 +190,11 @@
"type": "string", "type": "string",
"optional": true, "optional": true,
"description": "If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads&mdash;for example, if the user presses Ctrl+R." "description": "If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads&mdash;for example, if the user presses Ctrl+R."
},
"preprocessorScript": {
"type": "string",
"optional": true,
"description": "If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function."
} }
} }
} }
......
...@@ -256,6 +256,10 @@ ...@@ -256,6 +256,10 @@
"elements": { "elements": {
"$ref": "ElementsPanel", "$ref": "ElementsPanel",
"description": "Elements panel." "description": "Elements panel."
},
"sources": {
"$ref": "SourcesPanel",
"description": "Sources panel."
} }
}, },
"functions": [ "functions": [
...@@ -313,6 +317,29 @@ ...@@ -313,6 +317,29 @@
] ]
} }
] ]
},
{
"name": "openResource",
"type": "function",
"description": "Requests DevTools to open a URL in a Developer Tools panel.",
"parameters": [
{
"name": "url",
"type": "string",
"description": "The URL of the resource to open."
},
{
"name": "lineNumber",
"type": "integer",
"description": "Specifies the line number to scroll to when the resource is loaded."
},
{
"name": "callback",
"type": "function",
"optional": true,
"description": "A function that is called when the resource has been successfully loaded."
}
]
} }
] ]
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment