Skip to content

Commit

Permalink
Fix launch script to work in Web workers
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
vouillon committed Nov 23, 2023
1 parent 8ed4e18 commit 8d0987d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/wasm/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
return require('fs/promises').readFile(f)
}
function fetchRelative(src) {
const url = new URL (src, document.currentScript?.src || document.baseURI).href
const base = globalThis?.document?.currentScript?.src;
const url = base?new URL(src, base):src;
return fetch(url)
}
const isNode = globalThis?.process?.versions?.node;
Expand Down

0 comments on commit 8d0987d

Please sign in to comment.