if (window.location.pathname.startsWith("/page2")) {
console.log("hello from javascript in page2");
} else {
console.log("hello from javascript in page1");
if (typeof WebAssembly.instantiateStreaming !== "undefined") {
WebAssembly.instantiateStreaming(fetch("/wasm.wasm")).then((wasm) => {
console.log(wasm.instance.exports.main()); });
} else {
fetch("/wasm.wasm")
.then((response) => response.arrayBuffer())
.then((bytes) => WebAssembly.instantiate(bytes))
.then((wasm) => {
console.log(wasm.instance.exports.main()); });
}
}