- Notifications
You must be signed in to change notification settings - Fork2.7k
Example Firefox add-ons created using the WebExtensions API
License
mdn/webextensions-examples
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
https://github.com/mdn/webextensions-examples
Maintained by Mozilla'sAdd-ons team.
WebExtensions are a way to write browser extensions: that is, programsinstalled inside a web browser that modify the behavior of the browser orweb pages loaded by the browser. WebExtensions are built on a set ofcross-browser APIs, so WebExtensions written for Google Chrome, Opera, orEdge will, in most cases, run in Firefox too.
The "webextensions-examples" repository is a collection of simple,complete, and installable WebExtensions. The examples show how to use theWebExtensions APIs, and you can use them as a starting point for yourWebExtensions.
For an index of all the examples, see the"Example extensions" page on MDN.
The examples are made available under theMozilla Public License 2.0.
To use the repository, first clone it.
Each example is in a top-level folder and includes a short README explainingwhat it does. To see how an example works, install it in Firefox by followingtheinstallation instructions.
To find your way around a WebExtension's internal structure, have a look at theAnatomy of a WebExtensionpage on MDN.
To use these examples in Firefox, use the most recent release of Firefox.However, most examples work with earlier releases.
A few examples rely on APIs that are only available in pre-release versionsof Firefox. Where this is the case, the example declares the minimum versionthat it needs in thestrict_min_version
attribute of thebrowser_specific_settings key
in the extension's manifest.json file.
Some examples work only on specific domains or pages. Details of anyrestrictions are provided in each example's README file. None of theexamples work in private browsing windows by default, seeExtensions in Private Browsingfor details.
To run an example extension:
- Open Firefox and load the
about:debugging
page. ClickLoad Temporary Add-onand select themanifest.json
file within the folder of an example extension. - Install theweb-exttool. At the command line, open the example extension's folder and type
web-ext run
. This launches Firefox and installs the extension automatically.This tool provides some additional development features, such asautomatic reloading.
These examples are tested in Firefox. They may work in other browsers, if thebrowser supports the APIs used.Note that these examples all use thebrowser
namespace and promises towork with asynchronous functions. This means the examples won't work inChrome unless you use thepolyfill provided by Mozilla.Seethe overview of WebExtension APIsfor more information.
To learn more about developing WebExtensions, see theWebExtensions documentation on MDNfor getting started guides, tutorials, and full API reference docs.
If you encounter an issue:
- post a query on theadd-ons discourse forum
- email thedev-addons mailing list
- contact the add-ons team in theAdd-ons room onMatrix
If you cannot resolve the issue,file a bug.
We welcome contributions, whether they are new examples, new features, bugfixes, or translations of localizable strings. Please see theCONTRIBUTING.mdfile for more details.
About
Example Firefox add-ons created using the WebExtensions API
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.