Created
June 8, 2018 08:44
-
-
Save wsd1/c71bd20c870baa97aa837be9afb0b0ae to your computer and use it in GitHub Desktop.
WebAssembly 鉴定页面
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>WASM check</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
const supported = (() => { | |
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) | |
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance; | |
} | |
} catch (e) {} | |
return false; | |
})(); | |
var info = (supported ? "WebAssembly is supported" : "WebAssembly is not supported"); | |
document.write('<h1>' + info + '</h1>'); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment