Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: chrome/common/extensions/api/runtime.json

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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 18 matching lines...) Expand all
184 ], 177 ],
185 "returns": { 178 "returns": {
186 "$ref": "Port", 179 "$ref": "Port",
187 "description": "Port through which messages can be sent and received w ith the application" 180 "description": "Port through which messages can be sent and received w ith the application"
188 } 181 }
189 }, 182 },
190 { 183 {
191 "name": "sendMessage", 184 "name": "sendMessage",
192 "type": "function", 185 "type": "function",
193 "allowAmbiguousOptionalArguments": true, 186 "allowAmbiguousOptionalArguments": true,
194 "unprivileged": true,
195 "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.", 187 "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.",
196 "parameters": [ 188 "parameters": [
197 {"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."}, 189 {"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."},
198 { "type": "any", "name": "message" }, 190 { "type": "any", "name": "message" },
199 { 191 {
200 "type": "function", 192 "type": "function",
201 "name": "responseCallback", 193 "name": "responseCallback",
202 "optional": true, 194 "optional": true,
203 "parameters": [ 195 "parameters": [
204 { 196 {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 }, 300 },
309 { 301 {
310 "name": "onBrowserUpdateAvailable", 302 "name": "onBrowserUpdateAvailable",
311 "type": "function", 303 "type": "function",
312 "description": "Fired when a Chrome update is available, but isn't insta lled immediately because a browser restart is required.", 304 "description": "Fired when a Chrome update is available, but isn't insta lled immediately because a browser restart is required.",
313 "parameters": [] 305 "parameters": []
314 }, 306 },
315 { 307 {
316 "name": "onConnect", 308 "name": "onConnect",
317 "type": "function", 309 "type": "function",
318 "unprivileged": true,
319 "anonymous": true, 310 "anonymous": true,
320 "description": "Fired when a connection is made from either an extension process or a content script.", 311 "description": "Fired when a connection is made from either an extension process or a content script.",
321 "parameters": [ 312 "parameters": [
322 {"$ref": "Port", "name": "port"} 313 {"$ref": "Port", "name": "port"}
323 ] 314 ]
324 }, 315 },
325 { 316 {
326 "name": "onConnectExternal", 317 "name": "onConnectExternal",
327 "type": "function", 318 "type": "function",
328 "anonymous": true, 319 "anonymous": true,
329 "description": "Fired when a connection is made from another extension." , 320 "description": "Fired when a connection is made from another extension." ,
330 "parameters": [ 321 "parameters": [
331 {"$ref": "Port", "name": "port"} 322 {"$ref": "Port", "name": "port"}
332 ] 323 ]
333 }, 324 },
334 { 325 {
335 "name": "onMessage", 326 "name": "onMessage",
336 "type": "function", 327 "type": "function",
337 "anonymous": true, 328 "anonymous": true,
338 "unprivileged": true,
339 "description": "Fired when a message is sent from either an extension pr ocess or a content script.", 329 "description": "Fired when a message is sent from either an extension pr ocess or a content script.",
340 "parameters": [ 330 "parameters": [
341 {"name": "message", "type": "any", "description": "The message sent by the calling script."}, 331 {"name": "message", "type": "any", "description": "The message sent by the calling script."},
342 {"name": "sender", "$ref": "MessageSender" }, 332 {"name": "sender", "$ref": "MessageSender" },
343 {"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)." } 333 {"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)." }
344 ], 334 ],
345 "returns": { 335 "returns": {
346 "type": "boolean", 336 "type": "boolean",
347 "optional": "true", 337 "optional": "true",
348 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns." 338 "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
363 "optional": "true", 353 "optional": "true",
364 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns." 354 "description": "Return true from the event listener if you wish to cal l <code>sendResponse</code> after the event listener returns."
365 } 355 }
366 } 356 }
367 357
368 358
369 359
370 ] 360 ]
371 } 361 }
372 ] 362 ]
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698