Tech stack
The extension leverages a powerful combination of technologies for performance, type safety, and maintainability:Core technologies
TypeScript
Strongly-typed language providing compile-time safety across all packages
pnpm workspace
Efficient monorepo management with shared dependencies and parallel builds
Vite
Lightning-fast build tool for development and production bundles
Vitest
Modern testing framework with built-in coverage reporting
Architecture layers
Core (@hls-downloader/core)
Core (@hls-downloader/core)
Business logic layer built with:
- Redux + Redux Toolkit for state management
- RxJS + redux-observable for async operations and side effects
- TypeScript for compile-time type safety
Background (@hls-downloader/background)
Background (@hls-downloader/background)
Extension background script that:
- Initializes the Redux store
- Wires services like
IndexedDBFS,FetchLoader, andM3u8Parser - Integrates ffmpeg.wasm for local video merging
- Handles extension lifecycle events
Popup (@hls-downloader/popup)
Popup (@hls-downloader/popup)
React-based user interface:
- React 18 for component architecture
- React Router for navigation
- react-redux for store connection
- Tailwind CSS for styling
- Storybook for component development
Design System (@hls-downloader/design-system)
Design System (@hls-downloader/design-system)
Shared UI component library:
- Radix UI primitives for accessible components
- Tailwind CSS + tailwindcss-animate for styling
- Lucide React icons
- Reusable components consumed by the popup
Assets
Assets
Static resources:
- Extension manifests (MV2 and MV3)
- Icons in multiple sizes
- FFmpeg WebAssembly files
Prerequisites
Before you begin, ensure you have the following installed:Node.js 20+
Download from nodejs.org. Includes Corepack for managing package managers.
zip command
Required for creating extension archives. Usually pre-installed on macOS and Linux.On Windows, install via Git for Windows or use WSL.
Quick start
Install dependencies
The
--frozen-lockfile flag ensures you install exact dependency versions matching the lock file.Build the extension
dist/directory with extension filesextension-chrome.zipfor Chromium browsersextension-firefox.xpifor Firefox
Manifest versions
HLS Downloader supports both Manifest V2 and V3:Manifest V2 (default): Used for Firefox and legacy Chromium workflows. Supports background pages.Manifest V3: Required for modern Chromium browsers (Chrome, Edge, Brave, Arc). Uses service workers and offscreen documents.
Project structure
The monorepo is organized as a pnpm workspace:The
src/core/lib directory is generated by TypeScript compilation. Never edit it directly - always modify files in src/core/src.Next steps
Architecture
Learn about clean architecture patterns and package boundaries
Building
Explore build commands, variants, and watch mode
Testing
Run tests and generate coverage reports
Contributing
Guidelines for submitting pull requests