Skip to content

Commit

Permalink
workaround for firefox read clipboard, #373.
Browse files Browse the repository at this point in the history
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."
  • Loading branch information
m1k1o committed Jun 16, 2024
1 parent 978fd89 commit 0d7887e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/components/video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 0d7887e

Please sign in to comment.