set clipboard on js

This commit is contained in:
rustdesk 2022-03-26 18:04:42 +08:00
parent abadb37baf
commit 67a210f9a4

View File

@ -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);