misskey/packages/frontend/src/workers/test-webgl2.ts
2024-02-13 02:27:48 +09:00

15 lines
328 B
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
const canvas = typeof OffscreenCanvas !== 'undefined'
? new OffscreenCanvas(1, 1)
: undefined;
const gl = canvas?.getContext('webgl2');
if (gl) {
postMessage({ result: true });
} else {
postMessage({ result: false });
}