Ignoring errors when building blob URL for PNG
If it fails, then the link won't be displayed
This commit is contained in:
parent
f78e388e20
commit
9cbd923c1f
@ -181,9 +181,12 @@ export default class Regexper {
|
||||
try {
|
||||
context.drawImage(loader, 0, 0, loader.width, loader.height);
|
||||
canvas.toBlob(blob => {
|
||||
window.pngBlob = blob;
|
||||
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
||||
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
|
||||
try {
|
||||
window.pngBlob = blob;
|
||||
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
||||
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
|
||||
}
|
||||
catch(e) {}
|
||||
}, 'image/png');
|
||||
}
|
||||
catch(e) {}
|
||||
|
Loading…
Reference in New Issue
Block a user