fix annoying firefox paste option with clipboard #6571

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Nov 30, 2024 at 16:14 UTC da5d03b0e7b644d64ac668c0831f578ee1860647
3 files changed +3
public/mstsc/client.js
+1
@@ -180,6 +180,7 @@
180 self.prevClipboardText = null;
181 self.clipboardReadTimer = setInterval(function(){
182 if(navigator.clipboard.readText != null){
183 + if (Mstsc.browser() == 'firefox') return; // this is needed because firefox pops up a PASTE option every second which is annoying
184 navigator.clipboard.readText()
185 .then(function(data){
186 if(data != self.prevClipboard){
views/default.handlebars
+1
@@ -9593,6 +9593,7 @@
9593 QH('DeskLatency', latencyStr);
9594 // Auto-clipboard
9595 if ((((desktop.contype != 4) && (desktopsettings.autoclipboard === true)) || ((desktop.contype == 4) && (desktopsettings.rdpautoclipboard === true))) && (navigator.clipboard != null) && (navigator.clipboard.readText != null)) {
9596 + if (Mstsc.browser() == 'firefox') return; // this is needed because firefox pops up a PASTE option every second which is annoying
9597 try {
9598 navigator.clipboard.readText().then(function(text) {
9599 if (desktop == null) return;
views/default3.handlebars
+1
@@ -10631,6 +10631,7 @@
10631 QH('DeskLatency', latencyStr);
10632 // Auto-clipboard
10633 if ((((desktop.contype != 4) && (desktopsettings.autoclipboard === true)) || ((desktop.contype == 4) && (desktopsettings.rdpautoclipboard === true))) && (navigator.clipboard != null) && (navigator.clipboard.readText != null)) {
10634 + if (Mstsc.browser() == 'firefox') return; // this is needed because firefox pops up a PASTE option every second which is annoying
10635 try {
10636 navigator.clipboard.readText().then(function (text) {
10637 if (desktop == null) return;