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 {
|
try {
|
||||||
context.drawImage(loader, 0, 0, loader.width, loader.height);
|
context.drawImage(loader, 0, 0, loader.width, loader.height);
|
||||||
canvas.toBlob(blob => {
|
canvas.toBlob(blob => {
|
||||||
window.pngBlob = blob;
|
try {
|
||||||
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
window.pngBlob = blob;
|
||||||
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
|
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
||||||
|
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
|
||||||
|
}
|
||||||
|
catch(e) {}
|
||||||
}, 'image/png');
|
}, 'image/png');
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch(e) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user