| 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 { | |
| 103 "name": "sendRequest", | 78 "name": "sendRequest", |
| 104 "nodoc": true, | 79 "nodoc": true, |
| 105 "type": "function", | 80 "type": "function", |
| 106 "allowAmbiguousOptionalArguments": true, | 81 "allowAmbiguousOptionalArguments": true, |
| 107 "unprivileged": true, | 82 "unprivileged": true, |
| 108 "description": "Deprecated: Please use sendMessage.", | 83 "description": "Deprecated: Please use sendMessage.", |
| 109 "parameters": [ | 84 "parameters": [ |
| 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."}, | 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."}, |
| 111 { "type": "any", "name": "request" }, | 86 { "type": "any", "name": "request" }, |
| 112 { | 87 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 140 { | 115 { |
| 141 "name": "response", | 116 "name": "response", |
| 142 "type": "any", | 117 "type": "any", |
| 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." | 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." |
| 144 } | 119 } |
| 145 ] | 120 ] |
| 146 } | 121 } |
| 147 ] | 122 ] |
| 148 }, | 123 }, |
| 149 { | 124 { |
| 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 { | |
| 187 "name": "getURL", | 125 "name": "getURL", |
| 188 "type": "function", | 126 "type": "function", |
| 189 "unprivileged": true, | 127 "unprivileged": true, |
| 190 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", | 128 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", |
| 191 "parameters": [ | 129 "parameters": [ |
| 192 { | 130 { |
| 193 "type": "string", | 131 "type": "string", |
| 194 "name": "path", | 132 "name": "path", |
| 195 "description": "A path to a resource within an extension expressed r
elative to its install directory." | 133 "description": "A path to a resource within an extension expressed r
elative to its install directory." |
| 196 } | 134 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 ], | 313 ], |
| 376 "returns": { | 314 "returns": { |
| 377 "type": "boolean", | 315 "type": "boolean", |
| 378 "optional": "true", | 316 "optional": "true", |
| 379 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 317 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
| 380 } | 318 } |
| 381 } | 319 } |
| 382 ] | 320 ] |
| 383 } | 321 } |
| 384 ] | 322 ] |
| OLD | NEW |