diff --git a/packages/frontend/src/workers/test-webgl2.ts b/packages/frontend/src/workers/test-webgl2.ts
index b3501cfe50..1f3f640e6b 100644
--- a/packages/frontend/src/workers/test-webgl2.ts
+++ b/packages/frontend/src/workers/test-webgl2.ts
@@ -3,8 +3,10 @@
  * SPDX-License-Identifier: AGPL-3.0-only
  */
 
-const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1);
-const gl = canvas.getContext('webgl2');
+const canvas = typeof OffscreenCanvas !== 'undefined'
+	? new OffscreenCanvas(1, 1)
+	: undefined;
+const gl = canvas?.getContext('webgl2');
 if (gl) {
 	postMessage({ result: true });
 } else {