Hacker News new | ask | show | jobs
by vedantroy 2697 days ago
Something I've wondered about with Web Assembly applications is, how do I actually view the web assembly/compiled blob? E.g--with normal Javascript, I can go to "sources" tab in developer tools and download all the JS, but how do I download the wasm?

Am I misunderstanding how web assembly works?

3 comments

If you are using a fairly new version of chrome any wasm should indeed show up under sources, under a special wasm domain. It looks like this https://webassemblycode.com/wp-content/uploads/Chrome-Wasm-D...

It doesn't show the source file because the browser is not actually aware of where the js on the page got the wasm its running from. From the browser's perspective it just fetched an opaque file and then separately got told to run some wasm.

You can see the actual source file for the wasm for one of the demos here, it still shows up in the network tab (but for example if the js on the page generated the wasm then it wouldn't). https://webassembly.z19.web.core.windows.net/mono.wasm

You already cannot get anything usefull out from minified JavaScript.
It's there, if you look at the Network tab in the Dev Tools you will find the mono.wasm binary.