This is the Namada Browser Extension project.
Note: if you wish to set a default chain ID in the extension, set this value in .env. See .env.sample.
# Build wasm dependencies
yarn wasm:build # This needs to be run initially to ensure wasm dependencies are available
# Clean build files
yarn clean
yarn clean:chrome # Clean only chrome build
yarn clean:firefox # Clean only firefox build
# Build production web extension (chrome & Firefox)
yarn build # Clean and build all extensions & wasm dependencies
yarn build:chrome # Clean and build only for chrome (./build/chrome)
yarn build:firefox # Clean and build only firefox (./build/firefox)
# Run in development mode. This enables autoreloading when you install the extension at ./build/chrome
yarn start
yarn start:chrome # Same as yarn start, which defaults to a Chrome target
yarn start:firefox # Run development extension in Firefox - use ./build/firefox
# If you are running `yarn dev:proxy` in the `namada-interface`, you can make use of that proxy by using:
yarn start:chrome:proxy
yarn start:firefox:proxy
# Run tests
yarn test
yarn test:watch
# Run eslint checks
yarn lint
yarn lint:fixOnce you have run yarn build, you can use the files in ./build to install the extension:
- In Chrome, select
Manage Extensions - Click the toggle to enable
Developer Mode - Click
Load Unpackedand point to thebuildfolder in this project
- In Firefox, navigate to
about:debugging#/runtime/this-firefox - Select
Load Temporary Add-On... - Navigate to either the
build/browser/manifest.jsonor thebuild/firefox/namada_extension-0.1.0.zipfile to install
The extension should be installed. Currently, this is enabled for namada.me, so navigating to that page will call the content scripts,
hopefully instantiating an instance of the Namada() class API for handling communication between client and key store.
See the FIREFOX_README.md for specific instructions related to reviewing the Firefox Add-On.
- Currently, Firefox does not support
manifest_version: 3, and Chrome will be removing support forV2in 2023. As such, both manifest versions are supported. - Manifest files can be found in
src/manifest/v2(version 2, required for Firefox), andsrc/manifest/v3(others). There are independent files that extend a_base.jsonfile for the target browser, which will be merged when building. Built extensions will be found underbuild/chromeandbuild/firefox(currently, these are the only two scripted build).