From 58a898dfe0631e70e9fcac988c5e207e9bd76346 Mon Sep 17 00:00:00 2001 From: Yuriha <121590760+yuriha-chan@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:45:14 +0900 Subject: [PATCH] Fix offscreencanvas undefined (#11017) * Suppress ReferenceError on some environments (i.e. older iOS) * fix * fix * lint * adopt suggestion by acid-chicken --- packages/frontend/src/workers/test-webgl2.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/workers/test-webgl2.ts b/packages/frontend/src/workers/test-webgl2.ts index 4769524d9..8f13c57ca 100644 --- a/packages/frontend/src/workers/test-webgl2.ts +++ b/packages/frontend/src/workers/test-webgl2.ts @@ -1,5 +1,5 @@ -const canvas = new OffscreenCanvas(1, 1); -const gl = canvas.getContext('webgl2'); +const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1); +const gl = canvas?.getContext('webgl2'); if (gl) { postMessage({ result: true }); } else {