JavaScript APIs
Chrome provides apps with many special-purpose APIs like
chrome.runtime
and chrome.alarms
.
Stable APIs
Name | Description | Since |
---|---|---|
alarms | Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. |
22 |
app.runtime | Use the chrome.app.runtime API to manage the app lifecycle. The app runtime manages app installation, controls the event page, and can shut down the app at anytime. |
23 |
app.window | Use the chrome.app.window API to create windows. Windows have an optional frame with title bar and size controls. They are not associated with any Chrome browser windows. |
23 |
contextMenus | Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. |
6 |
events | The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. |
21 |
fileSystem | Use the chrome.fileSystem API to create, read, navigate, and write to a sandboxed section of the user's local file system. With this API, Chrome Apps can read and write to a user-selected location. For example, a text editor app can use the API to read and write local documents. All failures are notified via chrome.runtime.lastError. |
23 |
i18n | Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. |
5 |
identity | Use the chrome.identity API to get OAuth2 access tokens. |
29 |
idle | Use the chrome.idle API to detect when the machine's idle state changes. |
6 |
mediaGalleries | Use the chrome.mediaGalleries API to access media files (audio, images, video) from the user's local disks (with the user's consent). |
23 |
notifications | Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. |
28 |
permissions | Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. |
16 |
power | Use the chrome.power API to override the system's power management features. |
27 |
pushMessaging | Use chrome.pushMessaging to enable apps and extensions to receive message data sent through Google Cloud Messaging. |
24 |
runtime | Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. |
22 |
serial | Use the chrome.serial API to read from and write to a device connected to a serial port. |
23 |
socket | Use the chrome.socket API to send and receive data over the network using TCP and UDP connections. Note: Starting with Chrome 33, this API is deprecated in favor of the sockets.udp, sockets.tcp and sockets.tcpServer APIs. |
24 |
sockets.tcp | Use the chrome.sockets.tcp API to send and receive data over the network using TCP connections. This API supersedes the TCP functionality previously found in the chrome.socket API. |
33 |
sockets.tcpServer | Use the chrome.sockets.tcpServer API to create server applications using TCP connections. This API supersedes the TCP functionality previously found in the chrome.socket API. |
33 |
sockets.udp | Use the chrome.sockets.udp API to send and receive data over the network using UDP connections. This API supersedes the UDP functionality previously found in the "socket" API. |
33 |
storage | Use the chrome.storage API to store, retrieve, and track changes to user data. |
20 |
syncFileSystem | Use the chrome.syncFileSystem API to save and synchronize data on Google Drive. This API is NOT for accessing arbitrary user docs stored in Google Drive. It provides app-specific syncable storage for offline and caching usage so that the same data can be available across different clients. Read Manage Data for more on using this API. |
27 |
system.cpu | Use the system.cpu API to query CPU metadata. |
32 |
system.display | Use the system.display API to query display metadata. |
30 |
system.memory | The chrome.system.memory API. |
32 |
system.network | Use the chrome.system.network API. |
33 |
system.storage | Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. |
30 |
tts | Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. |
14 |
types | The chrome.types API contains type declarations for Chrome. |
13 |
usb | Use the chrome.usb API to interact with connected USB devices. This API provides access to USB operations from within the context of an app. Using this API, apps can function as drivers for hardware devices. |
26 |
webstore | Use the chrome.webstore API to initiate app and extension installations "inline" from your site. |
15 |
Dev APIs
These APIs are only available in the Chrome Dev channel:
Name | Description |
---|---|
audio | The chrome.audio API is provided to allow users to get information about and control the audio devices attached to the system. This API is currently only implemented for ChromeOS. |
bluetooth | Use the chrome.bluetooth API to connect to a Bluetooth device. All functions report failures via chrome.runtime.lastError. |
gcm | Use chrome.gcm to enable apps and extensions to send and receive messages through Google Cloud Messaging. |
location | Use the chrome.location API to retrieve the geographic location of the host machine. This API is a version of the HTML Geolocation API that is compatible with event pages. |
wallpaper | Use the chrome.wallpaper API to change the ChromeOS wallpaper. |
Experimental APIs
Chrome also has experimental APIs, some of which will become supported APIs in future releases of Chrome.
API conventions
Unless the doc says otherwise, methods in the chrome.* APIs are asynchronous: they return immediately, without waiting for the operation to finish. If you need to know the outcome of an operation, then you pass a callback function into the method. For more information, watch this video: