$ account zennomi
TruyenDrive is a userscript that injects a full-featured comic/manga reader UI into Google Drive and OneDrive folder pages. Built with Vite, React 19, and TypeScript, it runs as a Tampermonkey script that mounts a shadow DOM reader overlay on top of the cloud storage page. The system automatically scans folder structures to detect chapters (sub-folders) or flat image lists, supports left-to-right, right-to-left, and top-to-bottom reading directions, spread layouts, zoom, page preloading, and browser history integration. It also implements a custom image encryption/decryption system using XOR and scanline methods, with Web Worker support for performance. The architecture is cleanly separated into provider abstractions (Google Drive, OneDrive), a state machine for folder classification, and a rich settings system with theme presets and persistence. The codebase demonstrates strong engineering practices including TypeScript strict mode, proper error boundaries, and reusable utility modules.