MDN wants to learn about developers like you:

현재 번역은 완벽하지 않습니다. 한국어로 문서 번역에 동참해주세요.

The WebExtension JavaScript APIs can be used inside the add-on's background scripts and in any other documents bundled with the add-on, including  browser action or page action popups, sidebars, options pages, or new tab pages. A few of these APIs can also be accessed by an add-on's content scripts (see the list in the content script guide).

To use the more powerful APIs you need to request permission in your add-on's manifest.json.

You can access the APIs using the browser namespace:

function logTabs(tabs) {

browser.tabs.query({currentWindow: true}, logTabs);

Many of the APIs are asynchronous, returning a Promise:

function logCookie(c) {

function logError(e) {

var setCookie = browser.cookies.set(
  {url: ""}
setCookie.then(logCookie, logError);

Note that this is different from Google Chrome's extension system, which uses the chrome namespace instead of browser, and which uses callbacks instead of promises for asynchronous functions. As a porting aid, the Firefox implementation of WebExtensions supports chrome and callbacks as well as browser and promises. Mozilla has also written a polyfill which enables code that uses browser and promises to work unchanged in Chrome:

Microsoft Edge uses the browser namespace, but doesn't yet support promise-based asynchronous APIs. In Edge, for the time being, asynchronous APIs must use callbacks.

Not all browsers support all the APIs: for the details, see Browser support for JavaScript APIs.


Schedule code to run at a specific time in the future. This is like setTimeout() and setInterval(), except that those functions don't work with background pages that are loaded on demand.

API reference documentation


The WebExtensions bookmarks API lets an add-on interact with and manipulate the browser's bookmarking system. You can use it to bookmark pages, retrieve existing bookmarks, and edit, remove, and organize bookmarks.

API reference documentation


Adds a button to the browser's toolbar.

API reference documentation


Enables WebExtensions to clear data that is accumulated while the user is browsing.

API reference documentation


Listen for the user executing commands that you have registered using the commands manifest.json key.

API reference documentation


Add items to the browser's context menu, to be displayed in the contexts you specify. For example, you can show the item only when the user clicks on an image, or on an editable element, or when part of a page is selected.

API reference documentation


Work with contextual identities: list, create, remove, and update contextual identities.

API reference documentation


Enables WebExtensions to get and set cookies, and be notified when they change.

API reference documentation


The devtools.inspectedWindow API lets a devtools add-on interact with the window that the developer tools are attached to.

API reference documentation

The API lets a devtools add-on get information about network requests associated with the window that the devtools are attached to (the inspected window).

API reference documentation


The devtools.panels API lets a devtools add-on define its user interface inside the devtools window.

API reference documentation


Enables WebExtensions to interact with the browser's download manager. You can use this API module to download files, cancel, pause, resume downloads, and show downloaded files in the file manager.

API reference documentation


Common types used by APIs that dispatch events.

API reference documentation


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.

API reference documentation


Some common types used in other WebExtension APIs.

API reference documentation


Use the history API to interact with the browser history.

API reference documentation


Functions to internationalize your add-on. You can use these APIs to get localized strings from locale files packaged with your add-on, find out the browser's current language, and find out the value of its Accept-Language header.

API reference documentation


Use the identity API to get an OAuth2 authorization code or access token, which an add-on can then use to access user data from a service which supports OAuth2 access (such as a Google or a Facebook account).

API reference documentation


Find out when the user's system is idle, locked, or active.

API reference documentation


Get information about installed add-ons.

API reference documentation


Display notifications to the user, using the underlying operating system's notification mechanism. Because this API uses the operating system's notification mechanism, the details of how notifications appear and behave may differ according to the operating system and the user's settings.

API reference documentation


Enables WebExtensions to implement customised behavior when the user types into the browser's address bar.

API reference documentation


A page action is a clickable icon inside the browser's address bar.

API reference documentation


Access and modify various privacy-related browser settings.

API reference documentation


This module provides information about your add-on and the environment it's running in.

API reference documentation


Use the sessions API to list, and restore, tabs and windows that have been closed while the browser has been running.

API reference documentation


Gets and sets properties of an add-on's sidebar.

API reference documentation


Enables WebExtensions to store and retrieve data, and listen for changes to stored items.

API reference documentation


Interact with the browser's tab system.

API reference documentation


Use the topSites API to get an array containing all the sites listed in the browser's "New Tab" page.

API reference documentation


Add event listeners for the various stages of a navigation. A navigation consists of a frame in the browser transitioning from one URL to another, usually (but not always) in response to a user action like clicking a link or entering a URL in the location bar.

API reference documentation


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

API reference documentation


Interact with browser windows. You can use this API to get information about open windows and to open, modify, and close windows. You can also listen for window open, close, and activate events.

API reference documentation

문서 태그 및 공헌자

 이 페이지의 공헌자: wbamberg
 최종 변경: wbamberg,