From 6f5a1cb14c2c275e5fe329f60fe210ec66f9672a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 30 Sep 2026 14:25:50 +0200 Subject: [PATCH] client: show clipboard fallback button in Safari Safari's clipboard.readText() support is unreliable, so treat it the same way as Firefox and always show the manual clipboard fallback. Fixes #706 --- client/src/components/video.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 687eab3e..75bd17f8 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -333,6 +333,10 @@ } get clipboard_read_available() { + const ua = navigator.userAgent + // Chrome/Chromium-based UAs also contain "Safari", so only match real Safari. + const isSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Chromium') === -1 + return ( 'clipboard' in navigator && typeof navigator.clipboard.readText === 'function' && @@ -340,7 +344,10 @@ // instead it hangs when reading clipboard, until user clicks on the page // and the click itself is not handled by the page at all, also the clipboard // reads always fail with "Clipboard read operation is not allowed." - navigator.userAgent.indexOf('Firefox') == -1 + ua.indexOf('Firefox') == -1 && + // Safari's clipboard read support is unreliable (requires user gesture, often + // throws NotAllowedError), so always show the fallback button there too. + !isSafari ) }