Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix offscreencanvas undefined #11017

Merged
merged 5 commits into from
Jun 26, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions packages/frontend/src/workers/test-webgl2.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const canvas = new OffscreenCanvas(1, 1);
const gl = canvas.getContext('webgl2');
yuriha-chan marked this conversation as resolved.
Show resolved Hide resolved
if (gl) {
postMessage({ result: true });
} else {
try {
// throw ReferenceError in Safari <= 16.3
const canvas = new OffscreenCanvas(1, 1);
saschanaz marked this conversation as resolved.
Show resolved Hide resolved
const gl = canvas.getContext('webgl2');
if (gl) {
postMessage({ result: true });
} else {
postMessage({ result: false });
}
} catch (err) {
// assert(e instanceof ReferenceError)
postMessage({ result: false });
}