Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4737)

Unified Diff: chrome/common/extensions/api/devtools/inspected_window.json

Issue 283603003: fixes for issue #51 in devtools-docs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes based on comments by caseq Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/devtools/panels.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/devtools/inspected_window.json
diff --git a/chrome/common/extensions/api/devtools/inspected_window.json b/chrome/common/extensions/api/devtools/inspected_window.json
index bd5b764a8c623cd27386401317f01a60b24f92cb..91e353a39e0268c292ab81d7635d8dabde25c5f2 100644
--- a/chrome/common/extensions/api/devtools/inspected_window.json
+++ b/chrome/common/extensions/api/devtools/inspected_window.json
@@ -88,7 +88,7 @@
{
"name": "eval",
"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>result</code> is set to the string value of thrown.",
caseq 2014/06/03 08:53:26 "is set to the string value of thrown object.", pe
"parameters": [
{
"name": "expression",
@@ -96,6 +96,29 @@
"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",
"type": "function",
"description": "A function called when evaluation completes.",
@@ -108,9 +131,35 @@
"description": "The result of evaluation."
},
{
- "name": "isException",
- "type": "boolean",
- "description": "Set if an exception was caught while evaluating the expression."
+ "name": "exceptionInfo",
+ "type": "object",
+ "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": "string",
caseq 2014/06/03 08:53:26 "type": "arryay", "items": { type: "any" }, "descr
+ "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
+ },
+ "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 +189,11 @@
"type": "string",
"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."
+ },
+ "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."
}
}
}
« no previous file with comments | « no previous file | chrome/common/extensions/api/devtools/panels.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698