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 Apple's iOS.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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();
let loadedWebgl = false;
try {
if (detectWebgl()) {
+ const webglAddon = new WebglAddon.WebglAddon();
term.loadAddon(webglAddon);
loadedWebgl = true;
}