Overview
The extension uses different manifest versions to accommodate browser requirements:- Manifest V2 - Default for Firefox and legacy Chromium workflows
- Manifest V3 - Required for modern Chromium-based browsers (Chrome, Brave, Arc, Edge)
Firefox does not fully support MV3 background service workers yet, so the MV2 build is recommended for Firefox users.
Key differences
Background execution
- Manifest V2
- Manifest V3
Uses persistent background pages that remain active throughout the browser session.Characteristics:
src/assets/manifest.json
- Background page stays alive continuously
- Direct access to DOM and IndexedDB
- Works with Firefox and older Chromium versions
Permissions model
MV3 separates host permissions from regular permissions:Content security policy
MV3 requires a different CSP format:Both versions require
'wasm-unsafe-eval' to support ffmpeg.wasm for video merging.Offscreen documents (MV3 only)
Manifest V3 service workers cannot directly access DOM APIs or create object URLs. HLS Downloader uses offscreen documents to work around this limitation.What are offscreen documents?
Offscreen documents are invisible HTML pages that run alongside the service worker, providing access to DOM APIs like IndexedDB and Blob URLs.Implementation
The extension creates an offscreen document when needed:src/background/src/services/indexedb-fs.ts
Use cases
The offscreen document handles:- Creating object URLs for download blobs
- Managing IndexedDB operations for large file storage
- Generating progress updates during merge operations
How offscreen messaging works
How offscreen messaging works
The background service worker sends messages to the offscreen document:See src/background/src/offscreen.ts:16-34 for the full implementation.
When to use each version
Use Manifest V2 if:
- You’re installing on Firefox
- You need a persistent background page
- You’re using legacy Chromium versions
Use Manifest V3 if:
- You’re installing on Chrome, Brave, Arc, Edge, or Opera
- You want the latest Chrome-compatible build
- You’re preparing for future Chrome Web Store requirements
Building different versions
The build system generates both versions:- MV2 only
- MV3 only
- Both versions
dist/- Build artifactsextension-chrome.zip- Chromium packageextension-firefox.xpi- Firefox package
The build system automatically includes
offscreen.html when building for MV3. See scripts/copy-assets.mjs:46-51 for the copy logic.Browser compatibility
| Browser | Recommended Version | Notes |
|---|---|---|
| Firefox | MV2 | MV3 service workers not fully supported |
| Chrome | MV3 | Required for Web Store |
| Edge | MV3 | Official store uses MV3 |
| Brave | MV3 | Chromium-based |
| Arc | MV3 | Chromium-based |
| Opera | MV3 | Chromium-based |
Related resources
- Build variants - Learn about store vs experimental builds
- Chrome MV3 migration guide
- Firefox MV3 status