You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
|
|
<title>codefirst-dockerunner-ui</title>
|
|
<script src="../js/pako.min.js"></script>
|
|
<script src="../js/wasm.js"></script>
|
|
<script>
|
|
// https://levelup.gitconnected.com/best-practices-for-webassembly-using-golang-1-15-8dfa439827b8
|
|
(async function loadAndRunGoWasm() {
|
|
const go = new Go();
|
|
|
|
// gzip -9 -v -c wasm > wasm.gz
|
|
const buffer = pako.ungzip(await (await fetch("../../wasm/codefirst-dockerunner-ui.wasm.gz")).arrayBuffer());
|
|
|
|
// A fetched response might be decompressed twice on Firefox.
|
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=610679
|
|
if (buffer[0] === 0x1f && buffer[1] === 0x8b) {
|
|
buffer = pako.ungzip(buffer);
|
|
}
|
|
|
|
const result = await WebAssembly.instantiate(buffer, go.importObject);
|
|
go.run(result.instance)
|
|
})()
|
|
</script>
|
|
<style>
|
|
body,pre { margin:0;padding:0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="loader">Loading WASM module...</div>
|
|
</body>
|
|
</html> |