Fix OffscreenCanvas undefined (MisskeyIO#165)
This commit is contained in:
		| @@ -3,8 +3,10 @@ | |||||||
|  * SPDX-License-Identifier: AGPL-3.0-only |  * SPDX-License-Identifier: AGPL-3.0-only | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1); | const canvas = typeof OffscreenCanvas !== 'undefined' | ||||||
| const gl = canvas.getContext('webgl2'); | 	? new OffscreenCanvas(1, 1) | ||||||
|  | 	: undefined; | ||||||
|  | const gl = canvas?.getContext('webgl2'); | ||||||
| if (gl) { | if (gl) { | ||||||
| 	postMessage({ result: true }); | 	postMessage({ result: true }); | ||||||
| } else { | } else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 まっちゃとーにゅ
					まっちゃとーにゅ