Price Wise is a Firefox extension that tracks price changes to help you find the best time to buy.
- A recent version of Node.js and NPM
Clone the repository:
git clone https://github.com/mozilla/price-wise.git cd price-wise
Build the extension:
npm run build
Run the built extension in a test browser:
- Unsigned WebExtension Experiments can only be run in Nightly and DevEdition with boolean
- To test an unsigned WebExtension Experiment in Firefox Beta or Release, an unbranded build must be used.
||Launch Firefox with the extension temporarily installed|
||Run linting checks|
||Compile source files with Webpack using a development configuration|
||Compile source files with Webpack using a production configuration|
||Watch for changes and rebuild with Webpack using a development configuration|
||Watch for changes and rebuild with Webpack using a production configuration|
||Package the extension into an XPI file|
||Run test suite (See "Running Tests" for setup)|
Reducers, action creators, etc. are organized into ducks inside the
To set up your environment for running the tests, you must have:
- A Firefox binary. On MacOS, this can be found within the
- Python 2.7
With these installed, you can set up the test suite:
Install Python dependencies:
Save the path to your Firefox binary with
npm config set price-wise:firefox_bin <PATH_TO_FIREFOX_BINARY>
After this, you can run
pipenv run test to run the automated test suite.
The following preferences can be set to customize the extension's behavior for testing purposes. Some convenient testing values can be found in web-ext-config.js, and will be used by default with
string) List of domains (
*) that extraction is performed on. Can be set to
*to enable extraction on all sites.
integer) Time to wait between price checks for a product in milliseconds.
integer) Time to wait between checking if we should fetch new prices in milliseconds.
integer) Delay before removing iframes created during price checks in milliseconds.
integer) The percentage drop in price on which to trigger a price alert compared to the last high price (See
integer) The absolute drop in price on which to trigger a price alert compared to the last high price (see `price_last_high` in [METRICS.md](./docs/METRICS.md)) in currency subunits (e.g. cents for USD).
Releasing a New Version
Price Wise bumps the major version number for every release, similar to Firefox. Releases are created by tagging a commit that bumps the version number and pushing that tag to the repo. This triggers CircleCI automation that packages, tests, signs and uploads the new version to the Test Pilot S3 bucket.
It is strongly recommended that developers creating releases configure Git to sign their commits and tags.
To create a new release of Price Wise:
Increment the version number in
package.json, create a new commit on the
masterbranch with this change, and create a new git tag pointing to the commit with a name of the form
1.0.0is the new version number.
npmships with a command that can perform these steps for you automatically:
npm version major
Push the updated
masterbranch and the new tag to the remote for the Mozilla Price Wise repository (named
originin the example below):
git push origin master git push origin v1.0.0
You can follow along with the build and upload progress for the new release on the CircleCI dashboard. Once the build finishes, a signed copy of the new version will be available in the dashboard under Artifacts. The following upload job, however, is gated on a hold job.
This hold job is intended to provide developers and QA an opportunity for final testing and review of the extension in release channels before uploading. When QA is satisfied, a developer with push access must manually trigger the upload to Test Pilot via the CircleCI dashboard by clicking the hold job and approving the build.
Once the upload is complete, the new version should be available immediately at https://email@example.com/latest.
The Commerce WebExtension is licensed under the MPL v2.0. See
LICENSE for details.