From b9292abefea6837d385370fd3468766e1fc3282e Mon Sep 17 00:00:00 2001 From: Paul Zeinlinger Date: Thu, 8 Jul 2021 23:05:39 +0200 Subject: [PATCH] fix: remove iOS saveFile workaround #20 --- app/fileReceiver.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/fileReceiver.js b/app/fileReceiver.js index 7c2e368b..85065429 100644 --- a/app/fileReceiver.js +++ b/app/fileReceiver.js @@ -224,24 +224,6 @@ async function saveFile(file) { if (navigator.msSaveBlob) { navigator.msSaveBlob(blob, file.name); return resolve(); - } else if (/iPhone|fxios/i.test(navigator.userAgent)) { - // This method is much slower but createObjectURL - // is buggy on iOS - const reader = new FileReader(); - reader.addEventListener('loadend', function() { - if (reader.error) { - return reject(reader.error); - } - if (reader.result) { - const a = document.createElement('a'); - a.href = reader.result; - a.download = file.name; - document.body.appendChild(a); - a.click(); - } - resolve(); - }); - reader.readAsDataURL(blob); } else { const downloadUrl = URL.createObjectURL(blob); const a = document.createElement('a');