From 7a657de8a18b3427aa5738ce28721d665374b940 Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 00:34:10 +0600 Subject: [PATCH 1/6] Update vnc.html --- vnc.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/vnc.html b/vnc.html index 89ee11e36..e4e5ea2fb 100644 --- a/vnc.html +++ b/vnc.html @@ -338,5 +338,40 @@

no
VNC

+ + + + From 678f0d591a8e03b5583a1b311f90200a1ddcccd8 Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 00:34:33 +0600 Subject: [PATCH 2/6] Update ui.js --- app/ui.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/ui.js b/app/ui.js index 71933af63..cb7c062d9 100644 --- a/app/ui.js +++ b/app/ui.js @@ -163,9 +163,9 @@ const UI = { UI.initSetting('port', 0); UI.initSetting('encrypt', (window.location.protocol === "https:")); UI.initSetting('view_clip', false); - UI.initSetting('resize', 'off'); + UI.initSetting('resize', 'remote'); UI.initSetting('quality', 6); - UI.initSetting('compression', 2); + UI.initSetting('compression', 10); UI.initSetting('shared', true); UI.initSetting('view_only', false); UI.initSetting('show_dot', false); @@ -326,6 +326,8 @@ const UI = { .addEventListener('click', UI.toggleClipboardPanel); document.getElementById("noVNC_clipboard_text") .addEventListener('change', UI.clipboardSend); + document.querySelector("#hidden_clipboard_sender") + .addEventListener('click', UI.LocalclipboardSend); }, // Add a call to save settings when the element changes, @@ -962,6 +964,9 @@ const UI = { clipboardReceive(e) { Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0, 40) + "..."); document.getElementById('noVNC_clipboard_text').value = e.detail.text; + document.querySelector('#hidden_clipboard_reciver').value=e.detail.text; + document.querySelector('#hidden_clipboard_reciver').click(); + // recive clipboard Log.Debug("<< UI.clipboardReceive"); }, @@ -972,6 +977,15 @@ const UI = { Log.Debug("<< UI.clipboardSend"); }, + LocalclipboardSend() { + const text = document.querySelector('#hidden_clipboard_sender').value; + Log.Debug(">> UI.clipboardSend: " + text.substr(0, 40) + "..."); + if(text && UI.rfb.clipboardPasteFrom){ + UI.rfb.clipboardPasteFrom(text); + } + Log.Debug("<< UI.clipboardSend"); + }, + /* ------^------- * /CLIPBOARD * ============== From 3d4b4fdc09e42244bd045e44c88fd1d9842db2bf Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 00:43:46 +0600 Subject: [PATCH 3/6] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 305108588..25cbca785 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,12 @@ services.n6082.listen services.n6082.vnc ``` + +### Note: Clipboard only serves over https . so do following tasks for Clipboard Sync : + +Create a pem file `openssl req -x509 -newkey rsa:2048 -keyout self.pem -out self.pem -days 365 -nodes` +Make sure to add --ssl-only in the end of command `./utils/novnc_proxy --vnc localhost:5901--ssl-only` + ### Integration and Deployment Please see our other documents for how to integrate noVNC in your own software, From 4855362e5a8c7ca3af1cf8e013297f8c85eb3ee8 Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 01:06:48 +0600 Subject: [PATCH 4/6] Update vnc.html --- vnc.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vnc.html b/vnc.html index e4e5ea2fb..4c1ad99bd 100644 --- a/vnc.html +++ b/vnc.html @@ -369,7 +369,11 @@

no
VNC

async function write_clipboard(){ let txt=document.querySelector('#hidden_clipboard_reciver').value; - await navigator.clipboard.writeText(txt); + try { + await navigator.clipboard.writeText(txt); + } catch (error) { + console.log('Failed to read from clipboard:', error); + } } // snyc write to local from remote From 96a028f8e19e6e30d7b448412e02ee41db334a2b Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 01:07:04 +0600 Subject: [PATCH 5/6] Update ui.js --- app/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui.js b/app/ui.js index cb7c062d9..ad2705d46 100644 --- a/app/ui.js +++ b/app/ui.js @@ -980,7 +980,7 @@ const UI = { LocalclipboardSend() { const text = document.querySelector('#hidden_clipboard_sender').value; Log.Debug(">> UI.clipboardSend: " + text.substr(0, 40) + "..."); - if(text && UI.rfb.clipboardPasteFrom){ + if(text && UI.rfb){ UI.rfb.clipboardPasteFrom(text); } Log.Debug("<< UI.clipboardSend"); From ba3eb62f603cb70b011aaaccd6660e2f8302e365 Mon Sep 17 00:00:00 2001 From: Aungkon Malakar ONC Date: Sat, 21 Sep 2024 02:08:24 +0600 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25cbca785..f08ca6378 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,7 @@ services.n6082.vnc ### Note: Clipboard only serves over https . so do following tasks for Clipboard Sync : Create a pem file `openssl req -x509 -newkey rsa:2048 -keyout self.pem -out self.pem -days 365 -nodes` -Make sure to add --ssl-only in the end of command `./utils/novnc_proxy --vnc localhost:5901--ssl-only` +Make sure to add --ssl-only in the end of command `./utils/novnc_proxy --vnc localhost:5901 --ssl-only` ### Integration and Deployment