emscripten-core/emscripten

Integrate emrun with noInitialRun / INVOKE_RUN=0

オープン

#11,448 opened on 2020/06/19

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (3,519 件のフォーク)batch import
good first bughelp wanted

Repository metrics

Stars
 (27,361 個のスター)
PR merge metrics
 (平均マージ 19d 10h) (30d で 147 merged PRs)

説明

Some "powerful" Web APIs are only allowed in response to user interaction (e.g. click on a button) somewhere on the call stack.

In these cases, it's useful to avoid running Emscripten automatically, and instead invoke it manually in response to such allowed user interaction.

noInitialRun / INVOKE_RUN=0 allow to build code like this, but they're not very convenient to use with the autogenerated HTML and emrun helper during testing and development, because it will simply open HTML and the only way to run the code is to open DevTools and call callMain manually.

I propose that that, when code is compiled in such mode, HTML would be generated with a simple "Run" button which will invoke callMain on click with command-line arguments from GET params just like in a regular build with auto-run.

コントリビューターガイド