Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to View, Edit & Locally store a .txt file through Chrome [closed]

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.

like image 333
Nikhil Avatar asked Feb 07 '11 11:02

Nikhil


2 Answers

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.

like image 195
Zon Avatar answered Oct 13 '22 01:10

Zon


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);
like image 22
Mohamed Mansour Avatar answered Oct 13 '22 00:10

Mohamed Mansour