nhentai Language Filter

Adds quick language filters (English, Japanese, Chinese) to nhentai pages — works with SvelteKit SPA navigation

Dette er versioner af dette script, hvor koden er blevet opdateret. Vis alle versioner.

  • v1.2.0 31.03.2026

    v1.2.0 — 2026-04-01

    Full SPA compatibility rewrite.

    • [ADD] SPA navigation detection — patches history.pushState / replaceState and popstate
    • [ADD] Permanent MutationObserver for hydration resilience (80 ms debounce, independent timer)
    • [ADD] onNavigate() fires injection at six independent staggered delays — the MutationObserver debounce cannot cancel them
    • [ADD] Language filter buttons on search result pages (/search?q=…) — active language highlighted in red
    • [ADD] Language filter buttons on Favorites page — compact flag buttons next to the random button
    • [ADD] data-nhi-lang marker attribute on every injected element for reliable clean-up on navigation
    • 🐛 [FIX] Filters now persist after clicking a language — the filtered search page gets its own set of filter buttons
    • 🐛 [FIX] Homepage dropdown no longer flashes and disappears — re-injected immediately after SvelteKit hydration wipes it
    • 🐛 [FIX] pathname.startsWith("/search") replaces the old regex that required a trailing slash — correctly matches /search?q=… without trailing slash
    • 🐛 [FIX] All generated filter links use /search?q=… (no trailing slash before ?) to match actual SvelteKit URL format
    • 🔄 [CHANGE] lastKey updated before the injection attempt (not only on success) — retry passes skip cleanup and go straight to injection
    • 🔄 [CHANGE] MutationObserver uses muteTimer (its own independent timer) separate from navigation schedules
    • 🔄 [CHANGE] @match https://nhentai.net/search* replaces search/* to cover URLs without trailing slash
  • v1.1.0 23.01.2026

    v1.1.0 (2026-01-23)

    • Added "All" reset option to all filter locations
    • Fixed favorites language filter - languages are now mutually exclusive
    • Clicking a language on favorites now replaces existing filter instead of appending
  • v1.0.1 21.01.2026