Repository navigation
v2.0.4
Fixed
- Persistent cache destruction. Spotify occasionally injects temporary "dummy" text (e.g.,
♪or blank lines) before the real lyrics arrive over the network. The extension's strictJSON.stringifycoherence checks were failing against this dummy text, leading to the destructive wipe of previously saved romanizations and translations frombrowser.storage.local. Replaced the strict coherence algorithm with a simple line-count equivalence check; if the lengths match, the extension forcefully restores the persistent disk cache, ignoring Spotify's temporary UI state. - Delayed cache hydration (Flash of Original Lyrics). When skipping songs quickly, the async
browser.storage.local.getAPI was yielding control to the DOM renderer before resolving, allowing Spotify to paint a flashing frame of the native lyrics text. Re-architected themain()initialization to perform a synchronous bulk-load of all cache entries directly into theruntimeCachemap immediately on script boot, and paired it with aggressive pre-loading insideonSongChange. This guarantees zero-latency, synchronous cache retrieval precisely beforerequestAnimationFramefires. - Orphaned
handleNativeLyricscache miss. Native script restoration loops fromfetchInterceptorwere failing to pull the translated cache from disk becausehandleNativeLyricswas overwriting the active snapshot before a disk check occurred. Inserted an explicitloadSongCache()await immediately after updatingcache.originalduring intersection.
Testing & Verification
- Rigorous JSDOM Integration Overhaul. Excised the simplistic
happy-domabstraction from the testing pipeline entirely in favor of a fulljsdomDOM implementation.index.test.tswas rewritten to structurally simulate Spotify's physical DOM shapes, explicitly forcing deterministicMutationObserverrace conditions to mathematically verify the cache coherency optimizations. - Network Interception Mocks.
fetchInterceptor.test.tswas isolated and reinforced with a dual-tiered mock HTTP stack that authenticates simulated Musixmatch payload intercepts, guaranteeing cross-origin API extraction paths remain uncompromised.
Full Changelog: v2.0.3...v2.0.4