I want to build a browser plugin which will save the user selected block of text in a text file on the users local system(or allow the user to download the text file). Is this possible? Can javascript write to files on the clients local system?
If yes, are there any open source plugins that do this?
I developed an open source extension for this purpose recently, you can download it from:
https://addons.mozilla.org/en-US/firefox/addon/save-text-to-file/
Save Text to File
Saves highlighted text to a file in a directory (defaulting to the user’s home directory)
After highlighting some text, right-click and select “Save Text to File”
File names have the format
userPreference--<todaysdate>-<timestamp>.txtFeatures:
can be stored correctly
context is text
Compatibility
Localization:
English (en-US), Chinese (zh-CN), French (fr), German (de), Japanese (ja), Polish (pl) and Spanish (es-ES)