This isn't necessarily a coding problem, but users here would be the perfect people to ask.
Is there an easy way to view and edit a simple text file (.txt seems the most obvious) on a browser (I use Chrome). I'd like this file to be stored locally as well, preferably in my dropbox folder so it's backed-up at all times.
I tried looking for a chrome extension that does this, but after 3 failed attempts I thought there might be a manual way to do this.
I don't care about the format as long as it's common and can be opened on other computers if need be.
Paste the following into your browser address field to get a ready browser notepad:
data:text/html, <html contenteditable>
You can type or paste your text here, edit and then save as page or copy somewhere. Suggested by Jose in his blog.
HTML5 has a File API: http://www.html5rocks.com/tutorials/file/filesystem/
Once you read that you will realize that you can use a blob builder to write to a file, then post that file back to your browser which will automatically download it.
var bb = new BlobBuilder();
bb.append(message.value);
var blob = bb.getBlob();
location.href = window.webkitURL.createObjectURL(blob);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With