KASM-6045 fix firefox paste bug (#110)

* KASM-6045 fix firefox paste bug

* KASM-6045 change logic to have seamless disabled by default for direct KasmVNC connections on Safari and Firefox (#111)

* KASM-6045 fixes for inside kasm workspaces

---------

Co-authored-by: Matt McClaskey <matt@kasmweb.com>
Co-authored-by: Ryan Kuba <ryankuba@gmail.com>
This commit is contained in:
Matt McClaskey 2024-07-15 05:19:36 -04:00 committed by GitHub
parent 5ba4695e65
commit 9cae5e5c92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 7 deletions

View File

@ -274,16 +274,29 @@ const UI = {
UI.initSetting('enable_hidpi', false); UI.initSetting('enable_hidpi', false);
UI.toggleKeyboardControls(); UI.toggleKeyboardControls();
if (WebUtil.isInsideKasmVDI()) { if ((WebUtil.isInsideKasmVDI()) && (! WebUtil.getConfigVar('show_control_bar'))) {
UI.initSetting('clipboard_up', false); UI.initSetting('clipboard_up', false);
UI.initSetting('clipboard_down', false); UI.initSetting('clipboard_down', false);
// Get the value sent in via URL parameter, default to off
UI.initSetting('clipboard_seamless', false); UI.initSetting('clipboard_seamless', false);
// Kasm workspaces sets to true if it is allowed, but that does not mean it is supported
let clip_s = UI.getSetting('clipboard_seamless');
// Its enabled in Kasm Workspaces, but is it supported by the client
if (clip_s) {
if (isFirefox() || isSafari()) {
UI.forceSetting('clipboard_seamless', false);
}
}
UI.initSetting('enable_webp', false); UI.initSetting('enable_webp', false);
UI.initSetting('resize', 'off'); UI.initSetting('resize', 'off');
} else { } else {
UI.initSetting('clipboard_up', true); UI.initSetting('clipboard_up', true);
UI.initSetting('clipboard_down', true); UI.initSetting('clipboard_down', true);
if (isFirefox() || isSafari()) {
UI.initSetting('clipboard_seamless', false);
} else {
UI.initSetting('clipboard_seamless', true); UI.initSetting('clipboard_seamless', true);
}
UI.initSetting('enable_webp', true); UI.initSetting('enable_webp', true);
UI.initSetting('resize', 'remote'); UI.initSetting('resize', 'remote');
} }
@ -1148,14 +1161,22 @@ const UI = {
// disable the labels that belong to disabled input elements. // disable the labels that belong to disabled input elements.
disableSetting(name) { disableSetting(name) {
const ctrl = document.getElementById('noVNC_setting_' + name); const ctrl = document.getElementById('noVNC_setting_' + name);
if (ctrl) {
ctrl.disabled = true; ctrl.disabled = true;
if (ctrl.label) {
ctrl.label.classList.add('noVNC_disabled'); ctrl.label.classList.add('noVNC_disabled');
}
}
}, },
enableSetting(name) { enableSetting(name) {
const ctrl = document.getElementById('noVNC_setting_' + name); const ctrl = document.getElementById('noVNC_setting_' + name);
if (ctrl) {
ctrl.disabled = false; ctrl.disabled = false;
if (ctrl.label) {
ctrl.label.classList.remove('noVNC_disabled'); ctrl.label.classList.remove('noVNC_disabled');
}
}
}, },
/* ------^------- /* ------^-------

View File

@ -164,7 +164,7 @@ export function isFirefox() {
export function supportsBinaryClipboard() { export function supportsBinaryClipboard() {
//Safari does support the clipbaord API but has a lot of security restrictions //Safari does support the clipbaord API but has a lot of security restrictions
if (isSafari()) { return false; } if (isSafari() || isFirefox()) { return false; }
return (navigator.clipboard && typeof navigator.clipboard.read === "function"); return (navigator.clipboard && typeof navigator.clipboard.read === "function");
} }