I'm trying to export an HTML5 canvas as a PNG file, so that it is stored on the user's computer.
The following snippet saves the image correctly.
document.location.href = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
However using Chrome on Mac OS X, it always is saved as "download". In Safari it is called "Unknown". Firefox gives it a gobbledygook name.
Can I suggest to the browser a name to use, such as "exportedImage.png"?