How sathyaseelan2006/titletruth works
TitleTruth is a browser extension that scores YouTube videos for clickbait and displays an explanation badge in the feed. The main workflow extracts video metadata, batches visible videos, requests Gemini analysis through the background worker, caches results, and renders badges and tooltips. The README documents support for multiple YouTube layouts, model failover, and RAM plus IndexedDB caching. The popup manages the API key, enablement, testing, and cache clearing. Some implementation details are unsampled; arrows rely on the excerpts or README where indicated.
Main entry points: background.ts Background Worker · popup.ts Settings Popup · gemini.ts Gemini Analysis · storage.ts Cache Operations
Components 13
YouTube Feed
- Video Extraction
src/content/content.ts - Viewport Batching
src/content/content.ts - Badge and Tooltip
src/content/content.ts
Analysis
- Background Worker
src/background/background.ts - Gemini Analysis
src/utils/gemini.ts
Caching
- Cache Operations
src/utils/storage.ts - IndexedDB Cache
- RAM Cache
src/background/background.ts
Extension Controls
- Settings Popup
src/popup/popup.ts - Browser Local Storage
Other components
- YouTube Feed
- Extension User
- Google Gemini API
Connections 15
- YouTube Feed → Video Extraction: provides cards
README.md - Video Extraction → Viewport Batching: queues metadata
README.md - Viewport Batching → Background Worker: sends batch
src/content/content.ts - Background Worker → Gemini Analysis: requests scoring
src/background/background.ts - Gemini Analysis → Google Gemini API: calls API
src/utils/gemini.ts - Gemini Analysis → Background Worker: returns scores
src/background/background.ts - Background Worker → Badge and Tooltip: returns results
README.md - Background Worker → RAM Cache: reads and writes
src/background/background.ts - Background Worker → Cache Operations: reads and writes
src/background/background.ts - Cache Operations → IndexedDB Cache: persists results
src/utils/storage.ts - Extension User → Settings Popup: configures detector
README.md - Settings Popup → Browser Local Storage: reads and saves
src/popup/popup.ts - Browser Local Storage → Background Worker: notifies changes
src/background/background.ts - Settings Popup → Background Worker: tests API key
src/popup/popup.ts - Settings Popup → Cache Operations: clears cache
src/popup/popup.ts