| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 [ |
| 6 { |
| 7 "namespace": "extension", |
| 8 "nocompile": true, |
| 9 "dependencies": [ "events", "tabs" ], |
| 10 "types": [ |
| 11 { |
| 12 "id": "MessageSender", |
| 13 "type": "object", |
| 14 "description": "An object containing information about the script contex
t that sent a message or request.", |
| 15 "properties": { |
| 16 "tab": {"$ref": "tabs.Tab", "optional": true, "description":"This prop
erty will <b>only</b> be present when the connection was opened from a tab or co
ntent script."}, |
| 17 "id": {"type": "string", "description": "The extension ID of the exten
sion that opened the connection."} |
| 18 } |
| 19 } |
| 20 ], |
| 21 "properties": { |
| 22 "lastError": { |
| 23 "type": "object", |
| 24 "optional": true, |
| 25 "unprivileged": true, |
| 26 "description": "Set for the lifetime of a callback if an ansychronous ex
tension api has resulted in an error. If no error has occured lastError will be
<var>undefined</var>.", |
| 27 "properties": { |
| 28 "message": { "type": "string", "description": "Description of the erro
r that has taken place." } |
| 29 } |
| 30 }, |
| 31 "inIncognitoContext": { |
| 32 "type": "boolean", |
| 33 "optional": true, |
| 34 "unprivileged": true, |
| 35 "description": "True for content scripts running inside incognito tabs,
and for extension pages running inside an incognito process. The latter only app
lies to extensions with 'split' incognito_behavior." |
| 36 } |
| 37 }, |
| 38 "functions": [ |
| 39 { |
| 40 "name": "sendRequest", |
| 41 "nodoc": true, |
| 42 "type": "function", |
| 43 "allowAmbiguousOptionalArguments": true, |
| 44 "unprivileged": true, |
| 45 "description": "Deprecated: Please use sendMessage.", |
| 46 "parameters": [ |
| 47 {"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."}, |
| 48 { "type": "any", "name": "request" }, |
| 49 { |
| 50 "type": "function", |
| 51 "name": "responseCallback", |
| 52 "optional": true, |
| 53 "parameters": [ |
| 54 { |
| 55 "name": "response", |
| 56 "type": "any", |
| 57 "description": "The JSON response object sent by the handler of
the request. If an error occurs while connecting to the extension, the callback
will be called with no arguments and $ref:runtime.lastError will be set to the e
rror message." |
| 58 } |
| 59 ] |
| 60 } |
| 61 ] |
| 62 }, |
| 63 { |
| 64 "name": "getURL", |
| 65 "type": "function", |
| 66 "unprivileged": true, |
| 67 "description": "Converts a relative path within an extension install dir
ectory to a fully-qualified URL.", |
| 68 "parameters": [ |
| 69 { |
| 70 "type": "string", |
| 71 "name": "path", |
| 72 "description": "A path to a resource within an extension expressed r
elative to its install directory." |
| 73 } |
| 74 ], |
| 75 "returns": { |
| 76 "type": "string", |
| 77 "description": "The fully-qualified URL to the resource." |
| 78 } |
| 79 }, |
| 80 { |
| 81 "name": "getViews", |
| 82 "type": "function", |
| 83 "description": "Returns an array of the JavaScript 'window' objects for
each of the pages running inside the current extension.", |
| 84 "parameters": [ |
| 85 { |
| 86 "type": "object", |
| 87 "name": "fetchProperties", |
| 88 "optional": true, |
| 89 "properties": { |
| 90 "type": { |
| 91 "type": "string", |
| 92 "enum": ["tab", "infobar", "notification", "popup"], |
| 93 "optional": true, |
| 94 "description": "The type of view to get. If omitted, returns all
views (including background pages and tabs). Valid values: 'tab', 'infobar', 'n
otification', 'popup'." |
| 95 }, |
| 96 "windowId": { |
| 97 "type": "integer", |
| 98 "optional": true, |
| 99 "description": "The window to restrict the search to. If omitted
, returns all views." |
| 100 } |
| 101 } |
| 102 } |
| 103 ], |
| 104 "returns": { |
| 105 "type": "array", |
| 106 "description": "Array of global objects", |
| 107 "items": { "type": "object", "isInstanceOf": "global", "additionalProp
erties": { "type": "any" } } |
| 108 } |
| 109 }, |
| 110 { |
| 111 "name": "getBackgroundPage", |
| 112 "type": "function", |
| 113 "description": "Returns the JavaScript 'window' object for the backgroun
d page running inside the current extension. Returns null if the extension has n
o background page.", |
| 114 "parameters": [], |
| 115 "returns": { |
| 116 "type": "object", "isInstanceOf": "global", "additionalProperties": {
"type": "any" } |
| 117 } |
| 118 }, |
| 119 { |
| 120 "name": "getExtensionTabs", |
| 121 "nodoc": true, |
| 122 "type": "function", |
| 123 "maximumManifestVersion": 1, |
| 124 "description": "Deprecated. Please use getViews({type: 'TAB'}). Returns
an array of the JavaScript 'window' objects for each of the tabs running inside
the current extension. If windowId is specified, returns only the 'window' objec
ts of tabs attached to the specified window.", |
| 125 "parameters": [ |
| 126 {"type": "integer", "name": "windowId", "optional": true} |
| 127 ], |
| 128 "returns": { |
| 129 "type": "array", |
| 130 "description": "Array of global window objects", |
| 131 "items": { "type": "object", "isInstanceOf": "global", "additionalProp
erties": { "type": "any" } } |
| 132 } |
| 133 }, |
| 134 { |
| 135 "name": "isAllowedIncognitoAccess", |
| 136 "type": "function", |
| 137 "description": "Retrieves the state of the extension's access to Incogni
to-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.", |
| 138 "min_version": "12.0.706.0", |
| 139 "parameters": [ |
| 140 { |
| 141 "type": "function", |
| 142 "name": "callback", |
| 143 "parameters": [ |
| 144 { |
| 145 "name": "isAllowedAccess", |
| 146 "type": "boolean", |
| 147 "description": "True if the extension has access to Incognito mo
de, false otherwise." |
| 148 } |
| 149 ] |
| 150 } |
| 151 ] |
| 152 }, |
| 153 { |
| 154 "name": "isAllowedFileSchemeAccess", |
| 155 "type": "function", |
| 156 "description": "Retrieves the state of the extension's access to the 'fi
le://' scheme (as determined by the user-controlled 'Allow access to File URLs'
checkbox.", |
| 157 "min_version": "12.0.706.0", |
| 158 "parameters": [ |
| 159 { |
| 160 "type": "function", |
| 161 "name": "callback", |
| 162 "parameters": [ |
| 163 { |
| 164 "name": "isAllowedAccess", |
| 165 "type": "boolean", |
| 166 "description": "True if the extension can access the 'file://' s
cheme, false otherwise." |
| 167 } |
| 168 ] |
| 169 } |
| 170 ] |
| 171 }, |
| 172 { |
| 173 "name": "setUpdateUrlData", |
| 174 "type": "function", |
| 175 "description": "Sets the value of the ap CGI parameter used in the exten
sion's update URL. This value is ignored for extensions that are hosted in the
Chrome Extension Gallery.", |
| 176 "parameters": [ |
| 177 {"type": "string", "name": "data", "maxLength": 1024} |
| 178 ] |
| 179 } |
| 180 ], |
| 181 "events": [ |
| 182 { |
| 183 "name": "onRequest", |
| 184 "nodoc": true, |
| 185 "type": "function", |
| 186 "anonymous": true, |
| 187 "unprivileged": true, |
| 188 "description": "Deprecated: please use onMessage.", |
| 189 "parameters": [ |
| 190 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
| 191 {"name": "sender", "$ref": "MessageSender" }, |
| 192 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object, or undefined if there is no response. If you have more than one
<code>onRequest</code> listener in the same document, then only one may send a
response." } |
| 193 ] |
| 194 }, |
| 195 { |
| 196 "name": "onRequestExternal", |
| 197 "nodoc": true, |
| 198 "type": "function", |
| 199 "anonymous": true, |
| 200 "description": "Deprecated: please use onMessageExternal.", |
| 201 "parameters": [ |
| 202 {"name": "request", "type": "any", "description": "The request sent by
the calling script."}, |
| 203 {"name": "sender", "$ref": "MessageSender" }, |
| 204 {"name": "sendResponse", "type": "function", "description": "Function
to call when you have a response. The argument should be any JSON-ifiable object
, or undefined if there is no response." } |
| 205 ] |
| 206 } |
| 207 ] |
| 208 } |
| 209 ] |
| OLD | NEW |