The code below is for downloading a file in PDF form. The code is working fine for all platforms and devices except iPad's Safari Browser. What are the changes I can make to make it work?
const fileWindow = window.open();
const linkSource = `data:${mimeType};base64,${response.base64}`;
fileWindow.document.write(
'<title>Visualisation</title>' +
'<body style="overflow: hidden; margin: 0">' +
'<object width="100%" width="-webkit-fill-available" height="100%" height="-webkit-fill-available" type="application/pdf" data="' + encodeURI(linkSource) + '"></object>' +
'</body>'
);
const downloadLink = document.createElement("a");
document.body.appendChild(downloadLink);
downloadLink.href = linkSource;
downloadLink.download = fileName;
downloadLink.click();