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: