WebExtensions Experiments provide a way for developers to tinker with new APIs for WebExtensions. They work by allowing WebExtensions APIs to be written in an another extension. They can be used to prototype APIs for landing in Firefox, or for use on Nightly or Developer Edition.
If you’d like to land a WebExtensions API straight into Firefox, are familiar with building mozilla-central, working with Bugzilla, the try server, then please file a bug and follow the usual Firefox development process.
|experiment:||A bootstrapped add-on that contains code to expose a WebExtensions API.|
|extension:||A WebExtension add-on that uses the experiment add-on as a dependency.|
The experiment and the extension are both add-ons. The experiment is a legacy style add-on, while the extension is a WebExtension.
Experiments allow you to:
- Test and experiment with an API without having to build Firefox at all.
- Write and distribute the API to a set of users without them having to build Firefox.
- Then commit to (or get help committing to) mozilla-central.
We will not add all experiments to Firefox. The goal is to judge each Experiment on its own merit and value.
Some key points:
- The API is implemented in the experiment add-on.
- The API is available in the browser namespace - not in chrome.
- Breaking changes could occur in the experiment, but are discouraged.
- WebExtension add-ons using the API depend on the experiment add-on.
- WebExtension add-ons using the API declare its use in the manifest permissions.
How do they work?¶
Experiments are a bootstrapped add-on. They have a special type 256 that tells Firefox that they are an experiment. Firefox loads the schema.json into Firefox and then the APIs become available to WebExtensions.