chrome_gen.dart

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

Build Status

Installing

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

dependencies:
  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) {
    print(m.toString());
  });
}

Documentation

Documentation is available at: * Chrome Apps API * Chrome Extensions API

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.

Libraries

chrome.alarms
chrome.app_runtime
chrome.app_window
chrome.audio
chrome.bluetooth
chrome.bookmarks

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.

chrome.browserAction

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

chrome.browsingData

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

chrome.commands

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.

chrome.contentSettings

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.

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

chrome.cookies

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

chrome.debugger

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.

chrome.declarativeContent

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

chrome.declarativeWebRequest

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.

chrome.desktopCapture
chrome.devtools_inspectedWindow

Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page.

chrome.devtools_network

Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.

chrome.devtools_panels

Use the chrome.devtools.panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars.

chrome.downloads
chrome.events

Use the chrome.events API to notify you when something interesting happens.

chrome.extension

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.

chrome.fileBrowserHandler

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.

chrome.fileSystem
chrome.fontSettings

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

chrome.history

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.

chrome.i18n

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

chrome.identity
chrome.idle

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

chrome.infobars

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

chrome.input_ime

Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.

chrome.location
chrome.management

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

chrome.mediaGalleries
chrome.notifications
chrome.omnibox

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

chrome.pageAction

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.

chrome.pageCapture

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

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

chrome.power
chrome.privacy

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.

chrome.processes

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

chrome.proxy

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.

chrome.pushMessaging
chrome.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.

chrome.scriptBadge

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

chrome.serial
chrome.sessions

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

chrome.socket
chrome.storage

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

chrome.syncFileSystem
chrome.system_cpu
chrome.system_display
chrome.system_memory
chrome.system_storage
chrome.tabCapture
chrome.tabs

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.

chrome.topSites

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

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

chrome.ttsEngine

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

chrome.types

The chrome.types API contains type declarations for Chrome.

chrome.usb
chrome.webNavigation

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

chrome.webRequest

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

chrome.webstore

Use the chrome.webstore API to initiate app and extension installations "inline" from your site.

chrome.windows

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

chrome_app

A library to expose the Chrome app APIs.

chrome_ext

A library to expose the Chrome ext APIs.