
Ian M. answered 05/16/19
Professional Web Designer, Developer, UI/UX
Not crazy! I did exactly the same thing when I wanted users to be able to download images created on an HTML canvas:
No doubt you could use the same approach. Create an anchor element (you don't even have to attach it to the DOM), set the name of the downloading file (optional), set the href attribute, then trigger its click() method.
I do a lot of work with canvas, and I use this exact function in many places. It works!
I hope this helps! Let me know if you need more help on this subject.
Ian