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 <[email protected]>
---
 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



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to