emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.77k stars 3.3k forks source link

-s BINARYEN=1 -s BINARYEN_METHOD='native-wasm,asmjs' downloads .wasm even if wasm is not supported #4910

Closed juj closed 5 years ago

juj commented 7 years ago

Related to #4909, when one builds em++ tests\hello_world.cpp -s BINARYEN=1 -s BINARYEN_METHOD='native-wasm,asmjs' -o a.html, and runs on a browser that does not support Wasm, we get

C:\code\emsdk\emscripten\incoming>python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [02/Feb/2017 01:03:12] "GET /a.html HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2017 01:03:12] "GET /a.wasm HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2017 01:03:12] "GET /a.html.mem HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2017 01:03:18] "GET /a.js HTTP/1.1" 200 -
127.0.0.1 - - [02/Feb/2017 01:03:18] "GET /a.asm.js HTTP/1.1" 200 -

but one doesn't really need to download the .wasm file if lack of support for WebAssembly was detected, but it would be possible to directly just jump to downloading .asm.js.

kripken commented 7 years ago

Yes, I suppose we could check for wasm support in the HTML first, and skip loading the wasm if it's not present.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.