diff --git a/src/logic/browserCompatibility.ts b/src/logic/browserCompatibility.ts index dd1966d..fa1c55a 100644 --- a/src/logic/browserCompatibility.ts +++ b/src/logic/browserCompatibility.ts @@ -11,22 +11,7 @@ export async function checkBrowserCompatibility(): Promise { // Check if the browser supports WebAssembly console.debug("Checking WebAssembly"); - try { - if ( - typeof WebAssembly === "object" && - typeof WebAssembly.instantiate === "function" - ) { - const module = new WebAssembly.Module( - Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00) - ); - if (module instanceof WebAssembly.Module) { - // continue - } else { - throw new Error("WebAssembly is not supported."); - } - } - } catch (e) { - console.error(e); + if (typeof WebAssembly !== 'object' || !WebAssembly.validate(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00))) { throw new Error("WebAssembly is not supported."); }