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 610bac0 commit fb8dcdf
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 @@ -6,7 +6,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 fb8dcdf

Please sign in to comment.