This commit is contained in:
Richard Davey 2021-05-24 17:58:30 +01:00
parent 2d4326f836
commit c7418bd1c3

View file

@ -310,12 +310,12 @@ var File = new Class({
*/
onLoad: function (xhr, event)
{
// On iOS, Capacitor often runs on a capacitor:// protocol, meaning local files are served from capacitor:// rather than file://
// See: https://github.com/photonstorm/phaser/issues/5685
// See: https://github.com/photonstorm/phaser/issues/5685
var isLocalFile = xhr.responseURL && (xhr.responseURL.indexOf('file://') === 0 || xhr.responseURL.indexOf('capacitor://') === 0);
var localFileOk = ( isLocalFile && event.target.status === 0);
var localFileOk = (isLocalFile && event.target.status === 0);
var success = !(event.target && event.target.status !== 200) || localFileOk;