1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-06-27 16:25:54 +00:00

fix: safari is now ignored in setFakeFile

This commit is contained in:
Marc Robledo 2024-08-25 20:00:49 +02:00
parent 5e248e2565
commit abb4a3ab8a

View file

@ -318,7 +318,8 @@ var RomPatcherWeb = (function () {
return fallback || 0; return fallback || 0;
}, },
setFakeFile: function (id, fileName) { setFakeFile: function (id, fileName) {
if (document.getElementById('rom-patcher-input-file-' + id)) { const isBrowserSafari = /Safari/i.test(navigator.userAgent); /* safari does not show fake file name: https://pqina.nl/blog/set-value-to-file-input/#but-safari */
if (!isBrowserSafari && document.getElementById('rom-patcher-input-file-' + id)) {
try { try {
/* add a fake file to the input file, so it shows the chosen file name */ /* add a fake file to the input file, so it shows the chosen file name */
const fakeFile = new File(new Uint8Array(0), fileName); const fakeFile = new File(new Uint8Array(0), fileName);