I\'m trying to make it so a user can drag an icon from the web browser to their desktop, and a text file is created. I\'ve got the content part down, but I can\'t figure out how
According to this MDN page (emphasis mine)
A local file is dragged using the
application/x-moz-file
type with a data value that is an nsIFile object. Non-privileged web pages are not able to retrieve or modify data of this type.
So, if you're not writing a browser extension, you can't, and will receive a Security Error
.
What happens when you drag some data to the Desktop is up to your OS (mine converts it to some .textClipping
file format).