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": "devtools.inspectedWindow",
8 "description": "Use the <code>chrome.devtools.inspectedWindow</code> API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.",
14 "description": "A resource within the inspected page, such as a document, a script, or an image.",
18 "description": "The URL of the resource."
25 "description": "Gets the content of the resource.",
30 "description": "A function that receives resource content when the request completes.",
35 "description": "Content of the resource (potentially encoded)."
40 "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported."
49 "description": "Sets the content of the resource.",
54 "description": "New content of the resource. Only resources with the text type are currently supported."
59 "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."
64 "description": "A function called upon request completion.",
70 "additionalProperties": {"type": "any"},
72 "description": "Set to undefined if the resource content was set successfully; describes error otherwise."
83 "description": "The ID of the tab being inspected. This ID may be used with chrome.tabs.* API.",
91 "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.",
96 "description": "An expression to evaluate."
102 "description": "The options parameter can contain one or more options.",
107 "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."
109 "useContentScriptContext": {
112 "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>."
114 "contextSecurityOrigin": {
117 "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."
124 "description": "A function called when evaluation completes.",
130 "additionalProperties": {"type": "any"},
131 "description": "The result of evaluation."
134 "name": "exceptionInfo",
136 "description": "An object providing details if an exception occurred while evaluating the expression.",
140 "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
144 "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
148 "description": "Set if the error occurred on the DevTools side before the expression is evaluated."
152 "items": { "type": "any" },
153 "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."
157 "description": "Set if the evaluated code produces an unhandled exception."
161 "description": "Set if the evaluated code produces an unhandled exception."
172 "description": "Reloads the inspected page.",
176 "name": "reloadOptions",
182 "description": "When true, the loader will ignore the cache for all inspected page resources loaded before the <code>load</code> event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window."
187 "description": "If specified, the string will override the value of the <code>User-Agent</code> HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the <code>navigator.userAgent</code> property that's returned to any scripts that are running within the inspected page."
192 "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—for example, if the user presses Ctrl+R."
194 "preprocessorScript": {
196 "deprecated": "Please avoid using this parameter, it will be removed soon.",
198 "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."
205 "name": "getResources",
207 "description": "Retrieves the list of resources from the inspected page.",
212 "description": "A function that receives the list of resources when the request completes.",
217 "items": { "$ref": "Resource" },
218 "description": "The resources within the page."
227 "name": "onResourceAdded",
228 "description": "Fired when a new resource is added to the inspected page.",
237 "name": "onResourceContentCommitted",
238 "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).",
247 "description": "New content of the resource."