Support File objects (#873)
Some checks failed
Make Latest Folder On EmulatorJS CDN / run (push) Has been cancelled

This commit is contained in:
pastisme 2024-08-11 20:14:57 -05:00 committed by Ethan O'Brien
parent 469b9fcc4e
commit 83768b6804
2 changed files with 13 additions and 5 deletions

View file

@ -696,7 +696,9 @@ class EmulatorJS {
this.startGameError(this.localization('Network Error'));
return;
}
if (this.toData(this.config.gamePatchUrl, true)) {
if (this.config.gamePatchUrl instanceof File) {
this.config.gamePatchUrl = this.config.gamePatchUrl.name;
} else if (this.toData(this.config.gamePatchUrl, true)) {
this.config.gamePatchUrl = "game";
}
gotData(res.data);
@ -746,7 +748,9 @@ class EmulatorJS {
this.startGameError(this.localization('Network Error'));
return;
}
if (this.toData(this.config.gameParentUrl, true)) {
if (this.config.gameParentUrl instanceof File) {
this.config.gameParentUrl = this.config.gameParentUrl.name;
} else if (this.toData(this.config.gameParentUrl, true)) {
this.config.gameParentUrl = "game";
}
gotData(res.data);
@ -800,7 +804,9 @@ class EmulatorJS {
this.startGameError(this.localization('Network Error'));
return;
}
if (this.toData(this.config.biosUrl, true)) {
if (this.config.biosUrl instanceof File) {
this.config.biosUrl = this.config.biosUrl.name;
} else if (this.toData(this.config.biosUrl, true)) {
this.config.biosUrl = "game";
}
gotBios(res.data);
@ -935,7 +941,9 @@ class EmulatorJS {
this.startGameError(this.localization('Network Error'));
return;
}
if (this.toData(this.config.gameUrl, true)) {
if (this.config.gameUrl instanceof File) {
this.config.gameUrl = this.config.gameUrl.name;
} else if (this.toData(this.config.gameUrl, true)) {
this.config.gameUrl = "game";
}
gotGameData(res.data);

View file

@ -130,7 +130,7 @@
}
input.onchange = async () => {
const url = new Blob([input.files[0]])
const url = input.files[0]
const parts = input.files[0].name.split(".")
const core = await (async (ext) => {