WebExtensions
This page is an introduction to Mozilla's implementation of WebExtensions, a new browser extension API. The goals of this API are:
- Porting add-ons to and from other browsers should be easier.
- Reviewing add-ons for addons.mozilla.org should be easier.
- WebExtensions must be compatible with multiprocess Firefox (Electrolysis).
- Changes to Firefox's internal code should be less likely to break add-ons.
- WebExtensions should be easier to use than the existing Firefox XPCOM/XUL APIs.
- WebExtensions should maintain acceptable security and privacy standards.
Much of the specifics of the new API are similar to the Blink extension API. Google has extensive documentation on the API. So does Opera.
Please note: we are going with the name WebExtensions because it can be used in search engines, not Web Extensions (with a space) which is almost impossible to search.
Status
- Bugs are filed in Bugzilla under Toolkit > WebExtensions, find or create a bug
Useful queries
- Bugs that currently need documentation
- Triaged bugs
- Untriaged webextension bugs
- Design Decision Needed
- All bugs
- Closed in past 17 days
Communication and meetings
- There are developer resources to help you through the migration.
- Currently every week there is a public triage meeting of the bugs we hope to complete.
- Every other week there is a triage of WebExtensions APIs.
- Join the mailing list at dev-addons@mozilla.org.
- Join us on IRC at #webextensions or #addons
Testing out the WebExtensions API
See Your first WebExtension on MDN.
Technical Details
Permission Model
We currently enforce manifest permissions for the supported APIs. We also enforce CSP protections.
Namespacing
At this time, all APIs are accessible through the chrome.* and browser.* namespace. When we begin to add our own APIs, we expect to add them to the browser.* namespace.
Out-of-process Extensions
WebExtensions are compatible with Electrolysis. They run in the main Firefox process (except for content scripts, which run in the same process as web content). We are considering a plan to run extensions in a separate process (or possibly the content process) eventually, see 1190679 for more details.
Technical details about the implementation are published at WebExtensions/Implementing_APIs_out-of-process.
Packaging
Extensions are packaged as standard Zip files, but with .xpi
extensions. In the future, we're planning to move towards whatever the W3C WG recommends.
See https://developer.chrome.com/extensions/manifest for a complete list of manifest directives.
API support status
The list of APIs and their status is now maintained on MDN. We intend to fix any of the exceptions listed there.
Please also see arewewebextensionsyet.com for an up to date list of supported APIs that is taken by parsing schemas defined in mozilla-central. No guarantees are made on this site, the MDN page is definitive in case of disagreement.
Additional APIs
We plan to add our own APIs based on the needs of existing Firefox add-ons. We also want to hear from you! Please fill out this survey to tell us which APIs you need.
Requests for new APIs are filed as a bug with a whiteboard tag of [design decision needed]. We then gather various people to review them, see Advisory Group for more details.
Contributing
Please see the hacking guide for information about contributing code to the WebExtensions project.
Please see https://webextensions-experiments.readthedocs.io/en/latest/ for some information on Experiments which might be useful for contributing.
Here is a list of all add-on contribution opportunities.