从WebView下载webapp中的Base64图像
我的angular web应用程序下载Base64图像,并使用此方法完美运行从WebView下载webapp中的Base64图像,webview,base64,blob,Webview,Base64,Blob,我的angular web应用程序下载Base64图像,并使用此方法完美运行 downloadBase64Image(image: string) { this.isReadySubject.next(false); const blob = this.getBlobFromBase64Image(image); if (navigator.msSaveBlob) { navigator.msSaveBlob(blob, this.fileName); } el
downloadBase64Image(image: string) {
this.isReadySubject.next(false);
const blob = this.getBlobFromBase64Image(image);
if (navigator.msSaveBlob) {
navigator.msSaveBlob(blob, this.fileName);
} else {
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = this.fileName;
link.setAttribute("visibility", "hidden");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);this.isReadySubject.next(true);
}
}
当我们在WebView中运行webapp时,问题就出现了,例如Instagram WebView。
它被阻止了,下载不起作用。您可以假设我没有访问WebView代码的权限,因此我只能尝试从web应用程序端修复它
有没有办法解决这个问题,而不用将图像上传到服务器并从那里下载?由于法律问题,我们不能这样做
谢谢!
P