summaryrefslogtreecommitdiff
path: root/packages/frontend/src/workers/test-webgl2.ts
blob: b203ebe666b8ab1718738c6cb5fb11b2e3d5985a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1);
// 環境によってはOffscreenCanvasが存在しないため
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const gl = canvas?.getContext('webgl2');
if (gl) {
	postMessage({ result: true });
} else {
	postMessage({ result: false });
}