Firefox Extension Development Workflow
Prerequisites
- Firefox Developer Edition (Recommended)
- Download from: https://www.mozilla.org/en-US/firefox/developer/
- Provides better debugging tools and extension development features
- web-ext CLI Tool (Already installed)
- Global installation:
npm install --global web-ext
- Version: 8.10.0
Development Commands
Start Development Server
cd extension-firefox
npm run dev
This will:
- Launch Firefox Developer Edition
- Load the extension automatically
- Enable auto-reload on file changes
- Open debugging tools
Build Extension
cd extension-firefox
npm run build
Creates a distributable .zip file in web-ext-artifacts/
Lint Extension
cd extension-firefox
npm run lint
Validates manifest.json and checks for common issues
Test Extension
cd extension-firefox
npm run test
Launches Firefox with debugging page open
Manual Testing Workflow
Loading Extension Manually
- Open Firefox
- Navigate to
about:debugging
- Click “This Firefox”
- Click “Load Temporary Add-on”
- Select
extension-firefox/manifest.json
Debugging Steps
- Console Logging: Check Browser Console (Ctrl+Shift+J)
- Extension Inspector: Use “Inspect” button in about:debugging
- Background Script: Debug in Extension Inspector
- Content Scripts: Debug in regular DevTools on target pages
- Popup: Right-click popup → “Inspect Element”
Firefox-Specific Testing Areas
Core Functionality
Browser API Compatibility
UI/UX Testing
Troubleshooting
Common Issues
- Extension won’t load: Check manifest.json syntax
- API errors: Verify WebExtensions API usage
- Storage issues: Check IndexedDB permissions
- UI rendering: Verify CSS compatibility with Firefox
- Browser Console:
Ctrl+Shift+J
- Extension Inspector: about:debugging → Inspect
- Network Monitor: F12 → Network tab
- Storage Inspector: F12 → Storage tab
Firefox Version Testing
Test across these Firefox versions:
- ESR (Extended Support Release): Minimum supported version
- Stable: Current stable release
- Beta: Upcoming features testing
- Developer Edition: Latest development features
Monitor these metrics:
- Extension startup time
- Popup render time
- Memory usage
- Storage operation speed
- Network request performance