Fix offscreencanvas undefined (#11017)
* Suppress ReferenceError on some environments (i.e. older iOS) * fix * fix * lint * adopt suggestion by acid-chicken
This commit is contained in:
parent
d23ad8b511
commit
58a898dfe0
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue