Changed Download Mechanism

This commit is contained in:
Andreas Grasser 2022-11-19 21:17:52 +01:00
parent ea901caa8b
commit 04a48d5ba7

View file

@ -172,14 +172,5 @@ function httpRequest(url, callback, callbackVal=null)
function downloadImage() {
var canvas = document.getElementById("canvas");
// Convert the canvas to data
var image = canvas.toDataURL();
// Create a link
var aDownloadLink = document.createElement('a');
// Add the name of the file to the link
aDownloadLink.download = 'mastodon-circle.png';
// Attach the data to the link
aDownloadLink.href = image;
// Get the code to click the download link
aDownloadLink.click();
window.open(canvas.toDataURL('image/png'));
}