diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index 3806498d..9c5c2da9 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -269,7 +269,18 @@ export class NekoMessages extends EventEmitter { protected [EVENT.CLIPBOARD_UPDATED]({ text }: message.ClipboardData) { this._localLog.debug(`EVENT.CLIPBOARD_UPDATED`) Vue.set(this._state.control, 'clipboard', { text }) - navigator.clipboard.writeText(text) // sync user's clipboard + + try { + navigator.clipboard.writeText(text) // sync user's clipboard + } catch (error: any) { + this._remoteLog.warn(`unable to write text to client's clipboard`, { + error, + // works only for HTTPs + protocol: location.protocol, + clipboard: typeof navigator.clipboard, + }) + } + this.emit('room.clipboard.updated', text) }