You are using the new (html5) download attribute . As far as I know, this is only supported in Chrome and not (yet) in Firefox.
Update 3-2018
This feature is now supported in almost all major browsers (IE support is not supported).
Alternative: Using location.href
Another way to force download is to redirect the user to the image as follows:
// generate the image var img = "" // then call a function maybe onClick or something downloadImage(img); function downloadImage(data) { location.href = "data:application/octet-stream;base64," + data; }
Or short version
location.href = "data:application/octet-stream;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABWSURBVDhPY0xISPh//0UOA7mAiVyNMH2jBjAwkBQGjD9KGBTEJ6OEO0kG2NvbMwCjnXwDsEU5SS5ANuDhjRCGJbPFSQsDdBfIyMhQZgDIQLK9QLWkDABPsQw5I+5qmAAAAABJRU5ErkJggg=="
Alternative: server side
Alternatively, if you are processing an image server, you can force download it by setting the content header.
PHP example
header('Content-Disposition: attachment; filename="image.png"');
source share