mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-26 07:57:56 +03:00
add set remote clipboard to web-rdp #4133
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
b01078bf55
commit
9986567cf0
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* added get clipboard from remote RDP - Simon Smith 2024
|
* added get clipboard from remote RDP - Simon Smith 2024
|
||||||
|
* added set clipboard to remote RDP - Simon Smith 2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
@ -176,6 +177,19 @@
|
|||||||
options: options,
|
options: options,
|
||||||
locale: Mstsc.locale()
|
locale: Mstsc.locale()
|
||||||
}]));
|
}]));
|
||||||
|
self.prevClipboardText = null;
|
||||||
|
self.clipboardReadTimer = setInterval(function(){
|
||||||
|
if(navigator.clipboard.readText != null){
|
||||||
|
navigator.clipboard.readText()
|
||||||
|
.then(function(data){
|
||||||
|
if(data != self.prevClipboard){
|
||||||
|
self.prevClipboard = data;
|
||||||
|
if (self.socket) { self.socket.send(JSON.stringify(['clipboard', data])); }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function(){ });
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
};
|
};
|
||||||
this.socket.onmessage = function (evt) {
|
this.socket.onmessage = function (evt) {
|
||||||
if (typeof evt.data == 'string') {
|
if (typeof evt.data == 'string') {
|
||||||
@ -226,6 +240,8 @@
|
|||||||
this.socket.onclose = function () {
|
this.socket.onclose = function () {
|
||||||
//console.log("WS-CLOSE");
|
//console.log("WS-CLOSE");
|
||||||
self.activeSession = false;
|
self.activeSession = false;
|
||||||
|
clearInterval(self.clipboardReadTimer);
|
||||||
|
self.prevClipboardText = null;
|
||||||
next(null);
|
next(null);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user