From a3551a2654b91ccda62b2d64b5a31165b4a648b7 Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Tue, 28 Apr 2026 16:13:58 -0500 Subject: [PATCH] Player: only request fullscreen on real user clicks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The remote-control feature dispatches synthetic click events on the player when the dashboard forwards touches. The global click handler called requestFullscreen() on every click, but the browser only honors that API for trusted user gestures — synthetic events rejected with "Permissions check failed" / "API can only be initiated by a user gesture", spamming the console for the duration of any remote session. Gate the fullscreen request on event.isTrusted. Local user clicks still trigger fullscreen; remote-control taps no longer try (and fail). Bumped SW cache to v8. Co-Authored-By: Claude Opus 4.7 (1M context) --- server/player/index.html | 8 +++++++- server/player/sw.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/player/index.html b/server/player/index.html index a56399b..64b00ee 100644 --- a/server/player/index.html +++ b/server/player/index.html @@ -995,7 +995,13 @@ }, 2000); // ==================== Fullscreen ==================== - document.addEventListener('click', () => { + // Only attempt fullscreen on genuine user clicks. Synthetic clicks dispatched + // by the remote-control feature (touch forwarding from the dashboard) are not + // trusted by the browser and requestFullscreen() rejects with a "Permissions + // check failed" / "API can only be initiated by a user gesture" error every + // time, spamming the console. + document.addEventListener('click', (e) => { + if (!e.isTrusted) return; if (!document.fullscreenElement && config.paired) { document.documentElement.requestFullscreen?.() || document.documentElement.webkitRequestFullscreen?.(); diff --git a/server/player/sw.js b/server/player/sw.js index 1ba0022..8f841b7 100644 --- a/server/player/sw.js +++ b/server/player/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'rd-player-v7'; +const CACHE_NAME = 'rd-player-v8'; // Install: skip waiting to activate immediately self.addEventListener('install', (event) => {