mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-11 10:14:24 +01:00
Fix wasm check
This commit is contained in:
committed by
Paul Miller
parent
81d45874fd
commit
d1d9a5832a
@@ -11,22 +11,7 @@ export async function checkBrowserCompatibility(): Promise<boolean> {
|
||||
|
||||
// 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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user