Include Safari in messages about lack of OPFS support

This commit is contained in:
Jaifroid 2023-10-10 07:37:55 +01:00
parent 367bdff07d
commit da686212f0
2 changed files with 2 additions and 2 deletions

View File

@ -1352,7 +1352,7 @@ archiveFilesLegacy.addEventListener('change', function (files) {
}).catch(function (err) {
console.error('Unable to import files to OPFS!', err);
var message = '<p>We could not import the selected files to the OPFS!</p><p>Reason: ' + err.message + '</p>';
if (/iOS/.test(params.appType)) message = '<p>Unfortunately, iOS does not currently support importing files into the OPFS. Please disable the OPFS and use other file selection options.</p><p>Error message: ' + err.message + '</p>';
if (/iOS/.test(params.appType) || /^((?!chrome|android).)*safari/i.test(navigator.userAgent)) message = '<p>Unfortunately, Safari and iOS browsers do not currently support importing files into the OPFS. Please disable the OPFS and use other file selection options.</p><p>Error message: ' + err.message + '</p>';
uiUtil.systemAlert(message, 'OPFS import error');
uiUtil.pollOpsPanel();
});

View File

@ -628,7 +628,7 @@ function requestXhttpData (URL, lang, subj, kiwixDate) {
downloadSize = 0;
percentageComplete = 0;
var message = 'Unable to download the archive ' + archiveName + ' to your device: ' + err;
if (/iOS/.test(params.appType)) message = '<p>Unfortunately, iOS does not currently support downloading files directly into the OPFS. Please select a different download method.</p><p>Error message: ' + err.message + '</p>';
if (/iOS/.test(params.appType) || /^((?!chrome|android).)*safari/i.test(navigator.userAgent)) message = '<p>Unfortunately, Safari and iOS browsers do not currently support downloading files directly into the OPFS. Please select a different download method.</p><p>Error message: ' + err.message + '</p>';
return uiUtil.systemAlert(message, 'Download failed');
});
}