tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

create-wasm-module.js (493B)


      1 // There aren't many cloneable types that will cause an error on
      2 // deserialization. WASM modules have the property that it's an error to
      3 // deserialize them cross-site, which works for our purposes.
      4 async function createWasmModule() {
      5  // It doesn't matter what the module is, so we use one from another
      6  // test.
      7  const response =
      8        await fetch("/wasm/serialization/module/resources/incrementer.wasm");
      9  const ab = await response.arrayBuffer();
     10  return WebAssembly.compile(ab);
     11 }