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

Unified Diff: chrome/common/extensions/api/extension.json

Issue 8869003: Move the "extension" namespace from extension_api.json into extension_api_extension.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build.py again? Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/common_resources.grd ('k') | chrome/common/extensions/api/extension_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/extension.json
diff --git a/chrome/common/extensions/api/extension.json b/chrome/common/extensions/api/extension.json
new file mode 100644
index 0000000000000000000000000000000000000000..0e5dd4fc881adf02102cdb0951bba3941cfcb5cc
--- /dev/null
+++ b/chrome/common/extensions/api/extension.json
@@ -0,0 +1,263 @@
+[
+ {
+ "namespace": "extension",
+ "types": [
+ {
+ "id": "MessageSender",
+ "type": "object",
+ "description": "An object containing information about the script context that sent a message or request.",
+ "properties": {
+ "tab": {"$ref": "Tab", "optional": true, "description":"This property will <b>only</b> be present when the connection was opened from a tab or content script."},
+ "id": {"type": "string", "description": "The extension ID of the extension that opened the connection."}
+ }
+ },
+ {
+ "id": "Event",
+ "type": "object",
+ "description": "An object which allows the addition and removal of listeners for a Chrome event.",
+ "properties": {
+ "addListener": {"type": "function"},
+ "removeListener": {"type": "function"},
+ "hasListener": {"type": "function"},
+ "hasListeners": {"type": "function"}
+ },
+ "additionalProperties": { "type": "any"}
+ },
+ {
+ "id": "Port",
+ "type": "object",
+ "description": "An object which allows two way communication with other pages.",
+ "properties": {
+ "name": {"type": "string"},
+ "onDisconnect": { "$ref": "Event" },
+ "onMessage": { "$ref": "Event" },
+ "postMessage": {"type": "function"},
+ "sender": {
+ "$ref": "MessageSender",
+ "optional": true,
+ "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
+ }
+ },
+ "additionalProperties": { "type": "any"}
+ }
+ ],
+ "properties": {
+ "lastError": {
+ "type": "object",
+ "optional": true,
+ "unprivileged": true,
+ "description": "Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.",
+ "properties": {
+ "message": { "type": "string", "description": "Description of the error that has taken place." }
+ }
+ },
+ "inIncognitoContext": {
+ "type": "boolean",
+ "optional": true,
+ "unprivileged": true,
+ "description": "True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior."
+ }
+ },
+ "functions": [
+ {
+ "name": "connect",
+ "type": "function",
+ "unprivileged": true,
+ "description": "Attempts to connect to other listeners within the extension (such as the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via <a href='tabs.html#method-connect'><code>chrome.tabs.connect()</code></a>.",
+ "parameters": [
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
+ {
+ "type": "object",
+ "name": "connectInfo",
+ "properties": {
+ "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for extension processes that are listening for the connection event." }
+ },
+ "optional": true
+ }
+ ],
+ "returns": {
+ "$ref": "Port",
+ "description": "Port through which messages can be sent and received with the extension. The port's <a href='extension.html#type-Port'>onDisconnect</a> event is fired if extension does not exist. "
+ }
+ },
+ {
+ "name": "sendRequest",
+ "type": "function",
+ "unprivileged": true,
+ "description": "Sends a single request to other listeners within the extension. Similar to chrome.extension.connect, but only sends a single request with an optional response. The <a href='extension.html#event-onRequest'>chrome.extension.onRequest</a> event is fired in each page of the extension.",
+ "parameters": [
+ {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
+ { "type": "any", "name": "request" },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "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 <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getURL",
+ "type": "function",
+ "unprivileged": true,
+ "description": "Converts a relative path within an extension install directory to a fully-qualified URL.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "path",
+ "description": "A path to a resource within an extension expressed relative to its install directory."
+ }
+ ],
+ "returns": {
+ "type": "string",
+ "description": "The fully-qualified URL to the resource."
+ }
+ },
+ {
+ "name": "getViews",
+ "type": "function",
+ "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "fetchProperties",
+ "optional": true,
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": ["tab", "infobar", "notification", "popup"],
+ "optional": true,
+ "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification', 'popup'."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "description": "The window to restrict the search to. If omitted, returns all views."
+ }
+ }
+ }
+ ],
+ "returns": {
+ "type": "array",
+ "description": "Array of global objects",
+ "items": { "type": "object", "isInstanceOf": "DOMWindow", "properties": {}, "additionalProperties": { "type": "any" } }
+ }
+ },
+ {
+ "name": "getBackgroundPage",
+ "type": "function",
+ "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
+ "parameters": [],
+ "returns": {
+ "type": "object", "isInstanceOf": "DOMWindow", "properties": {}, "additionalProperties": { "type": "any" }
+ }
+ },
+ {
+ "name": "getExtensionTabs",
+ "nodoc": true,
+ "type": "function",
+ "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' objects of tabs attached to the specified window.",
+ "parameters": [
+ {"type": "integer", "name": "windowId", "optional": true}
+ ],
+ "returns": {
+ "type": "array",
+ "description": "Array of global window objects",
+ "items": { "type": "object", "isInstanceOf": "DOMWindow", "properties": {}, "additionalProperties": { "type": "any" } }
+ }
+ },
+ {
+ "name": "isAllowedIncognitoAccess",
+ "type": "function",
+ "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.",
+ "min_version": "12.0.706.0",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "isAllowedAccess",
+ "type": "boolean",
+ "description": "True if the extension has access to Incognito mode, false otherwise."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "isAllowedFileSchemeAccess",
+ "type": "function",
+ "description": "Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.",
+ "min_version": "12.0.706.0",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "isAllowedAccess",
+ "type": "boolean",
+ "description": "True if the extension can access the 'file://' scheme, false otherwise."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setUpdateUrlData",
+ "type": "function",
+ "description": "Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery.",
+ "parameters": [
+ {"type": "string", "name": "data", "maxLength": 1024}
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onConnect",
+ "type": "function",
+ "unprivileged": true,
+ "description": "Fired when a connection is made from either an extension process or a content script.",
+ "parameters": [
+ {"$ref": "Port", "name": "port"}
+ ]
+ },
+ {
+ "name": "onConnectExternal",
+ "type": "function",
+ "description": "Fired when a connection is made from another extension.",
+ "parameters": [
+ {"$ref": "Port", "name": "port"}
+ ]
+ },
+ {
+ "name": "onRequest",
+ "type": "function",
+ "unprivileged": true,
+ "description": "Fired when a request is sent from either an extension process or a content script.",
+ "parameters": [
+ {"name": "request", "type": "any", "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"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." }
+ ]
+ },
+ {
+ "name": "onRequestExternal",
+ "type": "function",
+ "description": "Fired when a request is sent from another extension.",
+ "parameters": [
+ {"name": "request", "type": "any", "description": "The request sent by the calling script."},
+ {"name": "sender", "$ref": "MessageSender" },
+ {"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." }
+ ]
+ }
+ ]
+ }
+]
« no previous file with comments | « chrome/common/common_resources.grd ('k') | chrome/common/extensions/api/extension_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698