An library for accessing the Chrome APIs in a packaged app or extension.

Build Status


Add this to your package's pubspec.yaml file:

  chrome_gen: any

Using the library

import 'package:chrome_gen/chrome_app.dart' as chrome_gen;

void main() {
  chrome_gen.runtime.getPlatformInfo().then((Map m) {


Documentation is available at:

Re-generating the library

From the project directory, run:

dart tool/gen_apis.dart

This will:

  • read meta/apis.json and meta/overrides.json
  • parse the cooresponding idl/*.json and idl/*.idl files
  • generate lib/chrome_app.dart, lib/chrome_ext.dart, and lib/gen/*.dart.



Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future.

The 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.


Use the chrome.bluetooth API to connect to a Bluetooth device.


Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page.


Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a <a href = '#popups'>popup</a>.


Use the chrome.browsingData API to remove browsing data from a user's local profile.


Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.


Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plug-ins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally.


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.


Use the chrome.cookies API to query and modify cookies, and to be notified when they change.


The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks.


Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content.


Use the chrome.declarativeWebRequest API to intercept, block, or modify requests in-flight. It is significantly faster than the <a href='webRequest.html'>chrome.webRequest API</a> because you can register rules that are evaluated in the browser rather than the JavaScript engine with reduces roundtrip latencies and allows higher efficiency.


Desktop Capture API that can be used to capture content of screen, individual windows or tabs.


Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads.

Use the API to notify you when something interesting happens.


The chrome.extension 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 Message Passing.


Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website.


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.


Use the chrome.fontSettings API to manage Chrome's font settings.


Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages.


Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension.


Use the chrome.identity API to get OAuth2 access tokens.


Use the chrome.idle API to detect when the machine's idle state changes.


Use the chrome.infobars API to add a horizontal panel just above a tab's contents. See the screenshot below.


todo(vadimt): Consider reusing WebKit/Blink types, if this is possible. Use the chrome.location API to retrieve the geographic location of the host machine. This API is a version of the <a href="">HTML Geolocation API</a> that is compatible with event pages.

The API 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.


Use the chrome.mediaGalleries API to access media files (images, video, audio) from the user's local disks (with the user's consent).


Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray.


The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.


Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.


Use the chrome.pageCapture API to save a tab as MHTML.


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.


Use the chrome.power API to override the system's power management features.


Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration.


Use the chrome.processes API to interact with the browser's processes.


Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration.


Use chrome.pushMessaging to enable apps and extensions to receive message data sent through <a href="cloudMessaging.html">Google Cloud Messaging</a>.


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.


Use the chrome.scriptBadge API to control the behaviour of the script badge.


Use the chrome.serial API to read from and write to a device connected to a serial port.


Use the chrome.sessions API to query and restore tabs and windows from a browsing session.


Use the chrome.socket API to send and receive data over the network using TCP and UDP connections.

Use the API to store, retrieve, and track changes to user data.


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 <a href="app_storage.html">Manage Data</a> for more on using this API.


Use the chrome.tabCapture API to interact with tab media streams.


Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.


Use the chrome.topSites API to access the top sites that are displayed on the new tab page.


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.


Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status.


The chrome.types API contains type declarations for Chrome.


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.


Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight.


Use the chrome.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight.

Use the API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.


A library to expose the Chrome app APIs.


A library to expose the Chrome ext APIs.