Closed cedricbieder closed 1 year ago
The JSDoc of the block you pasted mentions how to use it now, which is also pretty much exactly what the linked ManagedClient
does.
They merely removed the convenience method setClipboard
, but the underlying implementation was kept. You'll just have to write some more boilerplate yourself now in order to re-implement setClipboard
, e.g.
function setClipboardText(client, text) {
// Create stream with proper mimetype
var stream = client.createClipboardStream('text/plain');
const writer = new Guacamole.StringWriter(stream);
writer.sendText(text);
writer.sendEnd();
}
Hi, how can I send data to the clipboard. In older versions, there was the
this.client.setClipboard(text)
function for this.In the newer version I cannot find something similar. How can I send there data to my connection clipboard? The function is precated since 0.9.1 and was removed here https://github.com/padarom/guacamole-common-js/commit/57d81544ea46fc4f7e68836d146ca60022c430fa. But I dont know what to use now.
Found this implementation in the guacamole git:
https://github.com/apache/guacamole-client/blob/7c502fdd0e28cd7c9d16bfab5c0edf01c8e47122/guacamole/src/main/frontend/src/app/client/types/ManagedClient.js#L737 Overall the similar stuff, but I can not find this in the npm package.