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": "extension", | 7 "namespace": "extension", |
8 "compiler_options": { | 8 "compiler_options": { |
9 "implemented_in": "chrome/browser/extensions/api/module/module.h" | 9 "implemented_in": "chrome/browser/extensions/api/module/module.h" |
10 }, | 10 }, |
11 "types": [ | 11 "types": [ |
12 { | 12 { |
13 "id": "MessageSender", | 13 "id": "MessageSender", |
14 "type": "object", | 14 "type": "object", |
15 "description": "An object containing information about the script contex
t that sent a message or request.", | 15 "description": "An object containing information about the script contex
t that sent a message or request.", |
16 "properties": { | 16 "properties": { |
17 "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This prop
erty will <b>only</b> be present when the connection was opened from a tab or co
ntent script."}, | 17 "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This prop
erty will <b>only</b> be present when the connection was opened from a tab or co
ntent script."}, |
18 "id": {"type": "string", "description": "The extension ID of the exten
sion that opened the connection."} | 18 "id": {"type": "string", "description": "The extension ID of the exten
sion that opened the connection."} |
19 } | 19 } |
20 } | 20 } |
21 ], | 21 ], |
22 "properties": { | 22 "properties": { |
23 "lastError": { | 23 "lastError": { |
24 "type": "object", | 24 "type": "object", |
25 "optional": true, | 25 "optional": true, |
26 "unprivileged": true, | |
27 "description": "Set for the lifetime of a callback if an ansychronous ex
tension api has resulted in an error. If no error has occured lastError will be
<var>undefined</var>.", | 26 "description": "Set for the lifetime of a callback if an ansychronous ex
tension api has resulted in an error. If no error has occured lastError will be
<var>undefined</var>.", |
28 "properties": { | 27 "properties": { |
29 "message": { "type": "string", "description": "Description of the erro
r that has taken place." } | 28 "message": { "type": "string", "description": "Description of the erro
r that has taken place." } |
30 } | 29 } |
31 }, | 30 }, |
32 "inIncognitoContext": { | 31 "inIncognitoContext": { |
33 "type": "boolean", | 32 "type": "boolean", |
34 "optional": true, | 33 "optional": true, |
35 "unprivileged": true, | |
36 "description": "True for content scripts running inside incognito tabs,
and for extension pages running inside an incognito process. The latter only app
lies to extensions with 'split' incognito_behavior." | 34 "description": "True for content scripts running inside incognito tabs,
and for extension pages running inside an incognito process. The latter only app
lies to extensions with 'split' incognito_behavior." |
37 } | 35 } |
38 }, | 36 }, |
39 "functions": [ | 37 "functions": [ |
40 { | 38 { |
41 "name": "sendRequest", | 39 "name": "sendRequest", |
42 "nocompile": true, | 40 "nocompile": true, |
43 "nodoc": true, | 41 "nodoc": true, |
44 "type": "function", | 42 "type": "function", |
45 "allowAmbiguousOptionalArguments": true, | 43 "allowAmbiguousOptionalArguments": true, |
46 "unprivileged": true, | |
47 "description": "Deprecated: Please use sendMessage.", | 44 "description": "Deprecated: Please use sendMessage.", |
48 "parameters": [ | 45 "parameters": [ |
49 {"type": "string", "name": "extensionId", "optional": true, "descripti
on": "The extension ID of the extension you want to connect to. If omitted, defa
ult is your own extension."}, | 46 {"type": "string", "name": "extensionId", "optional": true, "descripti
on": "The extension ID of the extension you want to connect to. If omitted, defa
ult is your own extension."}, |
50 { "type": "any", "name": "request" }, | 47 { "type": "any", "name": "request" }, |
51 { | 48 { |
52 "type": "function", | 49 "type": "function", |
53 "name": "responseCallback", | 50 "name": "responseCallback", |
54 "optional": true, | 51 "optional": true, |
55 "parameters": [ | 52 "parameters": [ |
56 { | 53 { |
57 "name": "response", | 54 "name": "response", |
58 "type": "any", | 55 "type": "any", |
59 "description": "The JSON response object sent by the handler of
the request. If an error occurs while connecting to the extension, the callback
will be called with no arguments and $ref:runtime.lastError will be set to the e
rror message." | 56 "description": "The JSON response object sent by the handler of
the request. If an error occurs while connecting to the extension, the callback
will be called with no arguments and $ref:runtime.lastError will be set to the e
rror message." |
60 } | 57 } |
61 ] | 58 ] |
62 } | 59 } |
63 ] | 60 ] |
64 }, | 61 }, |
65 { | 62 { |
66 "name": "getURL", | 63 "name": "getURL", |
67 "nocompile": true, | 64 "nocompile": true, |
68 "type": "function", | 65 "type": "function", |
69 "unprivileged": true, | |
70 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", | 66 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", |
71 "parameters": [ | 67 "parameters": [ |
72 { | 68 { |
73 "type": "string", | 69 "type": "string", |
74 "name": "path", | 70 "name": "path", |
75 "description": "A path to a resource within an extension expressed r
elative to its install directory." | 71 "description": "A path to a resource within an extension expressed r
elative to its install directory." |
76 } | 72 } |
77 ], | 73 ], |
78 "returns": { | 74 "returns": { |
79 "type": "string", | 75 "type": "string", |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 {"type": "string", "name": "data", "maxLength": 1024} | 193 {"type": "string", "name": "data", "maxLength": 1024} |
198 ] | 194 ] |
199 } | 195 } |
200 ], | 196 ], |
201 "events": [ | 197 "events": [ |
202 { | 198 { |
203 "name": "onRequest", | 199 "name": "onRequest", |
204 "nodoc": true, | 200 "nodoc": true, |
205 "type": "function", | 201 "type": "function", |
206 "anonymous": true, | 202 "anonymous": true, |
207 "unprivileged": true, | |
208 "description": "Deprecated: please use onMessage.", | 203 "description": "Deprecated: please use onMessage.", |
209 "parameters": [ | 204 "parameters": [ |
210 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, | 205 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
211 {"name": "sender", "$ref": "MessageSender" }, | 206 {"name": "sender", "$ref": "MessageSender" }, |
212 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object, or undefined if there is no response. If you have more than one
<code>onRequest</code> listener in the same document, then only one may send a
response." } | 207 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object, or undefined if there is no response. If you have more than one
<code>onRequest</code> listener in the same document, then only one may send a
response." } |
213 ] | 208 ] |
214 }, | 209 }, |
215 { | 210 { |
216 "name": "onRequestExternal", | 211 "name": "onRequestExternal", |
217 "nodoc": true, | 212 "nodoc": true, |
218 "type": "function", | 213 "type": "function", |
219 "anonymous": true, | 214 "anonymous": true, |
220 "description": "Deprecated: please use onMessageExternal.", | 215 "description": "Deprecated: please use onMessageExternal.", |
221 "parameters": [ | 216 "parameters": [ |
222 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, | 217 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
223 {"name": "sender", "$ref": "MessageSender" }, | 218 {"name": "sender", "$ref": "MessageSender" }, |
224 {"name": "sendResponse", "type": "function", "description": "Function
to call when you have a response. The argument should be any JSON-ifiable object
, or undefined if there is no response." } | 219 {"name": "sendResponse", "type": "function", "description": "Function
to call when you have a response. The argument should be any JSON-ifiable object
, or undefined if there is no response." } |
225 ] | 220 ] |
226 } | 221 } |
227 ] | 222 ] |
228 } | 223 } |
229 ] | 224 ] |
OLD | NEW |