summaryrefslogtreecommitdiff
path: root/packages/frontend/src/workers/test-webgl2.ts
diff options
context:
space:
mode:
authorYuriha <121590760+yuriha-chan@users.noreply.github.com>2023-06-26 10:45:14 +0900
committerGitHub <noreply@github.com>2023-06-26 10:45:14 +0900
commit58a898dfe0631e70e9fcac988c5e207e9bd76346 (patch)
tree7a59e7eb1a15532a480dbd4c74508cfded3d016b /packages/frontend/src/workers/test-webgl2.ts
parentfix(backend): APIエラーのHTTP status code変更 (#11047) (diff)
downloadsharkey-58a898dfe0631e70e9fcac988c5e207e9bd76346.tar.gz
sharkey-58a898dfe0631e70e9fcac988c5e207e9bd76346.tar.bz2
sharkey-58a898dfe0631e70e9fcac988c5e207e9bd76346.zip
Fix offscreencanvas undefined (#11017)
* Suppress ReferenceError on some environments (i.e. older iOS) * fix * fix * lint * adopt suggestion by acid-chicken
Diffstat (limited to 'packages/frontend/src/workers/test-webgl2.ts')
-rw-r--r--packages/frontend/src/workers/test-webgl2.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/frontend/src/workers/test-webgl2.ts b/packages/frontend/src/workers/test-webgl2.ts
index 4769524d9c..8f13c57cae 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 {