From 94b4dc7a416d0ab04b6842eda06190e7d6fac614 Mon Sep 17 00:00:00 2001 From: jay Date: Thu, 14 May 2026 19:22:46 +0200 Subject: [PATCH] fix: reconnect immediately on tab visibility (iOS) --- extensions/remote-control/html.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/remote-control/html.ts b/extensions/remote-control/html.ts index 7c77d09..7abd0bd 100644 --- a/extensions/remote-control/html.ts +++ b/extensions/remote-control/html.ts @@ -717,6 +717,15 @@ export function buildHTML(nonce: string): string { }); connect(); + + document.addEventListener('visibilitychange', function () { + if (document.visibilityState === 'visible') { + if (!ws || ws.readyState !== 1) { + clearTimeout(timer); + connect(); + } + } + }); })();