mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
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."
This commit is contained in:
parent
978fd8977d
commit
0d7887e9d2
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user