A Python script to download Chrome and Firefox browser extensions by ID, saving them as ZIP files for analysis, backup, or development purposes.
- Multi-Platform Support: Download extensions from Chrome (CRX3 format) or Firefox (XPI format).
- Version Control: Fetch the latest version or specify a particular version.
- Batch Downloads: Process multiple extensions from a file or comma-separated list with custom naming.
- Progress Indicators: Visual progress bars for all downloads (requires tqdm).
- Robust Handling: Retries on failures, error recovery, and validation for IDs and files.
- Flexible Output: Custom output paths, output directories, force overwrites, and verbose logging.
- Smart Naming: Default output uses extension name instead of ID (with fallback to ID).
- Python 3.6 or higher.
- Optional:
tqdmfor progress bars (pip install tqdm).
Download extension.py to your local machine.
Run the script from the command line. Basic syntax:
python extension.py [extension_id] [options]
Download the latest version of a Chrome extension:
python extension.py cjpalhdlnbpafiamejdnhcphjbkeiagm --platform chrome
Download the latest Firefox addon:
python extension.py ublock-origin --platform firefox
-
Specify Version: Download a specific version (Firefox only supports available versions).
python extension.py ublock-origin --platform firefox --version 1.68.0 -
Batch Download: Download multiple extensions from a file (one ID per line) or comma-separated list.
python extension.py --batch ids.txt --platform firefox --continue-on-errorOr:
python extension.py --batch id1,id2,id3 --platform chrome --force -
List Versions: Show available versions for a Firefox addon (Chrome not supported).
python extension.py ublock-origin --platform firefox --list-versions -
Verbose Logging: Enable detailed output.
python extension.py ublock-origin --platform firefox --verbose -
Custom Output: Specify output file path or directory.
python extension.py ublock-origin --platform firefox -o custom.zippython extension.py ublock-origin --platform firefox -d /path/to/downloads -
Batch Custom Naming: Use placeholders for custom filenames in batch mode.
python extension.py --batch ids.txt --batch-name "{name}-backup.zip" --platform chromeAvailable placeholders:
{id}(extension ID),{name}(extension name).
| Option | Description |
|---|---|
extension_id |
Extension ID (Chrome: 32 alphanumeric chars; Firefox: GUID or slug). Optional with --batch or --list-versions. |
-o, --output |
Output ZIP file path (default: {extension_name}.zip). |
-d, --output-dir |
Output directory for downloaded files. |
-v, --version |
Version to download (default: latest). |
--platform |
Platform: chrome or firefox (default: chrome). |
--verbose |
Enable detailed logging. |
-f, --force |
Overwrite existing output files. |
--batch |
Batch download: file path or comma-separated IDs. |
--batch-name |
Custom output name for batch downloads (supports {id}, {name} placeholders). |
--continue-on-error |
Skip errors in batch mode and continue. |
--list-versions |
List available versions for the addon. |
-h, --help |
Show help message. |
-
Download uBlock Origin for Firefox:
python extension.py ublock-origin --platform firefox --verboseOutput: Downloads and saves as
uBlock Origin.zip(extension name). -
Download specific version:
python extension.py ublock-origin --platform firefox --version 1.67.0 -
Batch download with error handling:
python extension.py --batch ublock-origin,invalid-id --platform firefox --continue-on-error --forceProcesses valid IDs, skips invalid ones.
-
List Firefox versions:
python extension.py ublock-origin --platform firefox --list-versionsOutput:
Available versions for ublock-origin: 1.68.0, 1.67.0, ... -
Chrome extension with custom output directory:
python extension.py cjpalhdlnbpafiamejdnhcphjbkeiagm --platform chrome -d /path/to/downloadsOutput: Downloads and saves as
/path/to/downloads/uBlock Origin.zip. -
Batch with custom naming:
python extension.py --batch ids.txt --batch-name "{name}-backup.zip" --platform chromeOutput: Creates files like
uBlock Origin-backup.zip,AdBlock-backup.zip, etc. -
Chrome extension with custom filename:
python extension.py cjpalhdlnbpafiamejdnhcphjbkeiagm --platform chrome -o my-extension.zip --force
- Invalid ID Format: Ensure Chrome IDs are 32 alphanumeric characters, Firefox IDs are GUIDs (e.g.,
{uuid}) or slugs (e.g.,ublock-origin). - File Not Found (Batch): Check the batch file path and ensure it exists with one ID per line.
- API Errors (Firefox): Mozilla API may have rate limits (60 requests/hour). Wait and retry. 404 means invalid ID.
- Download Failures: Check network connection. Retries are automatic.
- No Progress Bar: Install tqdm (
pip install tqdm) for visual progress. - Overwrite Prompts: Use
--forceto overwrite existing files. - Platform Mismatch: Use correct
--platformfor the ID type. - Extension Name Not Found: If the script can't fetch the extension name, it will fall back to using the extension ID as the filename.
- Limitations: Listing versions is only supported for Firefox. Chrome versions must be specified manually.
- Rate Limits: Firefox API has request limits; avoid excessive batch downloads.
- Security: This script downloads from official sources. Use for legitimate purposes only.
- File Formats: Chrome CRX files are stripped to ZIP; Firefox XPI files are saved as-is (already ZIP-compatible).
- Dependencies: All core features work with stdlib; tqdm enhances UX.
- Smart Naming: The script fetches extension names for default filenames. If unavailable, uses the extension ID as fallback.
- Progress Tracking: Progress bars are shown for both Chrome and Firefox downloads when tqdm is installed.