# Hentai Reader (Formerly E-Hentai Plus) A high-performance universal reader for image galleries, built for mobile and touch with an extensible multi-site architecture. > **New in v3.4.0:** Hover over E-Hentai / ExHentai gallery thumbnails with Scroll Mode off to preview clear images in Fit or Compact mode. Currently supported (more on the way): - E-Hentai / ExHentai - 18comic (JMComic) - 4KHD [中文](README.zh-CN.md) ## Why Hentai Reader - **Built for performance.** Viewport-aware loading, browser-native off-screen rendering containment, bounded shared caches, and directional prefetching keep long galleries responsive without duplicate downloads. - **Works everywhere.** Full desktop controls (wheel paging, keyboard, click zones) alongside first-class touch support — tap zones, swipe paging, pinch-zoom, and an auto-hiding UI — so it feels native on both. - **One reader, every site.** A single adapter-based core delivers the same reading experience across sites; new sites plug in without touching the reader. - **Resilient by design.** Automatic retry with node switching recovers failed loads, and a load-aware scroll gate keeps you from overshooting onto still-loading pages. ## Features - **Infinite Scroll Mode** — Converts multi-page galleries into a continuous vertical scroll with auto-prefetching, while preserving native page metadata (tags, titles, comments). Toggle on the fly with instant reload. - **Immersive Reader Mode** — A distraction-free, full-screen viewer with keyboard, wheel, tap, and swipe navigation, plus a virtual-scrolling thumbnail panel for quick jumps. - **Dynamic Two-page View** — Enabled by default on wide screens: adjacent portrait pages form a zoomable spread, with selectable left-to-right or manga-style right-to-left page placement. Landscape pages and narrow screens safely remain single-page. - **Gallery Hover Preview** — With Scroll Mode off on E-Hentai / ExHentai, hover over a grid thumbnail for 400 ms to load a clear image. Choose Off, Fit, or Compact in Settings. Moving away, scrolling, or pressing Esc dismisses it while native clicks remain unchanged. Full-image requests use the site's image quota. - **Performance Engine** — Foreground-first image scheduling, staged 5/2 directional prefetch, viewport-aware loading, lease-protected shared tasks, and bounded caches keep current pages fast without duplicate work. - **Desktop & Touch** — Click or tap the left/right regions to turn pages and the center to show or hide controls. Drag/swipe navigation and vertical drag-to-close work on both; zoom with the toolbar button, desktop Z key, or touch pinch. Desktop wheel/keyboard navigation and touch UI auto-hide remain available. - **18comic Decoding Engine** — Canvas-based descrambling runs through the shared priority scheduler, reuses managed image tasks, and releases Bitmap, Canvas, Blob, and Object URL resources predictably. - **Smart Anti-Blocking** — Domain feature-matching and redirect following keep the script working on sites like 4KHD that frequently change domains. - **Robust Loading** — Automatic retry with hath-node switching for failed images, a unified status HUD for load progress, and a load-aware scroll gate that stops paging at unloaded pages. - **Auto Play** — Hands-free slideshow mode with a five-second default, direct 1–60 second input, and five-second adjustment buttons. A loading page gets one bounded five-second grace period and cannot block playback forever. ## Installation 1. Install the [Tampermonkey](https://www.tampermonkey.net/) browser extension 2. Install the userscript from [Sleazy Fork](https://sleazyfork.org/zh-CN/scripts/565718-hentai-reader) or [GitHub release](https://github.com/Leovikii/Hentai-Reader/releases/latest/download/hentai-reader.user.js) ## Build from Source Requires Node.js 22.18 or newer. ```bash npm install npm run dev # Development (hot reload) npm run build # Production npm test # Regression tests npm run check # Typecheck, tests, and production build ``` Output: `dist/hentai-reader.user.js` ## License GNU General Public License v3.0 only (`GPL-3.0-only`). See [LICENSE](LICENSE).