This guide covers the complete process for packaging, signing, and distributing the Anchored Firefox extension.
cd extension-firefox
npm install
For testing and development:
npm run build
This creates an unsigned .xpi
file in web-ext-artifacts/
directory.
For distribution (includes linting):
npm run build:prod
Validate the extension before submission:
npm run validate
Firefox requires all extensions to be signed before they can be installed by users (except in Developer Edition with specific settings).
Recommended for public distribution
# Windows (CMD)
set WEB_EXT_API_KEY=your_api_key_here
set WEB_EXT_API_SECRET=your_api_secret_here
# Windows (PowerShell)
$env:WEB_EXT_API_KEY="your_api_key_here"
$env:WEB_EXT_API_SECRET="your_api_secret_here"
npm run sign
For beta testing or self-distribution
Set up API credentials (same as above)
npm run sign:unlisted
.xpi
file is generated immediatelyFirefox Developer Edition or Nightly:
about:config
xpinstall.signatures.required
to false
about:debugging#/runtime/this-firefox
.xpi
file from web-ext-artifacts/
Any Firefox version:
.xpi
file.xpi
file into FirefoxRun the extension in a temporary Firefox profile:
npm run dev
Run with debugging tools:
npm run test
{
"version": "1.17"
}
{
"version": "1.17.0"
}
npm run build:prod
npm run sign
Firefox automatically checks for updates if:
update_url
in manifest (unlisted)For unlisted extensions, add to manifest.json:
{
"browser_specific_settings": {
"gecko": {
"id": "anchored@anchored.site",
"update_url": "https://your-domain.com/updates.json"
}
}
}
npm run lint
- fix all errorsReuse from Chrome Web Store with these adjustments:
Take contextual notes tied to websites. Highlight text and save notes linked to pages you visit. Local-first with optional cloud sync.
Go to Firefox Add-ons Developer Hub: https://addons.mozilla.org/developers/
.xpi
fileError: Missing manifest.json
# Ensure you're in the extension-firefox directory
cd extension-firefox
npm run build
Error: Invalid manifest
# Validate manifest
npm run lint
Error: API credentials not found
# Set environment variables
set WEB_EXT_API_KEY=your_key
set WEB_EXT_API_SECRET=your_secret
Error: Signing timeout
# Increase timeout in web-ext-config.js
# Default is 900000ms (15 minutes)
Error: Extension could not be installed
Error: Extension ID conflict
Never commit API credentials to version control:
.env
to .gitignore
name: Build and Sign Firefox Extension
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
cd extension-firefox
npm install
- name: Build extension
run: |
cd extension-firefox
npm run build:prod
- name: Sign extension
env:
WEB_EXT_API_KEY: $
WEB_EXT_API_SECRET: $
run: |
cd extension-firefox
npm run sign
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: firefox-extension
path: extension-firefox/web-ext-artifacts/*.xpi
For issues with packaging or distribution: