You will need NodeJS and Firefox. Make sure npm
and firefox
are in your PATH
.
It may be a good idea to use yarn
instead of npm
. We provide yarn.lock
if you choose to do so.
To install all dependencies into node_modules
directory, execute:
npm install
One stop command to build, test and deploy add-on to Firefox:
npm start # all-in-one
To do each step manually:
npm run build # build runs bundle:firefox at the end, so manifest will be ok
npm run test # test suite
npm run firefox # spawn new Firefox
It is also possible to load extension manually: enter about:debugging
in the URL bar
then click "Load Temporary Add-on" and point it at add-on/manifest.json
First, build it manually:
npm run build bundle:chromium # last part is important: it overwrites manifest
Then open up chrome://extensions
in Chromium-based browser, enable "Developer mode", click "Load unpacked extension..." and point it at add-on
Chrome "unpacked extension" | Firefox "temporary add on" |
---|---|
See docs/firefox-for-android.md
Each npm
task can be run separately, but for most of time dev-build
, test
and fix:lint
are all you need.
npm install
-- install all NPM dependenciesnpm run build
-- build the add-on (copy external libraries, create.zip
bundles for Chrome and Firefox)npm run bundle:chromium
-- overwrites manifest and packages a generic, Chromium-compatible versionnpm run bundle:brave
-- overwrites manifest and packages a Brave-compatible version requesting access tochrome.sockets
npm run bundle:firefox
-- overwrites manifest and packages a Firefox-compatible versionnpm run build:rename-artifacts
-- renames artifacts to include runtimes in filenamesnpm run ci
-- runs tests and build (with frozen yarn.lock)npm test
-- run entire test suitenpm run lint
-- read-only check for potential syntax problems (run all linters)npm run fix:lint
-- try to fix simple syntax problems (runstandard
with--fix
etc)npm run lint:standard
-- run standard linter (IPFS JavaScript projects default to standard code style)npm run lint:web-ext
-- run addons-linter shipped withweb-ext
toolnpm run firefox
-- run as temporary add-on in Firefoxnpm run chromium
-- run as temporary add-on in Chromiumnpm run get-firefox-nightly
-- fetch latest Firefox Nightly to./firefox/
npm run firefox:beta:add -- --update-link "https://host/path/to/file.xpi" file.xpi
-- add a manifest entry for new self-hosted Beta for Firefox
Release build shortcuts:
npm run dev-build
-- all-in-one: fast dependency install, build with yarn (updates yarn.lock if needed)npm run beta-build
-- reproducible beta build in docker with frozen yarn.locknpm run release-build
-- reproducible release build in docker with frozen yarn.lock
-
You can switch to alternative Firefox version by overriding your
PATH
:export PATH="/path/to/alternative/version/of/firefox/:${PATH}"
-
Localization Notes (running browsers with specific locale etc)