Hello,
Sam actually implemented a function for downloading screenshots of the workspace a while ago :D Here is the
source code for it.
> Only supporting Chrome at this point, and only blocks on the workspace, this is meant for testing and not a feature ready for production.
So it doesn't work on all browsers, and may be buggy :/
The other problem is that this doesn't actually save the blocks, it just downloads a screen shot. If you want to save them you need to use `Blockly.Xml.workspaceToDom(myWorkspace)`. However, it is possible to add the XML returned by that function to the metadata of the PNG, which is what App Inventor does. That way you can actually save and load using a PNG (with a bit of extra effort ofc hehe). I believe their source code is
here.
I hope that gives you some places to start!
--Beka