Anchored Firefox extension is built with vanilla JavaScript and requires no transpilation or bundling. The extension runs directly in the browser without any code generation or minification of source files.
node --version
npm --version
cd extension-firefox
npm install
This installs web-ext CLI and linting tools only. No other dependencies are built into the extension.
npm run build
This creates an unsigned .zip file in web-ext-artifacts/ directory.
npm run build:prod
This runs linting first, then creates the package.
npm run validate
This validates the manifest and code structure according to Firefox WebExtensions standards.
The build process creates a .zip file containing:
extension-firefox/
├── manifest.json (Extension configuration)
├── background/
│ └── background.js (Service worker)
├── content/
│ ├── content.js (Content script)
│ └── content.css (Content styles)
├── popup/
│ ├── popup.html (Popup UI)
│ ├── popup.js (Popup controller)
│ ├── popup.css (Popup styles)
│ ├── dialog.css (Dialog styles)
│ └── modules/ (Feature modules)
├── lib/
│ ├── storage.js (IndexedDB wrapper)
│ ├── sync.js (Supabase sync)
│ ├── encryption.js (AES-256-GCM encryption)
│ ├── api.js (Supabase client)
│ ├── browser-api.js (Cross-browser API abstraction)
│ ├── dompurify.min.js (XSS sanitization - third-party)
│ └── [other libraries]
└── assets/
└── icons/ (Extension icons)
dompurify.min.js is an open-source third-party library (included as-is)To verify the build is correct:
npm run validate
unzip web-ext-artifacts/anchored-firefox-*.zip -l
cat manifest.json | node -e "console.log(JSON.parse(require('fs').readFileSync(0, 'utf-8')))"
npm run build
.zip to .xpi:
mv web-ext-artifacts/anchored-firefox-*.zip web-ext-artifacts/anchored-firefox-1.55.xpi
Open Firefox and go to about:debugging#/runtime/this-firefox
.xpi filenpm run validate to see issuesnpm install again to ensure dependencies are installedFor issues or questions: