OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "devtools.inspectedWindow", | 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, ev aluate the code in the context of the inspected window, reload the page, or obta in the list of resources within the page.", | 8 "description": "Use the <code>chrome.devtools.inspectedWindow</code> API to interact with the inspected window: obtain the tab ID for the inspected page, ev aluate the code in the context of the inspected window, reload the page, or obta in the list of resources within the page.", |
9 "nocompile": true, | 9 "nocompile": true, |
10 "types": [ | 10 "types": [ |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 "properties": { | 81 "properties": { |
82 "tabId": { | 82 "tabId": { |
83 "description": "The ID of the tab being inspected. This ID may be used w ith chrome.tabs.* API.", | 83 "description": "The ID of the tab being inspected. This ID may be used w ith chrome.tabs.* API.", |
84 "type": "integer" | 84 "type": "integer" |
85 } | 85 } |
86 }, | 86 }, |
87 "functions": [ | 87 "functions": [ |
88 { | 88 { |
89 "name": "eval", | 89 "name": "eval", |
90 "type": "function", | 90 "type": "function", |
91 "description": "Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-complia nt object, otherwise an exception is thrown.", | 91 "description": "Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-complia nt 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>undef ined</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</c ode> 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 thro wn.", |
caseq
2014/06/03 08:53:26
"is set to the string value of thrown object.", pe
| |
92 "parameters": [ | 92 "parameters": [ |
93 { | 93 { |
94 "name": "expression", | 94 "name": "expression", |
95 "type": "string", | 95 "type": "string", |
96 "description": "An expression to evaluate." | 96 "description": "An expression to evaluate." |
97 }, | 97 }, |
98 { | 98 { |
99 "name": "options", | |
100 "type": "object", | |
101 "optional": true, | |
102 "description": "The options parameter can contain one or more option s.", | |
103 "properties": { | |
104 "frameURL": { | |
105 "type": "string", | |
106 "optional": true, | |
107 "description": "If specified, the expression is evaluated on the iframe whose URL matches the one specified. By default, the expression is evalu ated in the top frame of the inspected page." | |
108 }, | |
109 "useContentScriptContext": { | |
110 "type": "boolean", | |
111 "optional": true, | |
112 "description": "Evaluate the expression in the context of the co ntent script of the calling extension, provided that the content script is alrea dy 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 t o <code>E_NOTFOUND</code>." | |
113 }, | |
114 "contextSecurityOrigin": { | |
115 "type": "string", | |
116 "optional": true, | |
117 "description": "Evaluate the expression in the context of a cont ent script of an extension that matches the specified origin. If given, contextS ecurityOrigin overrides the 'true' setting on userContentScriptContext." | |
118 } | |
119 } | |
120 }, | |
121 { | |
99 "name": "callback", | 122 "name": "callback", |
100 "type": "function", | 123 "type": "function", |
101 "description": "A function called when evaluation completes.", | 124 "description": "A function called when evaluation completes.", |
102 "optional": true, | 125 "optional": true, |
103 "parameters": [ | 126 "parameters": [ |
104 { | 127 { |
105 "name": "result", | 128 "name": "result", |
106 "type": "object", | 129 "type": "object", |
107 "additionalProperties": {"type": "any"}, | 130 "additionalProperties": {"type": "any"}, |
108 "description": "The result of evaluation." | 131 "description": "The result of evaluation." |
109 }, | 132 }, |
110 { | 133 { |
111 "name": "isException", | 134 "name": "exceptionInfo", |
112 "type": "boolean", | 135 "type": "object", |
113 "description": "Set if an exception was caught while evaluating the expression." | 136 "description": "An object providing details if an exception occu rred while evaluating the expression.", |
137 "properties": { | |
138 "isError": { | |
139 "type": "boolean", | |
140 "description": "Set if the error occurred on the DevTools si de before the expression is evaluated." | |
141 }, | |
142 "code": { | |
143 "type": "string", | |
144 "description": "Set if the error occurred on the DevTools si de before the expression is evaluated." | |
145 }, | |
146 "description": { | |
147 "type": "string", | |
148 "description": "Set if the error occurred on the DevTools si de before the expression is evaluated." | |
149 }, | |
150 "details": { | |
151 "type": "string", | |
caseq
2014/06/03 08:53:26
"type": "arryay",
"items": { type: "any" },
"descr
| |
152 "description": "Set if the error occurred on the DevTools si de before the expression is evaluated." | |
153 }, | |
154 "isException": { | |
155 "type": "boolean", | |
156 "description": "Set if the evaluated code produces an unhand led exception." | |
157 }, | |
158 "value": { | |
159 "type": "string", | |
160 "description": "Set if the evaluated code produces an unhand led exception." | |
161 } | |
162 } | |
114 } | 163 } |
115 ] | 164 ] |
116 } | 165 } |
117 ] | 166 ] |
118 }, | 167 }, |
119 { | 168 { |
120 "name": "reload", | 169 "name": "reload", |
121 "type": "function", | 170 "type": "function", |
122 "description": "Reloads the inspected page.", | 171 "description": "Reloads the inspected page.", |
123 "parameters": [ | 172 "parameters": [ |
124 { | 173 { |
125 "type": "object", | 174 "type": "object", |
126 "name": "reloadOptions", | 175 "name": "reloadOptions", |
127 "optional": true, | 176 "optional": true, |
128 "properties": { | 177 "properties": { |
129 "ignoreCache": { | 178 "ignoreCache": { |
130 "type": "boolean", | 179 "type": "boolean", |
131 "optional": true, | 180 "optional": true, |
132 "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 withi n the Developer Tools window." | 181 "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 withi n the Developer Tools window." |
133 }, | 182 }, |
134 "userAgent": { | 183 "userAgent": { |
135 "type": "string", | 184 "type": "string", |
136 "optional": true, | 185 "optional": true, |
137 "description": "If specified, the string will override the value of the <code>User-Agent</code> HTTP header that's sent while loading the resour ces 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 runn ing within the inspected page." | 186 "description": "If specified, the string will override the value of the <code>User-Agent</code> HTTP header that's sent while loading the resour ces 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 runn ing within the inspected page." |
138 }, | 187 }, |
139 "injectedScript": { | 188 "injectedScript": { |
140 "type": "string", | 189 "type": "string", |
141 "optional": true, | 190 "optional": true, |
142 "description": "If specified, the script will be injected into e very 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 ex ample, if the user presses Ctrl+R." | 191 "description": "If specified, the script will be injected into e very 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 ex ample, if the user presses Ctrl+R." |
192 }, | |
193 "preprocessorScript": { | |
194 "type": "string", | |
195 "optional": true, | |
196 "description": "If specified, this script evaluates into a funct ion that accepts three string arguments: the source to preprocess, the URL of th e source, and a function name if the source is an DOM event handler. The preproc essorerScript 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 ret urned source must compile to a single JS function." | |
143 } | 197 } |
144 } | 198 } |
145 } | 199 } |
146 ] | 200 ] |
147 }, | 201 }, |
148 { | 202 { |
149 "name": "getResources", | 203 "name": "getResources", |
150 "type": "function", | 204 "type": "function", |
151 "description": "Retrieves the list of resources from the inspected page. ", | 205 "description": "Retrieves the list of resources from the inspected page. ", |
152 "parameters": [ | 206 "parameters": [ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 { | 242 { |
189 "name": "content", | 243 "name": "content", |
190 "type": "string", | 244 "type": "string", |
191 "description": "New content of the resource." | 245 "description": "New content of the resource." |
192 } | 246 } |
193 ] | 247 ] |
194 } | 248 } |
195 ] | 249 ] |
196 } | 250 } |
197 ] | 251 ] |
OLD | NEW |