npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cliqz-oss/web-ext

v2.0.1

Published

A command line tool to help build, run, and test web extensions

Downloads

7

Readme

Web-ext

This is a command line tool to help build, run, and test web extensions.

Build Status Coverage Status Dependency Status devDependency Status

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.

Documentation

Installation from npm

Global command

You can install this command onto your machine globally with:

npm install --global web-ext

For your project

Alternatively you can install this command as one of the devDependencies of your project. This method can help you control the version of web-ext as used by your team.

npm install --save-dev web-ext

Next you can use the web-ext command in your project as an npm script. Here is an example where the --source-dir argument specifies where to find the source code for your extension.

package.json

"scripts": {
  "start:firefox": "web-ext run --source-dir ./extension-dist/",
}

You can always pass in additional commands to your npm scripts using the -- suffix. For example, the previous script could specify the Firefox version on the command line with this:

npm run start:firefox -- --firefox=nightly

Installation from source

You'll need:

  • Node.js, 6.0.0 or higher
  • npm, 3.0.0 or higher is recommended

Optionally, you may like:

  • nvm, which helps manage node versions

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:

npm link

You can now run it from any directory:

web-ext --help

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

Should I Use It?

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.

Get Involved

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.

Some Questions and Answers

Why do we need a command line tool?

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:

  • File watching.
    • When you edit a file, you may need to trigger certain commands (tests, installation, etc).
  • Integrating with services.
    • Mozilla offers some useful services such as linting and signing extensions.

Why not patch jpm for web extension support?

First, note that jpm is still actively maintained by Mozilla right now. We decided not to patch jpm for web extension support (See jpm issue 445, discussion).

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:

  • By creating a new tool that focuses on the [emerging] web extension standard, we have a better chance of interoperating with other platforms, such as Google Chrome or Opera. It would be hard to do that while preserving compatibility in jpm.
  • Creating SDK-based add-ons was overly complicated. With web extensions you no longer need to convert your source into legacy artifacts and you won't need boostrapping scripts.
  • There are superior features in Firefox now for developing extensions such as loading from source code instead of a packaged XPI. It will be easier to reimagine a new tool around these work flows rather than adjust jpm's existing work flows.
  • jpm's functional tests are slow, brittle and hard to run. There are flaky time-outs and we've run out of low hanging fruit fixes at this point.
  • Most of jpm's code was not designed to be unit testable which makes it hard to maintain and refactor.
  • jpm's code was written in ES5 which is cumbersome after coming from the ES6 Firefox code base or from most other languages with modern conveniences (Python, Ruby, etc).
  • Some core functionality of jpm can be extracted and re-used in the new tool.

Cons of creating a new tool:

  • Firefox extension developers will have to interrupt and re-arrange their work flows.
  • Developers of existing add-ons will need to port to web extensions sooner rather than later.
  • The web-ext tool will require some ramp-up time for scaffolding.
  • The community of jpm contributors will need to shift focus to web-ext.