Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In webbrowser load WASM from same folder as JS #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bertdemiranda
Copy link

This pull request addresses issue #131 "Question: how to specify the wasm path in the generated js file?".

In the current version it is assumed (when running inside a webbrowser)
that the WASM module is located in the default path,
which is not always the case (in my case I have a webserver serving
a number of different WASM modules in different paths).

This modification to src/wasm_runtime_standalone.js will do for
the webbrowser case the same as it already does for the NodeJS case:
to get the URL for the javascript file that is then itself running,
and then load the WASM module from the same directory.

The logic for getting the URL for the Javascript file I have
taken from this thread: https://stackoverflow.com/questions/3097644/can-code-in-a-javascript-file-know-its-own-domain-url .
Maybe there is now a better way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant