Block page audit fallback

This commit is contained in:
softsimon
2022-12-01 19:17:59 +09:00
parent 2b411aad0a
commit 75459729ad
5 changed files with 20 additions and 9 deletions

View File

@@ -85,10 +85,10 @@ export const download = (href, name) => {
document.body.removeChild(a);
};
export function detectWebGL() {
export function detectWebGL(): boolean {
const canvas = document.createElement('canvas');
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
return (gl && gl instanceof WebGLRenderingContext);
return !!(gl && gl instanceof WebGLRenderingContext);
}
/**