- TypeScript 89%
- CSS 10.2%
- HTML 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| public | ||
| scripts | ||
| src | ||
| store/firefox | ||
| .gitignore | ||
| bun.lock | ||
| LICENSE | ||
| manifest.json | ||
| offscreen.html | ||
| package.json | ||
| popup.html | ||
| PRIVACY.md | ||
| README.md | ||
| tsconfig.json | ||
Star Trek download reports
A Chrome and Firefox Manifest V3 extension that lets the Enterprise crew announce download progress. Built with Bun, TypeScript, and React. Includes 133 local MP3 clips across 10 selectable voices, a crew dropdown, volume and audio preview, snooze/cancel snooze, and an off switch that stays off until reenabled.
Install
The ready-to-load extension is in dist/. To rebuild:
bun install
bun run build
- Open
chrome://extensionsin Chrome 120 or newer. - Enable Developer mode.
- Choose Load unpacked, then select this project's dist directory.
- Pin the extension. Click its icon to open the controls; use Test to hear a clip. Snooze, download scope, frequency, crew, and volume are all in the same panel.
After rebuilding, click Reload on the extension's card. YouTube, yt-dlp, and ffmpeg are not required to run the built extension.
Firefox
Run bun run build:firefox, open about:debugging#/runtime/this-firefox, choose Load Temporary Add-on, and select dist/firefox/manifest.json. Requires Firefox 142 or newer on desktop. Temporary installations last until Firefox closes; normal installation requires Mozilla signing.
Mozilla Add-ons package
bun run package:firefox
Creates release/star-trek-download-reports-firefox-1.1.0.zip and a matching -source.zip for Mozilla's reviewers, with SHA-256 checksums. The command runs typechecking, tests, Mozilla validation, and archive verification. See the listing and submission instructions, reviewer notes, and reproducible build instructions. Firefox screenshots are in store/firefox/screenshots/.
Original code uses the MIT license. Bundled Star Trek audio and marks retain their separate ownership; MIT does not grant redistribution rights to those assets.
Chrome Web Store package
bun run package
Runs typechecking and tests, rebuilds the extension, and creates release/star-trek-download-reports-1.1.0.zip plus a SHA-256 checksum. The archive contains manifest.json at its root and only runtime files, icons, bundled clips, privacy policy, and license notices. Every archived file is checked against the build.
Upload the ZIP as a new item in the Chrome Web Store Developer Dashboard. The ZIP is the extension package; store listing text, screenshots, and privacy declarations are completed separately in the dashboard. No upload or publication is performed by the packaging command. For updates, increase version in manifest.json before packaging; the archive filename follows that version.
Announcement behavior
- All downloads plays one report at a time, most advanced first. Furthest along follows the highest percentage among unpaused downloads with known sizes.
- Every X seconds/minutes checks on that cadence. Every X percent triggers when progress crosses a multiple of X. Every change checks observed byte progress approximately once a second. Chrome does not provide byte-progress change events.
- Matching never rounds up. At 4.2%, an available 4% clip can play if 4% hasn't already been spoken for that download. Later 4.x updates won't repeat it. Decimal clips such as 6.7% also work.
- The nearest available value must be less than one percentage point behind current progress. Missing values remain silent: 69% does not fall back to 68%. After a large jump, only the current value is considered; old milestones aren't queued.
- Values are remembered per download for the current browser session, including across worker suspension, settings changes, and snoozing. A value's alternatives are chosen randomly from the selected characters. Each value plays once, even in timer mode; a stalled download stays quiet.
- Completion can announce 100% once, regardless of cadence. A download whose bytes are received but which Chrome is still finalizing is not announced as complete. Paused/interrupted downloads are skipped; unknown-size downloads can still announce completion.
- Snoozing or disabling stops current audio and cancels pending reports immediately. Snooze persists across browser restarts and expires at the requested time (after waking if the device was asleep). Disabling persists until you turn reports back on.
- Default: furthest download, every 10%, all crew, 80% volume. Selecting no crew makes reports silent.
The popup shows current downloads and the most recent report. Both browsers request downloads, storage, and alarms; Chrome also needs offscreen for audio. There are no host permissions, content scripts, analytics, or remote playback. Settings stay in local browser storage. Download names are displayed locally and are not sent anywhere. See PRIVACY.md.
Development and checks
bun run dev # builds, then serves the popup at http://localhost:5173
bun run typecheck
bun test
bun run build
The ordinary browser preview uses localStorage and local audio; download monitoring requires loading the extension. Rerun the build and refresh the preview after edits.
Tests cover percentage catch-up and deduplication, decimal values, random voice filtering, interval/percentage cadence, completion, pauses and unknown sizes, audio cancellation races, and both background adapters. Native Firefox 157 testing verified real audio playback and known-size download reports while the popup was closed, plus completion for known- and unknown-size downloads. Mozilla validation has no errors or notices and two React DOM library warnings, explained in the reviewer notes. A live download in an installed Chrome extension remains the Chrome integration check.
For that check, use a large download: choose Every change, confirm reports don't repeat within a percentage, try both download scopes, and snooze while a report plays. Verify Cancel snooze, the persistent off switch, and completion. Use a download with a known total size for progress reports.
Audio source and editing
Source: All the Percent — A Star Trek: TNG Supercut, by Picard Looking. Star Trek footage and voices belong to Paramount. This is an unofficial fan project. The bundled catalog is a curated subset of the supercut, not every speaker or occurrence; no generated voices are used.
src/catalog.ts contains the voice, percentage, and source timestamps for every cut. MP3s are in public/clips/. To recreate or adjust them, install yt-dlp and ffmpeg, download the source, and run:
yt-dlp --js-runtimes bun --remote-components ejs:github -f "230+234" --merge-output-format mp4 -o ".media/source.%(ext)s" "https://youtu.be/YEaicg1kYMk"
bun scripts/extract-clips.ts .media/source.mp4
bun run build
The HLS formats above worked when direct video formats returned HTTP 403. Format availability can change; inspect yt-dlp -F if needed. .media/ is ignored and is not shipped. Extraction uses mono 96 kbps MP3 and short fades at cut boundaries.
src/background.ts shares download monitoring across browsers. Chrome's service worker uses src/chrome/background.ts and an offscreen audio document; Firefox uses src/firefox/background.ts, an event page with direct audio, and a one-second alarm while downloads are active. Both use a recovery alarm and session storage for deduplication. src/audio-player.ts manages playback; src/engine.ts keeps progress matching independent from browser APIs.