Re:Fibre:A WebGL application for visualizing 3D vector field...
by robin_reala on Friday January 04, 2019 @08:36AM
(#18823885)
The link.download is the important point: in DOM terms that’s <a download="fibre.png"> which specifies that the resource should be downloaded with a filename of fibre.png.
Oh cool, TIL you can dispatch a fake click event on an invisible anchor element pointing to a png object url to download a file, without even putting the anchor in the document! I presume it all just gets garbage collected with it's done. I would have never have thought to attempt that, but it works like a charm, in just a few lines.
https://github.com/portsmouth/fibre/blob/master/js/fibre.js#...