mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 10:01:00 +01:00
usePlayerFullscreen took an optional target so three library-driven players could call it bare, purely to install the prototype patch, and throw the controller away. That discarded controller was not free: vueuse defaults the target to documentElement and still registers its fullscreenchange listeners on both it and document. Split the side effect into useFullscreenFallback and make the target required. The three call sites now say what they mean without a comment apologising for an unused return value. Refcount the install. The patch is process-global while its callers are scoped, so overlapping consumers would otherwise stack private patch layers and restore them in teardown order. Probing HTMLElement.prototype rather than Element.prototype lets an installed fallback see itself. Drops v2's writes to playing.fullScreen, which no longer had a reader in either tree. The field stays because v1 still destructures it. Also: hoist swallow to module scope, annotate the return inline rather than exporting an unused interface mirroring vueuse's shape, cover the document.fullScreen alias at the layer that defines it, dispose test fallbacks in afterEach so a failed assertion cannot leak a patched document into the next test, and drop test cases that re-covered the util through the composable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Uo885XxwhN8wfC4oCtR48