Parallel, range-based download & upload accelerator for Chrome โ built for a data-science lab moving 100 GBโTB datasets.
Splits files into chunks and fetches them in parallel over HTTP Range requests, then reassembles them into one file โ engineering around Manifest V3's hardest constraints. On the lab's workloads it cut download times ~25% on typical servers, 40โ55% on high-throughput ones.
| Download history + mode badges | Live chunked download |
|---|---|
![]() |
![]() |
| Every download tagged โก Chunked / โฌ Normal / โ Fallback / ๐ Browser | Parallel chunk assembly with a live "working" banner |
| Adjustable parallelism | Uploads |
|---|---|
![]() |
![]() |
| Tune 2โ32 parallel chunks; persisted across sessions | Chunked uploads with preview + history |
ChunkFlow is a powerful Chrome extension that accelerates downloads and uploads by splitting files into chunks and processing them in parallel. When servers support HTTP range requests, ChunkFlow can significantly speed up file transfers by downloading/uploading multiple chunks simultaneously, then seamlessly merging them back together.
ChunkFlow was originally built during an internship at iHub โ the data-science research hub of the International Institute of Information Technology, Hyderabad (IIIT-H), where researchers routinely move 100 GBโTB-scale datasets and download throughput was a real bottleneck. I led a small team (building the majority myself) to ship a portable, non-technical-friendly accelerator the lab could use with no setup or command line. On the lab's workloads it cut download times by roughly 25% on typical servers and 40โ55% on high-throughput ones. This repository is the continued, open-source version of that project.
- Parallel range downloads โ fetches N byte-range chunks at once, validates each (
206+Content-Range+ exact length), reassembles into one file, and falls back seamlessly when a server or file size can't support chunking. - Built around Manifest V3's hardest limits โ an offscreen document does the blob assembly a
service worker can't (
URL.createObjectURLis unavailable there), and a storage-backed FIFO state machine stays correct across service-worker suspension. - Reliable under real networks โ a chunk-retry ladder, a 250 MB in-memory guard against OOM, blob-URL cleanup on every terminal state, and plain-language per-download mode badges.
- Zero-config, non-technical friendly โ works on any download link (or right-click โ Download with ChunkFlow); adjustable 2โ32 parallel chunks, plus pause / resume / restart / delete.
- Tested โ 50 Jest unit tests plus a Playwright end-to-end test that loads the real unpacked extension in Chrome and asserts the download mode.
- Parallel chunked downloads - Automatically detects server support for range requests and downloads files in chunks for faster speeds
- Intelligent fallback - Seamlessly falls back to regular downloads when chunking isn't supported
- Universal link detection - Works with any download link (not just those with
downloadattribute) - Real-time progress tracking - Live progress bars with file size information
- Download controls - Pause, resume, restart, and delete downloads
- Context menu integration - Right-click any link to download with ChunkFlow
- Chunked uploads - Split large files into chunks for parallel upload to compatible servers
- Upload testing - Test server chunked upload capabilities
- File preview - Image preview before uploading
- Upload history - Track previously uploaded files with metadata
- Progress monitoring - Real-time upload progress for each chunk
- Clean, responsive UI - Modern design with smooth animations
- Tabbed interface - Separate Downloads and Uploads sections
- Real-time updates - Dynamic refresh rates based on activity
- Status indicators - Clear visual feedback for all operations
- File size formatting - Human-readable file sizes and timestamps
For the full end-to-end wiring (message flow diagram, storage keys, mode-attribution state machine, MV3 constraints), see docs/ARCHITECTURE.md.
- Download orchestrator:
downloadInChunks()runs the HEAD/range-support checks, applies the size guard, then delegates the actual chunk fetching + merging to the offscreen document and hands the resulting blob URL to Chrome's downloader - Chunk count:
getChunkCount()reads the user's saved value fromchrome.storage.local(clamped 2โ32, default 10) - Mode attribution: tags every download as
chunked/normal/fallback/browservia a storage-backed pending-mode queue that survives service-worker suspension (seeenqueuePendingMode/consumePendingMode) - Blob lifecycle: revokes each offscreen blob URL once its download reaches a terminal state (
OFFSCREEN_REVOKE_URL) to avoid leaking memory across repeated downloads - Upload engine: Handles both normal and chunked uploads with server compatibility detection
- Chrome Downloads API integration: Manages pause/resume/restart/delete operations
- Storage management: Persists upload history to
chrome.storage.local - Event-driven updates: Real-time communication with popup via ports
- Why it exists:
URL.createObjectURLis unavailable inside an MV3 service worker, so chunk assembly runs in an offscreen document instead - Chunk fetching:
buildObjectUrl()issues parallelRangerequests, validates each206/Content-Rangeresponse, merges the buffers into oneUint8Array, and returns ablob:URL - Progress + cancel: streams
OFFSCREEN_CHUNK_PROGRESSheartbeats back to the popup and supportsOFFSCREEN_CANCEL_REQUESTviaAbortController - Trusted sender gate: only accepts messages originating from
background.js
- Smart link detection: Identifies download links by file extension and
downloadattribute - Dynamic handler attachment: Uses MutationObserver to handle dynamically added links
- URL validation: Prevents invalid download attempts
- Context menu support: Enables right-click download functionality
- Dual-tab layout: Downloads management and Upload testing
- Live progress tracking: Real-time download progress with adaptive update frequency
- File management: Upload file selection, preview, and history
- Error handling: User-friendly error messages and validation
- Responsive design: Modern, mobile-friendly interface
- File size formatting: Human-readable byte conversion
- URL validation: Robust URL checking
- Filename sanitization: Safe filename handling
- File type detection: Smart file extension and MIME type handling
- Utility functions: Debouncing, timestamps, and helper methods
- HEAD request to check
Accept-Ranges: bytes(falls back to a live range probe if the header is ambiguous) - Size guard: files larger than 250 MB skip in-memory chunking and use the native downloader (peak assembly memory is ~3ร file size)
- Parallel fetching of byte ranges in the offscreen document (user-configured count, default 10, with automatic retry at fewer chunks on failure)
- Chunk validation per segment (expects
206+ matchingContent-Range+ exact byte length) - Memory-efficient merging into a single
Uint8Array, then blob creation and automatic download trigger - Blob revocation once the download completes or is interrupted
- Server compatibility check via HEAD request
- File chunking with configurable chunk count
- Parallel upload using
XMLHttpRequestwithContent-Rangeheaders - Progress tracking per chunk with aggregated reporting
- Fallback to normal upload if chunking unsupported
- Adaptive polling: Faster updates during active downloads (500ms), slower when idle (2s)
- Event-driven updates: Chrome Downloads API events trigger immediate UI refreshes
- Memory management: Efficient chunk assembly with proper cleanup
- Error resilience: Robust fallback mechanisms for network issues
downloads: Manage Chrome downloadsstorage: Persist upload history, chunk-count setting, and download-mode metadatacontextMenus: Right-click "Download with ChunkFlow" optionoffscreen: Create the offscreen document that assembles chunks into a blob- Host permissions
http://*/*,https://*/*: Detect download links and fetch chunks on any site - Sender validation: background โ offscreen messages are gated on the trusted sender URL
Full trust-surface analysis, accepted risks, and open hardening options: docs/SECURITY.md.
- Download the extension files
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
extension/folder - The ChunkFlow icon will appear in your browser toolbar
- Method 1: Click any download link - ChunkFlow automatically intercepts and accelerates it
- Method 2: Right-click any link โ "Download with ChunkFlow"
- Monitor progress: Click the ChunkFlow icon to see real-time download progress
- Manage downloads: Use pause/resume/restart/delete controls in the popup
- Click the ChunkFlow icon โ Switch to "Uploads" tab
- Enter a server URL that accepts file uploads
- Select a file using "Select File" button
- Click "Upload File" to start chunked upload
- View upload history and progress
- Server must return
Accept-Ranges: bytesheader - Must support HTTP Range requests (
Range: bytes=start-end) - Must return proper
Content-Lengthheader
- Server must accept
Content-Rangeheaders - Must support partial content uploads
- Should handle multiple concurrent POST requests
- ~25โ55% faster on supported servers (server-dependent โ ~25% on typical servers, 40โ55% on high-throughput ones; larger transfers benefit most)
- Better reliability on unstable connections (chunk-level retry)
- Resume capability for interrupted downloads
- Memory efficient chunk processing
- Parallel upload streams for faster large file transfers
- Progress granularity with per-chunk reporting
- Automatic fallback for unsupported servers
- Error isolation per chunk
- Default chunks: 10 parallel streams (configurable via the popup UI, 2โ32, persisted in
chrome.storage.local) - Update frequency: 500ms active, 2s idle
- File detection: Automatic by extension
- Memory usage: Optimized for large files
npm test- unit tests for shared utilitiesnpm run test:e2e- Playwright smoke test that loads the unpacked extension and verifies:20MBURL is taggedchunked1GBURL is taggednormal(250 MB in-memory guard)
- Chunk merging: Uses
Uint8Arrayfor efficient memory handling - URL validation: Prevents malformed download attempts
- Dynamic link handling: Automatically detects new download links on pages
- Cross-platform: Works on all Chrome-supported operating systems
- Extension API: Full Chrome Downloads API integration
- Server dependency: Chunking requires server-side range request support
- Memory usage: Large files are assembled in memory during merge
- File messaging: Upload files converted to ArrayBuffer for background processing
- Update polling: Some UI updates still use polling vs pure event-driven
- Filename parsing: Parses
Content-Disposition(RFC 5987 + quoted) with a URL-path fallback
- Stream processing: Reduce memory usage for very large files
- Smart chunk sizing: Dynamic chunk count based on file size and connection speed
- Upload progress UI: Real-time chunk-level upload progress visualization
Configuration panel: User-configurable chunk settingsโ Done in v2.3.0- Download queue: Batch download management with priority controls
- Bandwidth throttling: Optional speed limiting for chunked transfers



