$ show mengxi-ream/read-frog
Read Frog is a browser extension for AI-assisted language learning. It provides in-page translation, video subtitle translation, text-to-speech, and a selection toolbar with custom AI actions. The extension supports over 30 language model and translation providers, configurable via a unified provider interface, with features like automatic page translation, hover translation, and AI-powered note suggestions. The architecture is built on the WXT framework (MV3) for cross-browser compatibility, with a background service worker orchestrating translation queues, caching, and state management. The frontend uses React 19, Jotai for state, TanStack Query for data fetching, and a custom Base UI component library. The codebase is highly modular with extensive test coverage, a versioned configuration migration system (100+ schema versions), and sophisticated DOM manipulation for in-place translation.
The LLM identified 4 files worth highlighting for reuse:
A comprehensive, versioned migration system for evolving the extension's configuration schema across 100+ versions. Each migration script is a frozen snapshot with explicit idempotency, auto-discovered via import.meta.glob. This pattern is reusable for any application requiring backward-compatible config upgrades with minimal manual intervention.
A registry that abstracts over 30 different AI and translation providers (OpenAI, DeepL, Google, etc.) behind a uniform interface. It handles model resolution, feature-to-provider mapping, authentication, and plan gating. This pattern is reusable for any multi-provider integration system requiring extensibility and runtime configuration.
A utility for creating React-managed Shadow DOM hosts in content scripts. It manages CSS injection via adoptedStyleSheets with fallback, style deduplication, and mounting lifecycle. This pattern is reusable for any browser extension that needs to render isolated UI without interfering with the host page's styles.
A binary heap-based priority queue implementation used for rate-limited, cancellable request scheduling. Supports priority ordering, batch dequeuing, and integration with abort signals. This is a generic, well-tested data structure that can be extracted and used in any application requiring customizable request prioritization and concurrency control.