Management
For information on how to use experimental APIs, see the chrome.experimental.* APIs page.
Management
The chrome.management
module provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page.
Manifest
You must declare the "management" permission
in the extension manifest
to use the management API.
For example:
{
"name": "My extension",
...
"permissions": [
"management"
],
...
}
API reference: chrome.management
Properties
getLastError
chrome.extensionlastError
Methods
get
void
chrome.management.get(, string
id, function
callback)
Undocumented.
Return information about the installed extension or app that has the given ID.
Parameters
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The ID from an item of ExtensionInfo.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function(ExtensionInfo result) {...};
-
result
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
getAll
void
chrome.management.getAll(, function
callback)
Undocumented.
Returns a list of information about installed extensions and apps.
Parameters
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function(array of ExtensionInfo result) {...};
-
result
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
launchApp
void
chrome.management.launchApp(, string
id, function
callback)
Undocumented.
Launches an application.
Parameters
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The extension id of the application.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
setEnabled
void
chrome.management.setEnabled(, string
id, boolean
enabled, function
callback)
Undocumented.
Enable or disable an app or extension.
Parameters
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- This should be the id from an item of ExtensionInfo.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
enabled
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- Whether this item should be enabled or disabled.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
uninstall
void
chrome.management.uninstall(, string
id, function
callback)
Undocumented.
Uninstall a currently installed app or extension.
Parameters
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- This should be the id from an item of ExtensionInfo.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
Events
onDisabled
chrome.management.onDisabled.addListener(function(ExtensionInfo info) {...});
Undocumented.
Fired when an app or extension has been disabled
Parameters
-
info
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
onEnabled
chrome.management.onEnabled.addListener(function(ExtensionInfo info) {...});
Undocumented.
Fired when an app or extension has been enabled.
Parameters
-
info
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
onInstalled
chrome.management.onInstalled.addListener(function(ExtensionInfo info) {...});
Undocumented.
Fired when an app or extension has been installed.
Parameters
-
info
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
onUninstalled
chrome.management.onUninstalled.addListener(function(string id) {...});
Undocumented.
Fired when an app or extension has been uninstalled.
Parameters
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The id of the extension or app that was uninstalled.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Types
IconInfo
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Information about an icon belonging to an extension or app.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
size
(
optional
enumerated
Type
array of
integer
)
-
Undocumented.
- A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
url
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append
?grayscale=true
to the URL.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
ExtensionInfo
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Information about an installed extension or app.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
id
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The extension's unique identifier.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
name
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The name of this extension or app.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
description
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The description of this extension or app.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
version
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The version of this extension or app.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
mayDisable
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- Whether this extension can be disabled or uninstalled by the user.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
enabled
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- Whether it is currently enabled or disabled.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
isApp
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- True if this is an app.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
appLaunchUrl
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The launch url (only present for apps).
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
homepageUrl
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The URL of the homepage of this extension or app
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
optionsUrl
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- The url for the item's options page, if it has one.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
icons
(
optional
enumerated
Type
array of
IconInfo
array of
paramType
paramType
)
-
Undocumented.
- A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
permissions
(
optional
enumerated
Type
array of
Type
array of
string
paramType
)
-
Undocumented.
- Returns a list of API based permissions.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
hostPermissions
(
optional
enumerated
Type
array of
Type
array of
string
paramType
)
-
Undocumented.
- Returns a list of host based permissions.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-