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.
7 "namespace": "extension",
8 "description": "The <code>chrome.extension</code> API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in <a href='messaging.html'>Message Passing</a>.",
10 "implemented_in": "chrome/browser/extensions/api/module/module.h"
16 "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>.",
18 "message": { "type": "string", "description": "Description of the error that has taken place." }
21 "inIncognitoContext": {
24 "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."
29 "name": "sendRequest",
31 "deprecated": "Please use $(ref:runtime.sendMessage).",
33 "allowAmbiguousOptionalArguments": true,
34 "description": "Sends a single request to other listeners within the extension. Similar to $(ref:runtime.connect), but only sends a single request with an optional response. The $(ref:extension.onRequest) event is fired in each page of the extension.",
36 {"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."},
37 { "type": "any", "name": "request" },
40 "name": "responseCallback",
46 "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 error message."
56 "description": "Converts a relative path within an extension install directory to a fully-qualified URL.",
61 "description": "A path to a resource within an extension expressed relative to its install directory."
66 "description": "The fully-qualified URL to the resource."
73 "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.",
77 "name": "fetchProperties",
82 "enum": ["tab", "infobar", "notification", "popup"],
84 "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'infobar', 'notification', 'popup'."
89 "description": "The window to restrict the search to. If omitted, returns all views."
96 "description": "Array of global objects",
98 "name": "viewGlobals",
100 "isInstanceOf": "Window",
101 "additionalProperties": { "type": "any" }
106 "name": "getBackgroundPage",
109 "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
114 "name": "backgroundPageGlobal",
115 "isInstanceOf": "Window",
116 "additionalProperties": { "type": "any" }
120 "name": "getExtensionTabs",
122 "deprecated": "Please use $(ref:extension.getViews) <code>{type: \"tab\"}</code>.",
124 "maximumManifestVersion": 1,
125 "description": "Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If <code>windowId</code> is specified, returns only the 'window' objects of tabs attached to the specified window.",
127 {"type": "integer", "name": "windowId", "optional": true}
131 "description": "Array of global window objects",
134 "name": "tabGlobals",
135 "isInstanceOf": "Window",
136 "additionalProperties": { "type": "any" }
141 "name": "isAllowedIncognitoAccess",
143 "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.",
144 "min_version": "12.0.706.0",
151 "name": "isAllowedAccess",
153 "description": "True if the extension has access to Incognito mode, false otherwise."
160 "name": "isAllowedFileSchemeAccess",
162 "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.",
163 "min_version": "12.0.706.0",
170 "name": "isAllowedAccess",
172 "description": "True if the extension can access the 'file://' scheme, false otherwise."
179 "name": "setUpdateUrlData",
181 "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.",
183 {"type": "string", "name": "data", "maxLength": 1024}
190 "deprecated": "Please use $(ref:runtime.onMessage).",
195 "description": "Fired when a request is sent from either an extension process or a content script.",
197 {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
198 {"name": "sender", "$ref": "runtime.MessageSender" },
199 {"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." }
203 "name": "onRequestExternal",
204 "deprecated": "Please use $(ref:runtime.onMessageExternal).",
209 "description": "Fired when a request is sent from another extension.",
211 {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
212 {"name": "sender", "$ref": "runtime.MessageSender" },
213 {"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." }