JavaScript APIs

Currently supported APIs

alarms

Compatibility table

The alarms API call schedules code to run at a specific time in the future. This is similar to setTimeout() and setInterval(), though an alarms call works with background pages that are loaded on-demand.

bookmarks

Compatibility table

To interact with the browser's bookmarking system. This module allows you to bookmark pages through the API, and also retrieve existing bookmarks, edit, remove, and organize them.

browserAction

Compatibility table

Add a clickable button to the browser's toolbar and associate a popup with this button. You can specify the popup by accessing its HTML, CSS and JavaScript, just as you would for a web page. All subsequent JavaScript running in this popup has access to the same WebExtension APIs as any background scripts.

contextMenus

Compatibility table

Add items to the browser's context menu. Any Items displayed are bound by the context parameters which you define. For example, you can show the item only when part of a page is selected, when the user clicks on an image, or an editable element.

cookies

Compatibility table

This API call provides you with the opportunity to get or set browser cookies, and the ability to be notified when they change.

downloads

Compatibility table

Interact with the browser's download manager. You can use this module to download files, cancel, pause, or resume them, and show recently downloaded files within the file manager.

events

Compatibility table

Common types used by APIs that dispatch events.

extension

Compatibility table

Utilities related to your add-on. Get URLs to resources packages with your add-on, get the Window object for your add-on's pages, get the values for various settings. Note that the messaging APIs in this module are deprecated in favor of the equivalent APIs in the runtime module.

extensionTypes

Compatibility table

Some common types used in other WebExtension APIs.

i18n

Compatibility table

Functions to internationalize your add-on. You can use these API modules to call localization strings from any locale files packaged with your add-on, determine the browser's current language state, or determine the value of the browser's Accept-Language header.

idle

Compatibility table

Use this module to listen for events triggered by the user's operating system. For example, you can set predetermined time factors to trigger your application's user activity definition as idle, should the user operating system go into a locked state set your application to trigger another event, or another event triggered if the user returns to an active state.

notifications

Compatibility table

Display notifications to the user, using the local operating system displayed notifications. As this API uses the user's operating system notification mechanism, care should be exercised, as the definition of how notifications will appear and behave may differ, through each subsequent operating system and user defined preferences.

pageAction

Compatibility table

A page action API call is shown as a clickable icon from inside the browser's address bar. You can listen for clicks on the icon, or define a popup that will open when this icon is clicked. Page actions are intended for behaviors relevant to a certain few pages. If your icon and page action is intended to be constantly available to the each web page, you should use a browser action instead.

runtime

Compatibility table

This module provides information about your add-on and the environment it's locally running in. It also provides messaging APIs enabling you to: communicate between different parts of your add-on, communicate with other local add-ons, or communicate with native applications.

storage

Compatibility table

This module enables WebExtensions to store data locally, retrieve data from this store, or listen for changes to these stored items.

tabs

Compatibility table

Interact with the browser's tab system. You can use this API to get a complete list of currently opened browser tabs and to create, modify, or rearrange tabs within the browser.

webNavigation

Compatibility table

Get notifications about the various stages of a navigation event.

webRequest

Compatibility table

Add event listeners for the various stages of making an HTTP request. An event listener receives detailed information about the API request, and can also modify or cancel the request.

windows

Compatibility table

Interact with browser windows. You can use this API to get information about open windows, to open, modify, and close them. You can also take advantage of the listen functionality for windows; if they are opened or closed by the user, activate subsequent events on these activities.

List of Beta APIs

Document Tags and Contributors

 Last updated by: bunnybooboo,