diff --git a/README.md b/README.md index 4b0428c8..048b85b0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This app uses Web RTC to stream a desktop inside of a docker container. This is ## Differences to original repository. ### New Features -- Clipboard button with text area - for browsers, that don't support clipboard syncing or for HTTP. +- Clipboard button with text area - for browsers, that don't support clipboard syncing (FireFox, what a shame...) or for HTTP. - Keyboard modifier state synchronization (Num Lock, Caps Lock, Scroll Lock) for each hosting. - Added chromium ungoogled (with h265 support) an kept up to date by @whalehub. - Added Picture in Picture button (only for watching screen, controlling not possible). diff --git a/client/src/components/video.vue b/client/src/components/video.vue index a4706616..aed46ce7 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -37,7 +37,7 @@ - + @@ -272,8 +272,12 @@ return this.$accessor.settings.scroll_invert } - get clipboard_available() { - return 'clipboard' in navigator + get clipboard_read_available() { + return 'clipboard' in navigator && typeof navigator.clipboard.readText === 'function' + } + + get clipboard_write_available() { + return 'clipboard' in navigator && typeof navigator.clipboard.writeText === 'function' } get clipboard() { @@ -349,7 +353,7 @@ @Watch('clipboard') onClipboardChanged(clipboard: string) { - if (this.clipboard_available && typeof navigator.clipboard.writeText === 'function') { + if (this.clipboard_write_available) { navigator.clipboard.writeText(clipboard).catch(console.error) } } @@ -479,7 +483,7 @@ return } - if (this.hosting && this.clipboard_available && typeof navigator.clipboard.readText === 'function') { + if (this.hosting && this.clipboard_read_available) { navigator.clipboard .readText() .then((text) => {