emscripten-core/emscripten

Use Fetch in preference of XMLHttpRequest (on supported platforms)

オープン

#6,241 opened on 2018/02/13

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

Repository metrics

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

説明

Background

I wrote up some background on the emscripten-discuss group here.

To summarise, src/shell.js contains some calls to XMLHttpRequest (XHR). The Fetch API is a replacement for XHR, that has quite widespread support (https://caniuse.com/#search=fetch). Service Worker does not support XHR in Chrome or Firefox (I have not tested other browsers).

Affected files

src/shell.js

Proposed solution

Use Fetch in preference to XHR on supported platforms.

Known/potential problems

Fetch does not support the File URI scheme (ticket). Further analysis is required to understand how this would affect emscripten. XHR might be required as a fallback.

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