diff --git a/src/connection.ts b/src/connection.ts index 81389cc84..f59fdc7ba 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -268,7 +268,12 @@ export default class Connection { if (!c) continue; cb.content = c; } - globals.pushEvent("clipboard", cb); + try { + await navigator.clipboard.writeText(new TextDecoder().decode(cb.content)); + } catch (e) { + console.error(e); + } + // globals.pushEvent("clipboard", cb); } else if (msg?.cursor_data) { const cd = msg?.cursor_data; const c = await decompress(cd.colors);