From 0d7887e9d2a3b6fd0cc0e808a029ab632d2d2c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 16 Jun 2024 22:55:13 +0200 Subject: [PATCH] workaround for firefox read clipboard, #373. Firefox 122+ incorrectly reports that it can read the clipboard but it can't 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." --- client/src/components/video.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 848d9408..8e396275 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -313,7 +313,15 @@ } get clipboard_read_available() { - return 'clipboard' in navigator && typeof navigator.clipboard.readText === 'function' + return ( + 'clipboard' in navigator && + typeof navigator.clipboard.readText === 'function' && + // Firefox 122+ incorrectly reports that it can read the clipboard but it can't + // 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 + ) } get clipboard_write_available() {