Before installing, you'll need the following:
For locales, you'll want the following:
To install the project dependencies, you can run:
npm installTo build the project, you can run:
npm run buildThis puts all the necessary files in the dist/ directory, which you can then
temporarily load into Firefox (e.g. about:debugging).
To build an extension .zip, you can run:
npm run packageThis puts the addon bundle in the addons/ directory.
xpinstall.signatures.required preference
on other channels accordingly.
To run the extension in Firefox, you can run:
npm run run -- -f nightlyThis will automatically create a fresh new user profile that will not persist between runs. This means the data will be lost every time.
To run the extension with a profile that persists between runs, you can
create a new profile by browsing to about:profiles.
Once you have a new profile created (no matter the location), you can tell jpm (via npm) to run using that profile and not to copy the profile temporarily so that any changes (e.g. adding new entries) will be saved:
npm run run -- -p PROFILE --keep-profile-changesThe PROFILE value may be a profile name or the path to the profile.
Now, when you run using this profile, any data or settings you make to the browser itself or in Lockwise will be available for future runs.
To specify flags for run to use regularly, use npm config set webext_runflags:
npm config set webext_runflags="-f nightly -p PROFILE --keep-profile-changes"This way if you want to always test locally using an existing profile (with example data) using Firefox Nightly, you can just run (without adding flags):
npm run runTo run the extension with reloading on file change:
npm run watchThis command will run the extension in Firefox. Additionally, it will start watch processes that will do the following on any file change:
- run JS and CSS linting
- rebuild the extension
- reload the extension in the browser
Note that you will need to set webext_runflags to specify flags for running
Firefox, as this command does not accept any options.
There are two forms of autmomated testing present: unit (test individual classes as much in isolation to everything else -- including the browser internals) and integration.
To run the unit tests, you can run:
npm run testor simply
npm testThis runs tests using Firefox, but wholly as "web content" (what most web pages are).
To run the integration tests, you can run:
npm run integrationThis drives Firefox via Selenium, driving an instance of Firefox with this addon installed.
By default, it searches for which Firefox by searching for one of the following channels (in this order):
- Nightly
- Aurora (Selenium's codename for Developer Edition)
- Beta
- Release
You can tell it which Firefox to use by setting the LOCKBOX_FIREFOX_BINARY environment variable -- either as one of the channel names or the full path to the firefox binary:
LOCKBOX_FIREFOX_BINARY=beta npm run integrationBy default, the integration tests are NOT run in headless mode -- each test will result in a Firefox window opening when it starts and closing when it ends. You can run the integration tests in headless mode by setting the LOCKBOX_FIREFOX_HEADLESS environment variable to 1:
LOCKBOX_FIREFOX_HEADLESS=1 npm run integration