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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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.", |
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 of thr ee options.", | |
caseq
2014/05/15 14:31:34
nit: can we drop the exact options count? I bet we
mem
2014/05/15 20:19:03
Done.
| |
103 "properties": { | |
104 "frameURL": { | |
105 "type": "string", | |
106 "optional": true, | |
107 "description": "Specify a frame other than the inspected window' s top frame." | |
caseq
2014/05/15 14:31:34
If specified, the expression is evaluated on the i
mem
2014/05/15 20:19:03
Done.
| |
108 }, | |
109 "useContentScriptContext": { | |
110 "type": "boolean", | |
111 "optional": true, | |
112 "description": "Evaluate the expression in the JS context with t he same Web Origin as this extension. If this extension has no content script, t he result will be a console.warn message." | |
caseq
2014/05/15 14:31:34
"Evaluate the expression in the context of the con
mem
2014/05/15 20:19:03
Done.
| |
113 }, | |
114 "contextSecurityOrigin": { | |
115 "type": "string", | |
116 "optional": true, | |
117 "description": "Evaluate the expression in the JS environment wi th a WebOrigin matching the given string. If given, the contextSecurityOrigin ov errides the 'true' setting on userContentScriptContext." | |
caseq
2014/05/15 14:31:34
... in the context of a content script of an exten
mem
2014/05/15 20:19:03
Done.
| |
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": "isException", |
caseq
2014/05/15 14:31:34
Let's also rename this to exception or exceptionIn
mem
2014/05/15 20:19:03
Done.
| |
112 "type": "boolean", | 135 "type": "object", |
113 "description": "Set if an exception was caught while evaluating the expression." | 136 "additionalProperties": {"type": "any"}, |
caseq
2014/05/15 14:31:34
We may want to document some properties.
isErorr,
mem
2014/05/15 20:19:03
Done.
| |
137 "description": "An object providing details if an exception occu rred while evaluating the expression." | |
114 } | 138 } |
115 ] | 139 ] |
116 } | 140 } |
117 ] | 141 ] |
118 }, | 142 }, |
119 { | 143 { |
120 "name": "reload", | 144 "name": "reload", |
121 "type": "function", | 145 "type": "function", |
122 "description": "Reloads the inspected page.", | 146 "description": "Reloads the inspected page.", |
123 "parameters": [ | 147 "parameters": [ |
124 { | 148 { |
125 "type": "object", | 149 "type": "object", |
126 "name": "reloadOptions", | 150 "name": "reloadOptions", |
127 "optional": true, | 151 "optional": true, |
128 "properties": { | 152 "properties": { |
129 "ignoreCache": { | 153 "ignoreCache": { |
130 "type": "boolean", | 154 "type": "boolean", |
131 "optional": true, | 155 "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." | 156 "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 }, | 157 }, |
134 "userAgent": { | 158 "userAgent": { |
135 "type": "string", | 159 "type": "string", |
136 "optional": true, | 160 "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." | 161 "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 }, | 162 }, |
139 "injectedScript": { | 163 "injectedScript": { |
140 "type": "string", | 164 "type": "string", |
141 "optional": true, | 165 "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." | 166 "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." |
167 }, | |
168 "preprocessorScript": { | |
169 "type": "string", | |
170 "optional": true, | |
171 "description": "If specified, this is a JavaScript function that takes 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 preprocessorerScr ipt function should return a string to be compiled by Chrome in place of the inp ut source. In the case that the source is a DOM event handler, the returned sour ce must compile to a single JS function." | |
caseq
2014/05/15 14:31:34
"If specified, this is a script that evaluates int
mem
2014/05/15 20:19:03
Done.
| |
143 } | 172 } |
144 } | 173 } |
145 } | 174 } |
146 ] | 175 ] |
147 }, | 176 }, |
148 { | 177 { |
149 "name": "getResources", | 178 "name": "getResources", |
150 "type": "function", | 179 "type": "function", |
151 "description": "Retrieves the list of resources from the inspected page. ", | 180 "description": "Retrieves the list of resources from the inspected page. ", |
152 "parameters": [ | 181 "parameters": [ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 { | 217 { |
189 "name": "content", | 218 "name": "content", |
190 "type": "string", | 219 "type": "string", |
191 "description": "New content of the resource." | 220 "description": "New content of the resource." |
192 } | 221 } |
193 ] | 222 ] |
194 } | 223 } |
195 ] | 224 ] |
196 } | 225 } |
197 ] | 226 ] |
OLD | NEW |