diff --git a/packages/frontend/src/workers/test-webgl2.ts b/packages/frontend/src/workers/test-webgl2.ts index 4769524d9c..5027fa0784 100644 --- a/packages/frontend/src/workers/test-webgl2.ts +++ b/packages/frontend/src/workers/test-webgl2.ts @@ -1,7 +1,13 @@ -const canvas = new OffscreenCanvas(1, 1); -const gl = canvas.getContext('webgl2'); -if (gl) { - postMessage({ result: true }); -} else { +try { + // throw ReferenceError in Safari <= 16.3 + const canvas = new OffscreenCanvas(1, 1); + const gl = canvas.getContext('webgl2'); + if (gl) { + postMessage({ result: true }); + } else { + postMessage({ result: false }); + } +} catch (err) { + // assert(e instanceof ReferenceError) postMessage({ result: false }); }