mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-27 14:28:53 +09:00
Fix OffscreenCanvas undefined (MisskeyIO#165)
This commit is contained in:
parent
b94cf016ef
commit
bfa6df78ba
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user