From abb4a3ab8a07f6bd04d2cc5c87b1f40927c1f7f7 Mon Sep 17 00:00:00 2001 From: Marc Robledo Date: Sun, 25 Aug 2024 20:00:49 +0200 Subject: [PATCH] fix: safari is now ignored in setFakeFile --- rom-patcher-js/RomPatcher.webapp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rom-patcher-js/RomPatcher.webapp.js b/rom-patcher-js/RomPatcher.webapp.js index 9dd2fbd..8284915 100644 --- a/rom-patcher-js/RomPatcher.webapp.js +++ b/rom-patcher-js/RomPatcher.webapp.js @@ -318,7 +318,8 @@ var RomPatcherWeb = (function () { return fallback || 0; }, 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 { /* add a fake file to the input file, so it shows the chosen file name */ const fakeFile = new File(new Uint8Array(0), fileName);