| 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 "documentation_permissions_required": ["runtime"], | 8 "documentation_permissions_required": ["runtime"], |
| 9 "types": [ | 9 "types": [ |
| 10 { | 10 { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 "id": {"type": "string", "description": "The ID of the extension or ap
p that opened the connection."}, | 34 "id": {"type": "string", "description": "The ID of the extension or ap
p that opened the connection."}, |
| 35 "url": {"type": "string", "optional": true, "description": "The URL of
the page or frame that opened the connection. This property will <strong>only</
strong> be present when the connection was opened from a tab (including content
scripts)."} | 35 "url": {"type": "string", "optional": true, "description": "The URL of
the page or frame that opened the connection. This property will <strong>only</
strong> be present when the connection was opened from a tab (including content
scripts)."} |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 ], | 38 ], |
| 39 "properties": { | 39 "properties": { |
| 40 "lastError": { | 40 "lastError": { |
| 41 "type": "object", | 41 "type": "object", |
| 42 "optional": true, | 42 "optional": true, |
| 43 "description": "This will be defined during an API method callback if th
ere was an error", | 43 "description": "This will be defined during an API method callback if th
ere was an error", |
| 44 "unprivileged": true, | |
| 45 "properties": { | 44 "properties": { |
| 46 "message": { | 45 "message": { |
| 47 "optional": true, | 46 "optional": true, |
| 48 "type": "string", | 47 "type": "string", |
| 49 "description": "Details about the error which occurred." | 48 "description": "Details about the error which occurred." |
| 50 } | 49 } |
| 51 } | 50 } |
| 52 }, | 51 }, |
| 53 "id": { | 52 "id": { |
| 54 "type": "string", | 53 "type": "string", |
| 55 "description": "The ID of the extension/app.", | 54 "description": "The ID of the extension/app." |
| 56 "unprivileged": true | |
| 57 } | 55 } |
| 58 }, | 56 }, |
| 59 "functions": [ | 57 "functions": [ |
| 60 { | 58 { |
| 61 "name": "getBackgroundPage", | 59 "name": "getBackgroundPage", |
| 62 "type": "function", | 60 "type": "function", |
| 63 "description": "Retrieves the JavaScript 'window' object for the backgro
und page running inside the current extension/app. If the background page is an
event page, the system will ensure it is loaded before calling the callback. If
there is no background page, an error is set.", | 61 "description": "Retrieves the JavaScript 'window' object for the backgro
und page running inside the current extension/app. If the background page is an
event page, the system will ensure it is loaded before calling the callback. If
there is no background page, an error is set.", |
| 64 "parameters": [ | 62 "parameters": [ |
| 65 { | 63 { |
| 66 "type": "function", | 64 "type": "function", |
| (...skipping 10 matching lines...) Expand all Loading... |
| 77 "description": "The JavaScript 'window' object for the backgroun
d page." | 75 "description": "The JavaScript 'window' object for the backgroun
d page." |
| 78 } | 76 } |
| 79 ] | 77 ] |
| 80 } | 78 } |
| 81 ] | 79 ] |
| 82 }, | 80 }, |
| 83 { | 81 { |
| 84 "name": "getManifest", | 82 "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>.", | 83 "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>.", |
| 86 "type": "function", | 84 "type": "function", |
| 87 "unprivileged": true, | |
| 88 "parameters": [], | 85 "parameters": [], |
| 89 "returns": { | 86 "returns": { |
| 90 "type": "object", | 87 "type": "object", |
| 91 "properties": {}, | 88 "properties": {}, |
| 92 "additionalProperties": { "type": "any" }, | 89 "additionalProperties": { "type": "any" }, |
| 93 "description": "The manifest details." | 90 "description": "The manifest details." |
| 94 } | 91 } |
| 95 }, | 92 }, |
| 96 { | 93 { |
| 97 "name": "getURL", | 94 "name": "getURL", |
| 98 "type": "function", | 95 "type": "function", |
| 99 "unprivileged": true, | |
| 100 "description": "Converts a relative path within an app/extension install
directory to a fully-qualified URL.", | 96 "description": "Converts a relative path within an app/extension install
directory to a fully-qualified URL.", |
| 101 "parameters": [ | 97 "parameters": [ |
| 102 { | 98 { |
| 103 "type": "string", | 99 "type": "string", |
| 104 "name": "path", | 100 "name": "path", |
| 105 "description": "A path to a resource within an app/extension express
ed relative to its install directory." | 101 "description": "A path to a resource within an app/extension express
ed relative to its install directory." |
| 106 } | 102 } |
| 107 ], | 103 ], |
| 108 "returns": { | 104 "returns": { |
| 109 "type": "string", | 105 "type": "string", |
| 110 "description": "The fully-qualified URL to the resource." | 106 "description": "The fully-qualified URL to the resource." |
| 111 } | 107 } |
| 112 }, | 108 }, |
| 113 { | 109 { |
| 114 "name": "reload", | 110 "name": "reload", |
| 115 "description": "Reloads the app or extension.", | 111 "description": "Reloads the app or extension.", |
| 116 "type": "function", | 112 "type": "function", |
| 117 "unprivileged": true, | |
| 118 "parameters": [] | 113 "parameters": [] |
| 119 }, | 114 }, |
| 120 { | 115 { |
| 121 "name": "requestUpdateCheck", | 116 "name": "requestUpdateCheck", |
| 122 "type": "function", | 117 "type": "function", |
| 123 "unprivileged": true, | |
| 124 "description": "Requests an update check for this app/extension.", | 118 "description": "Requests an update check for this app/extension.", |
| 125 "parameters": [ | 119 "parameters": [ |
| 126 { | 120 { |
| 127 "type": "function", | 121 "type": "function", |
| 128 "name": "callback", | 122 "name": "callback", |
| 129 "parameters": [ | 123 "parameters": [ |
| 130 { | 124 { |
| 131 "name": "status", | 125 "name": "status", |
| 132 "type": "string", | 126 "type": "string", |
| 133 "enum": ["throttled", "no_update", "update_available"], | 127 "enum": ["throttled", "no_update", "update_available"], |
| (...skipping 11 matching lines...) Expand all Loading... |
| 145 }, | 139 }, |
| 146 "description": "If an update is available, this contains more in
formation about the available update." | 140 "description": "If an update is available, this contains more in
formation about the available update." |
| 147 } | 141 } |
| 148 ] | 142 ] |
| 149 } | 143 } |
| 150 ] | 144 ] |
| 151 }, | 145 }, |
| 152 { | 146 { |
| 153 "name": "connect", | 147 "name": "connect", |
| 154 "type": "function", | 148 "type": "function", |
| 155 "unprivileged": true, | |
| 156 "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.", | 149 "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.", |
| 157 "parameters": [ | 150 "parameters": [ |
| 158 {"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."}, | 151 {"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."}, |
| 159 { | 152 { |
| 160 "type": "object", | 153 "type": "object", |
| 161 "name": "connectInfo", | 154 "name": "connectInfo", |
| 162 "properties": { | 155 "properties": { |
| 163 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." } | 156 "name": { "type": "string", "optional": true, "description": "Will
be passed into onConnect for processes that are listening for the connection ev
ent." } |
| 164 }, | 157 }, |
| 165 "optional": true | 158 "optional": true |
| (...skipping 17 matching lines...) Expand all Loading... |
| 183 ], | 176 ], |
| 184 "returns": { | 177 "returns": { |
| 185 "$ref": "Port", | 178 "$ref": "Port", |
| 186 "description": "Port through which messages can be sent and received w
ith the application" | 179 "description": "Port through which messages can be sent and received w
ith the application" |
| 187 } | 180 } |
| 188 }, | 181 }, |
| 189 { | 182 { |
| 190 "name": "sendMessage", | 183 "name": "sendMessage", |
| 191 "type": "function", | 184 "type": "function", |
| 192 "allowAmbiguousOptionalArguments": true, | 185 "allowAmbiguousOptionalArguments": true, |
| 193 "unprivileged": true, | |
| 194 "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.", | 186 "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.", |
| 195 "parameters": [ | 187 "parameters": [ |
| 196 {"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."}, | 188 {"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."}, |
| 197 { "type": "any", "name": "message" }, | 189 { "type": "any", "name": "message" }, |
| 198 { | 190 { |
| 199 "type": "function", | 191 "type": "function", |
| 200 "name": "responseCallback", | 192 "name": "responseCallback", |
| 201 "optional": true, | 193 "optional": true, |
| 202 "parameters": [ | 194 "parameters": [ |
| 203 { | 195 { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 }, | 297 }, |
| 306 { | 298 { |
| 307 "name": "onBrowserUpdateAvailable", | 299 "name": "onBrowserUpdateAvailable", |
| 308 "type": "function", | 300 "type": "function", |
| 309 "description": "Fired when a Chrome update is available, but isn't insta
lled immediately because a browser restart is required.", | 301 "description": "Fired when a Chrome update is available, but isn't insta
lled immediately because a browser restart is required.", |
| 310 "parameters": [] | 302 "parameters": [] |
| 311 }, | 303 }, |
| 312 { | 304 { |
| 313 "name": "onConnect", | 305 "name": "onConnect", |
| 314 "type": "function", | 306 "type": "function", |
| 315 "unprivileged": true, | |
| 316 "anonymous": true, | 307 "anonymous": true, |
| 317 "description": "Fired when a connection is made from either an extension
process or a content script.", | 308 "description": "Fired when a connection is made from either an extension
process or a content script.", |
| 318 "parameters": [ | 309 "parameters": [ |
| 319 {"$ref": "Port", "name": "port"} | 310 {"$ref": "Port", "name": "port"} |
| 320 ] | 311 ] |
| 321 }, | 312 }, |
| 322 { | 313 { |
| 323 "name": "onConnectExternal", | 314 "name": "onConnectExternal", |
| 324 "type": "function", | 315 "type": "function", |
| 325 "anonymous": true, | 316 "anonymous": true, |
| 326 "description": "Fired when a connection is made from another extension."
, | 317 "description": "Fired when a connection is made from another extension."
, |
| 327 "parameters": [ | 318 "parameters": [ |
| 328 {"$ref": "Port", "name": "port"} | 319 {"$ref": "Port", "name": "port"} |
| 329 ] | 320 ] |
| 330 }, | 321 }, |
| 331 { | 322 { |
| 332 "name": "onMessage", | 323 "name": "onMessage", |
| 333 "type": "function", | 324 "type": "function", |
| 334 "anonymous": true, | 325 "anonymous": true, |
| 335 "unprivileged": true, | |
| 336 "description": "Fired when a message is sent from either an extension pr
ocess or a content script.", | 326 "description": "Fired when a message is sent from either an extension pr
ocess or a content script.", |
| 337 "parameters": [ | 327 "parameters": [ |
| 338 {"name": "message", "type": "any", "description": "The message sent by
the calling script."}, | 328 {"name": "message", "type": "any", "description": "The message sent by
the calling script."}, |
| 339 {"name": "sender", "$ref": "MessageSender" }, | 329 {"name": "sender", "$ref": "MessageSender" }, |
| 340 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} | 330 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} |
| 341 ], | 331 ], |
| 342 "returns": { | 332 "returns": { |
| 343 "type": "boolean", | 333 "type": "boolean", |
| 344 "optional": "true", | 334 "optional": "true", |
| 345 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 335 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
| (...skipping 14 matching lines...) Expand all Loading... |
| 360 "optional": "true", | 350 "optional": "true", |
| 361 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 351 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
| 362 } | 352 } |
| 363 } | 353 } |
| 364 | 354 |
| 365 | 355 |
| 366 | 356 |
| 367 ] | 357 ] |
| 368 } | 358 } |
| 369 ] | 359 ] |
| OLD | NEW |