XHR requests to file:/// protocol may return xhr.status: 0 on success in various browsers (at least Chrome on Android and Firefox on Desktop).
In gl-js, the getJSON and getArrayBuffer methods call success when:
xhr.status >= 200 && xhr.status < 300 && xhr.response
to fully support the file:/// protocol, it should be something like:
((xhr.status >= 200 && xhr.status < 300) || (xhr.status === 0 && xhr.responseURL.split('://')[0] === 'file')) && xhr.response
mapbox-gl-js version:
file:/// urlxhr.response, but the handlers will fire an error event due to xhr.status: 0XHR.status: 0 from the file:/// protocol is handled as an error
XHR.status: 0 from the file:/// protocol should be handled as a success
We've previously declined to do this in #2466 and #1623 -- file:// XHR just has too many gotchas. Run a local server instead.