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": "runtime", | 7 "namespace": "runtime", |
8 "description": "Use the <code>chrome.runtime</code> API to retrieve the back
ground page, return details about the manifest, and listen for and respond to ev
ents in the app or extension lifecycle. You can also use this API to convert the
relative path of URLs to fully-qualified URLs.", | 8 "description": "Use the <code>chrome.runtime</code> API to retrieve the back
ground page, return details about the manifest, and listen for and respond to ev
ents in the app or extension lifecycle. You can also use this API to convert the
relative path of URLs to fully-qualified URLs.", |
9 "types": [ | 9 "types": [ |
10 { | 10 { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 "name": "restart", | 165 "name": "restart", |
166 "description": "Restart the ChromeOS device when the app runs in kiosk m
ode. Otherwise, it's no-op.", | 166 "description": "Restart the ChromeOS device when the app runs in kiosk m
ode. Otherwise, it's no-op.", |
167 "type": "function", | 167 "type": "function", |
168 "nocompile": true, | 168 "nocompile": true, |
169 "parameters": [] | 169 "parameters": [] |
170 }, | 170 }, |
171 { | 171 { |
172 "name": "connect", | 172 "name": "connect", |
173 "type": "function", | 173 "type": "function", |
174 "nocompile": true, | 174 "nocompile": true, |
175 "description": "Attempts to connect to other listeners within the extens
ion/app (such as the background page), or other extensions/apps. This is useful
for content scripts connecting to their extension processes. Note that this does
not connect to any listeners in a content script. Extensions may connect to con
tent scripts embedded in tabs via $ref:tabs.connect.", | 175 "description": "Attempts to connect to connect listeners within an exten
sion/app (such as the background page), or other extensions/apps. This is useful
for content scripts connecting to their extension processes, inter-app/extensio
n communication, and <a href=\"manifest/externally_connectable.html\">web messag
ing</a>. Note that this does not connect to any listeners in a content script. E
xtensions may connect to content scripts embedded in tabs via $ref:tabs.connect.
", |
176 "parameters": [ | 176 "parameters": [ |
177 {"type": "string", "name": "extensionId", "optional": true, "descripti
on": "The ID of the extension/app you want to connect to. If omitted, default is
your own extension."}, | 177 {"type": "string", "name": "extensionId", "optional": true, "descripti
on": "The ID of the extension or app to connect to. If omitted, a connection wil
l be attempted with your own extension. Required if sending messages from a web
page for <a href=\"manifest/externally_connectable.html\">web messaging</a>."}, |
178 { | 178 { |
179 "type": "object", | 179 "type": "object", |
180 "name": "connectInfo", | 180 "name": "connectInfo", |
181 "properties": { | 181 "properties": { |
182 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." }, | 182 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." }, |
183 "includeTlsChannelId": { "type": "boolean", "optional": true, "des
cription": "Whether the TLS channel ID will be passed into onConnectExternal for
processes that are listening for the connection event." } | 183 "includeTlsChannelId": { "type": "boolean", "optional": true, "des
cription": "Whether the TLS channel ID will be passed into onConnectExternal for
processes that are listening for the connection event." } |
184 }, | 184 }, |
185 "optional": true | 185 "optional": true |
186 } | 186 } |
187 ], | 187 ], |
(...skipping 17 matching lines...) Expand all Loading... |
205 "returns": { | 205 "returns": { |
206 "$ref": "Port", | 206 "$ref": "Port", |
207 "description": "Port through which messages can be sent and received w
ith the application" | 207 "description": "Port through which messages can be sent and received w
ith the application" |
208 } | 208 } |
209 }, | 209 }, |
210 { | 210 { |
211 "name": "sendMessage", | 211 "name": "sendMessage", |
212 "type": "function", | 212 "type": "function", |
213 "nocompile": true, | 213 "nocompile": true, |
214 "allowAmbiguousOptionalArguments": true, | 214 "allowAmbiguousOptionalArguments": true, |
215 "description": "Sends a single message to onMessage event listeners with
in the extension (or another extension/app). Similar to chrome.runtime.connect,
but only sends a single message with an optional response. The $ref:runtime.onMe
ssage event is fired in each extension page of the extension. Note that extensio
ns cannot send messages to content scripts using this method. To send messages t
o content scripts, use $ref:tabs.sendMessage.", | 215 "description": "Sends a single message to event listeners within your ex
tension/app or a different extension/app. Similar to $ref:runtime.connect but on
ly sends a single message, with an optional response. If sending to your extensi
on, the $ref:runtime.onMessage event will be fired in each page, or $ref:runtime
.onMessageExternal, if a different extension. Note that extensions cannot send m
essages to content scripts using this method. To send messages to content script
s, use $ref:tabs.sendMessage.", |
216 "parameters": [ | 216 "parameters": [ |
217 {"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."}, | 217 {"type": "string", "name": "extensionId", "optional": true, "descripti
on": "The ID of the extension/app to send the message to. If omitted, the messag
e will be sent to your own extension/app. Required if sending messages from a we
b page for <a href=\"manifest/externally_connectable.html\">web messaging</a>."}
, |
218 { "type": "any", "name": "message" }, | 218 { "type": "any", "name": "message" }, |
219 { | 219 { |
220 "type": "object", | 220 "type": "object", |
221 "name": "options", | 221 "name": "options", |
222 "properties": { | 222 "properties": { |
223 "includeTlsChannelId": { "type": "boolean", "optional": true, "des
cription": "Whether the TLS channel ID will be passed into onMessageExternal for
processes that are listening for the connection event." } | 223 "includeTlsChannelId": { "type": "boolean", "optional": true, "des
cription": "Whether the TLS channel ID will be passed into onMessageExternal for
processes that are listening for the connection event." } |
224 }, | 224 }, |
225 "optional": true | 225 "optional": true |
226 }, | 226 }, |
227 { | 227 { |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 "type": "string", | 465 "type": "string", |
466 "name": "reason", | 466 "name": "reason", |
467 "description": "The reason that the event is being dispatched. 'app_
update' is used when the restart is needed because the application is updated to
a newer version. 'os_update' is used when the restart is needed because the bro
wser/OS is updated to a newer version. 'periodic' is used when the system runs f
or more than the permitted uptime set in the enterprise policy.", | 467 "description": "The reason that the event is being dispatched. 'app_
update' is used when the restart is needed because the application is updated to
a newer version. 'os_update' is used when the restart is needed because the bro
wser/OS is updated to a newer version. 'periodic' is used when the system runs f
or more than the permitted uptime set in the enterprise policy.", |
468 "enum": ["app_update", "os_update", "periodic"] | 468 "enum": ["app_update", "os_update", "periodic"] |
469 } | 469 } |
470 ] | 470 ] |
471 } | 471 } |
472 ] | 472 ] |
473 } | 473 } |
474 ] | 474 ] |
OLD | NEW |