This is a command line tool to help build, run, and test web extensions.
Ultimately, it aims to support web extensions in a standard, portable, cross-platform way. Initially, it will provide a streamlined experience for developing Firefox web extensions.
Here are the commands you can run. Click on each one for detailed documentation or use
--help on the command line, such as
web-ext build --help.
web-extdocumentation in a browser
You can install this command onto your machine globally with:
npm install --global web-ext
Alternatively you can install this command as one of the
of your project. This method can help you control the version of
as used by your team.
npm install --save-dev web-ext
Next you can use the
web-ext command in your project as an
Here is an example where the
--source-dir argument specifies where to find
the source code for your extension.
You can always pass in additional commands to your npm scripts using
-- suffix. For example, the previous script could specify the Firefox
version on the command line with this:
npm run start:firefox -- --firefox=nightly
Optionally, you may like:
If you had already installed
web-ext from npm,
you may need to uninstall it first:
npm uninstall --global web-ext
Change into the source and install all dependencies:
git clone https://github.com/mozilla/web-ext.git cd web-ext npm install
Build the command:
npm run build
Link it to your node installation:
You can now run it from any directory:
To get updates, just pull changes and rebuild the executable. You don't need to relink it.
cd /path/to/web-ext git pull npm run build
Yes! The web-ext tool enables you to build and ship web extensions for Firefox. This platform stabilized in Firefox 48 which was released in April of 2016.
Hi! This tool is under active development. To get involved you can watch the repo, file issues, create pull requests, or ask a question on dev-addons. Read the contributing section for how to develop new features.
This is a great question and one that we will ask ourselves for each new web-ext feature. Most web extension functionality is baked into the browsers themselves but a complimentary command line tool will still be helpful. Here is a partial list of examples:
Mozilla built cfx then deprecated it for jpm and now we're proposing a new tool. I know this is frustrating for developers but web extensions mark a major turning point. It would be an arduous task to wedge its feature set and simplified development process into jpm.
Pros of creating a new tool:
Cons of creating a new tool: