From c04bd486e1bb8205092d569104cce1d6a709b8a7 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Tue, 30 Sep 2025 20:57:49 +0000 Subject: [PATCH] fix(wasm): support loading webassembly again Signed-off-by: Xe Iaso --- web/js/algorithms/wasm/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/js/algorithms/wasm/index.ts b/web/js/algorithms/wasm/index.ts index c071d82e..c1f2bcef 100644 --- a/web/js/algorithms/wasm/index.ts +++ b/web/js/algorithms/wasm/index.ts @@ -51,6 +51,13 @@ export default function process( wasmFeatures = "simd128"; } + let module = undefined; + + if (isWASMSupported) { + module = await fetch(u(`${basePrefix}/.within.website/x/cmd/anubis/static/wasm/${wasmFeatures}/${algorithm}.wasm?cacheBuster=${version}`)) + .then(x => WebAssembly.compileStreaming(x)); + } + const webWorkerURL = `${basePrefix}/.within.website/x/cmd/anubis/static/js/worker/${worker}.mjs?cacheBuster=${version}`; const workers: Worker[] = []; @@ -103,6 +110,7 @@ export default function process( nonce: i, threads, algorithm, + module, }); } });