[pve-devel] [PATCH] fix #5063: load webgl addon in try block
Dominik Csapak
d.csapak at proxmox.com
Mon Dec 11 11:19:56 CET 2023
since under certain circumstances (e.g. using safari < 16) the addon
constructor already throws an exception, not only the loading later.
To allow falling back to the canvas renderer, move it into the try block
after webgl detection.
This should fix the xterm.js console on iOS in chrome and other
browsers.
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
xterm.js/src/main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xterm.js/src/main.js b/xterm.js/src/main.js
index 1575697..289032c 100644
--- a/xterm.js/src/main.js
+++ b/xterm.js/src/main.js
@@ -99,7 +99,6 @@ var terminalContainer = document.getElementById('terminal-container');
document.getElementById('status_bar').addEventListener('click', hideMsg);
document.getElementById('connect_btn').addEventListener('click', startGuest);
const fitAddon = new FitAddon.FitAddon();
-const webglAddon = new WebglAddon.WebglAddon();
createTerminal();
@@ -157,6 +156,7 @@ function createTerminal() {
let loadedWebgl = false;
try {
if (detectWebgl()) {
+ const webglAddon = new WebglAddon.WebglAddon();
term.loadAddon(webglAddon);
loadedWebgl = true;
}
--
2.30.2
More information about the pve-devel
mailing list