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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 "isInstanceOf": "Window", | 75 "isInstanceOf": "Window", |
76 "additionalProperties": { "type": "any" }, | 76 "additionalProperties": { "type": "any" }, |
77 "description": "The JavaScript 'window' object for the backgroun
d page." | 77 "description": "The JavaScript 'window' object for the backgroun
d page." |
78 } | 78 } |
79 ] | 79 ] |
80 } | 80 } |
81 ] | 81 ] |
82 }, | 82 }, |
83 { | 83 { |
84 "name": "getManifest", | 84 "name": "getManifest", |
85 "description": "Returns details about the app or extension from the mani
fest. The object returned is a serialization of the full <a href=\"manifest.html
\">manifest file</a>.", | 85 "description": "Returns details about the app or extension from the mani
fest. The object returned is a serialization of the full <a href=\"manifest\">ma
nifest file</a>.", |
86 "type": "function", | 86 "type": "function", |
87 "nocompile": true, | 87 "nocompile": true, |
88 "parameters": [], | 88 "parameters": [], |
89 "returns": { | 89 "returns": { |
90 "type": "object", | 90 "type": "object", |
91 "properties": {}, | 91 "properties": {}, |
92 "additionalProperties": { "type": "any" }, | 92 "additionalProperties": { "type": "any" }, |
93 "description": "The manifest details." | 93 "description": "The manifest details." |
94 } | 94 } |
95 }, | 95 }, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 { | 162 { |
163 "name": "restart", | 163 "name": "restart", |
164 "description": "Restart the ChromeOS device when the app runs in kiosk m
ode. Otherwise, it's no-op.", | 164 "description": "Restart the ChromeOS device when the app runs in kiosk m
ode. Otherwise, it's no-op.", |
165 "type": "function", | 165 "type": "function", |
166 "parameters": [] | 166 "parameters": [] |
167 }, | 167 }, |
168 { | 168 { |
169 "name": "connect", | 169 "name": "connect", |
170 "type": "function", | 170 "type": "function", |
171 "nocompile": true, | 171 "nocompile": true, |
172 "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
).", | 172 "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\">web messaging</
a>. Note that this does not connect to any listeners in a content script. Extens
ions may connect to content scripts embedded in tabs via $(ref:tabs.connect).", |
173 "parameters": [ | 173 "parameters": [ |
174 {"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>."}, | 174 {"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\">web messaging</a>."}, |
175 { | 175 { |
176 "type": "object", | 176 "type": "object", |
177 "name": "connectInfo", | 177 "name": "connectInfo", |
178 "properties": { | 178 "properties": { |
179 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." }, | 179 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." }, |
180 "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." } | 180 "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." } |
181 }, | 181 }, |
182 "optional": true | 182 "optional": true |
183 } | 183 } |
184 ], | 184 ], |
(...skipping 19 matching lines...) Expand all Loading... |
204 "description": "Port through which messages can be sent and received w
ith the application" | 204 "description": "Port through which messages can be sent and received w
ith the application" |
205 } | 205 } |
206 }, | 206 }, |
207 { | 207 { |
208 "name": "sendMessage", | 208 "name": "sendMessage", |
209 "type": "function", | 209 "type": "function", |
210 "nocompile": true, | 210 "nocompile": true, |
211 "allowAmbiguousOptionalArguments": true, | 211 "allowAmbiguousOptionalArguments": true, |
212 "description": "Sends a single message to event listeners within your ex
tension/app or a different extension/app. Similar to $(ref:runtime.connect) but
only sends a single message, with an optional response. If sending to your exten
sion, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:ru
ntime.onMessageExternal), if a different extension. Note that extensions cannot
send messages to content scripts using this method. To send messages to content
scripts, use $(ref:tabs.sendMessage).", | 212 "description": "Sends a single message to event listeners within your ex
tension/app or a different extension/app. Similar to $(ref:runtime.connect) but
only sends a single message, with an optional response. If sending to your exten
sion, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:ru
ntime.onMessageExternal), if a different extension. Note that extensions cannot
send messages to content scripts using this method. To send messages to content
scripts, use $(ref:tabs.sendMessage).", |
213 "parameters": [ | 213 "parameters": [ |
214 {"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>."}
, | 214 {"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\">web messaging</a>."}, |
215 { "type": "any", "name": "message" }, | 215 { "type": "any", "name": "message" }, |
216 { | 216 { |
217 "type": "object", | 217 "type": "object", |
218 "name": "options", | 218 "name": "options", |
219 "properties": { | 219 "properties": { |
220 "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." } | 220 "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." } |
221 }, | 221 }, |
222 "optional": true | 222 "optional": true |
223 }, | 223 }, |
224 { | 224 { |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 "type": "string", | 462 "type": "string", |
463 "name": "reason", | 463 "name": "reason", |
464 "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.", | 464 "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.", |
465 "enum": ["app_update", "os_update", "periodic"] | 465 "enum": ["app_update", "os_update", "periodic"] |
466 } | 466 } |
467 ] | 467 ] |
468 } | 468 } |
469 ] | 469 ] |
470 } | 470 } |
471 ] | 471 ] |
OLD | NEW |