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 => {
|
||||||
|
try {
|
||||||
window.pngBlob = blob;
|
window.pngBlob = blob;
|
||||||
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
this.downloadPng.href = URL.createObjectURL(window.pngBlob);
|
||||||
this.links.className = this.links.className.replace(/\bhide-download-png\b/, '');
|
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