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 "nocompile": true, | 8 "nocompile": true, |
9 "dependencies": [ "events", "tabs" ], | 9 "dependencies": [ "events", "tabs" ], |
10 "types": [ | 10 "types": [ |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 }, | 68 }, |
69 "optional": true | 69 "optional": true |
70 } | 70 } |
71 ], | 71 ], |
72 "returns": { | 72 "returns": { |
73 "$ref": "Port", | 73 "$ref": "Port", |
74 "description": "Port through which messages can be sent and received w
ith the extension. The port's <a href='extension.html#type-Port'>onDisconnect</a
> event is fired if extension does not exist. " | 74 "description": "Port through which messages can be sent and received w
ith the extension. The port's <a href='extension.html#type-Port'>onDisconnect</a
> event is fired if extension does not exist. " |
75 } | 75 } |
76 }, | 76 }, |
77 { | 77 { |
| 78 "name": "connectNative", |
| 79 "nodoc": true, |
| 80 "type": "function", |
| 81 "description": "Attempts to connect a native application in the host mac
hine. The native application must have already registered itself in the proper d
irectory.", |
| 82 "parameters": [ |
| 83 { |
| 84 "type": "string", |
| 85 "name": "appName", |
| 86 "description": "The name of the registered app to connect to." |
| 87 }, |
| 88 { |
| 89 "name": "connectionMessage", |
| 90 "description": "The object that will be passed to the registered nat
ive app on connection.", |
| 91 "type": "object", |
| 92 "additionalProperties": { |
| 93 "type": "any" |
| 94 } |
| 95 } |
| 96 ], |
| 97 "returns": { |
| 98 "$ref": "Port", |
| 99 "description": "Port through which messages can be sent and received w
ith the application" |
| 100 } |
| 101 }, |
| 102 { |
78 "name": "sendRequest", | 103 "name": "sendRequest", |
79 "nodoc": true, | 104 "nodoc": true, |
80 "type": "function", | 105 "type": "function", |
81 "allowAmbiguousOptionalArguments": true, | 106 "allowAmbiguousOptionalArguments": true, |
82 "unprivileged": true, | 107 "unprivileged": true, |
83 "description": "Deprecated: Please use sendMessage.", | 108 "description": "Deprecated: Please use sendMessage.", |
84 "parameters": [ | 109 "parameters": [ |
85 {"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."}, | 110 {"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."}, |
86 { "type": "any", "name": "request" }, | 111 { "type": "any", "name": "request" }, |
87 { | 112 { |
(...skipping 27 matching lines...) Expand all Loading... |
115 { | 140 { |
116 "name": "response", | 141 "name": "response", |
117 "type": "any", | 142 "type": "any", |
118 "description": "The JSON response object sent by the handler of
the message. If an error occurs while connecting to the extension, the callback
will be called with no arguments and <a href='extension.html#property-lastError'
>chrome.extension.lastError</a> will be set to the error message." | 143 "description": "The JSON response object sent by the handler of
the message. If an error occurs while connecting to the extension, the callback
will be called with no arguments and <a href='extension.html#property-lastError'
>chrome.extension.lastError</a> will be set to the error message." |
119 } | 144 } |
120 ] | 145 ] |
121 } | 146 } |
122 ] | 147 ] |
123 }, | 148 }, |
124 { | 149 { |
| 150 "name": "sendNativeMessage", |
| 151 "nodoc": true, |
| 152 "type": "function", |
| 153 "description": "Send a single message to a registered native application
.", |
| 154 "parameters": [ |
| 155 { |
| 156 "name": "registeredNativeApp", |
| 157 "description": "The name of the registered native application.", |
| 158 "type": "string" |
| 159 }, |
| 160 { |
| 161 "name": "message", |
| 162 "description": "The message that will be passed to the registered na
tive application.", |
| 163 "type": "object", |
| 164 "additionalProperties": { |
| 165 "type": "any" |
| 166 } |
| 167 }, |
| 168 { |
| 169 "type": "function", |
| 170 "name": "callback", |
| 171 "optional": true, |
| 172 "description": "Called with the response from the native application
.", |
| 173 "parameters": [ |
| 174 { |
| 175 "name": "nativeResponse", |
| 176 "type": "object", |
| 177 "description": "Whatever the native application responds with.", |
| 178 "additionalProperties": { |
| 179 "type": "any" |
| 180 } |
| 181 } |
| 182 ] |
| 183 } |
| 184 ] |
| 185 }, |
| 186 { |
125 "name": "getURL", | 187 "name": "getURL", |
126 "type": "function", | 188 "type": "function", |
127 "unprivileged": true, | 189 "unprivileged": true, |
128 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", | 190 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", |
129 "parameters": [ | 191 "parameters": [ |
130 { | 192 { |
131 "type": "string", | 193 "type": "string", |
132 "name": "path", | 194 "name": "path", |
133 "description": "A path to a resource within an extension expressed r
elative to its install directory." | 195 "description": "A path to a resource within an extension expressed r
elative to its install directory." |
134 } | 196 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ], | 375 ], |
314 "returns": { | 376 "returns": { |
315 "type": "boolean", | 377 "type": "boolean", |
316 "optional": "true", | 378 "optional": "true", |
317 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 379 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
318 } | 380 } |
319 } | 381 } |
320 ] | 382 ] |
321 } | 383 } |
322 ] | 384 ] |
OLD | NEW |