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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 {"type": "string", "name": "data", "maxLength": 1024} | 179 {"type": "string", "name": "data", "maxLength": 1024} |
184 ] | 180 ] |
185 } | 181 } |
186 ], | 182 ], |
187 "events": [ | 183 "events": [ |
188 { | 184 { |
189 "name": "onRequest", | 185 "name": "onRequest", |
190 "nodoc": true, | 186 "nodoc": true, |
191 "type": "function", | 187 "type": "function", |
192 "anonymous": true, | 188 "anonymous": true, |
193 "unprivileged": true, | |
194 "description": "Deprecated: please use onMessage.", | 189 "description": "Deprecated: please use onMessage.", |
195 "parameters": [ | 190 "parameters": [ |
196 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, | 191 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
197 {"name": "sender", "$ref": "MessageSender" }, | 192 {"name": "sender", "$ref": "MessageSender" }, |
198 {"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." } | 193 {"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." } |
199 ] | 194 ] |
200 }, | 195 }, |
201 { | 196 { |
202 "name": "onRequestExternal", | 197 "name": "onRequestExternal", |
203 "nodoc": true, | 198 "nodoc": true, |
204 "type": "function", | 199 "type": "function", |
205 "anonymous": true, | 200 "anonymous": true, |
206 "description": "Deprecated: please use onMessageExternal.", | 201 "description": "Deprecated: please use onMessageExternal.", |
207 "parameters": [ | 202 "parameters": [ |
208 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, | 203 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
209 {"name": "sender", "$ref": "MessageSender" }, | 204 {"name": "sender", "$ref": "MessageSender" }, |
210 {"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." } | 205 {"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." } |
211 ] | 206 ] |
212 } | 207 } |
213 ] | 208 ] |
214 } | 209 } |
215 ] | 210 ] |
OLD | NEW |