I found out that you can view wasm modules in developer mode in chrome, and I also found a chromium flag here, however I want to use a different browser to dump the wasm file. How do I do that?
3 Answers
As you suggested by mentioning the Chromium flag it is possible to view the text representation of the binary wasm file in chrome, it is also possible in Firefox. Here is an article on the process which explains the need to generate source maps for this to work. Note the mechanism to generate source maps will vary from compiler to compiler.
http://webassemblycode.com/using-browsers-debug-webassembly/
If by "dump wasm" you are asking how to download the text representation from the browser to the filesystem I think the easiest way to do that would be to download the wasm file, as suggested by the poster above and then to convert it from binary to text using a command line tool like binaryen. I am assuming a linux OS here but the steps will be similar for Windows.
Download and compile binaryen.
https://github.com/WebAssembly/binaryen
you can find the wasm-dis utility in:
binaryen/build/bin
Execute
./wasm-dis file.wasm > file.wat
which will pipe the disassembled .wasm into the file.wat which can be viewed in any text editor or by executing:
cat file.wat

- 71
- 1
- 3
I realized after writing the answer below that I'm not answering your question. Seems that chrome flag takes asm.js and allows you to download the resulting wasm (if I understand correctly). Not sure how to do that in other browsers, but these days most wasm is just a file, and you would download it like any other file. Previous answer below if it happens to be helpful.
The .wasm
file should just be downloaded as a file in the browser. You can use the developer tools in safari and firefox (and chrome for that matter) to see what requests a page has made and download the necessary file.
In Safari and Firefox you can view the Web Inspector, click the Network tab and download files from there.

- 3,412
- 1
- 19
- 27
-
Although I know how to view the wasm in the Network tab, I need the file downloaded so I can analyse it with a script. Thanks for the reply though. – John v B Mar 14 '19 at 10:21
-
1You should be able to click on those files and download them directly? – maxm Mar 14 '19 at 18:40
give The WebAssembly Binary Toolkit a try, which developed by emscripten team.
it offers wat2wasm
, wasm2wat
, wasm-objdump
... you can use these tool convert webassembly from binary to text or reverse and look into binary internals like using objdump.

- 431
- 6
- 20