7

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.

Nikhil
  • 79
  • 1
  • 2

4 Answers4

5

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.

Zon
  • 18,610
  • 7
  • 91
  • 99
  • This answer is interesting and better than nothing, but I don't like how it does a file download for every save. – Tony Jul 12 '17 at 15:56
1

This is an old question, but I've wanted this ability for a long time and finally found a solution that works for me. In Chrome, set up a Workspace folder as described here.

I wanted to edit a markdown file, so I created an empty file called editable.md in my workspace folder. With Chrome developer tools open, in the Sources pane, I can double click this file to edit it. Even better, I have the MarkView plugin installed, so I see a nicely rendered version of the markdown in the main view.

Tony
  • 953
  • 1
  • 10
  • 22
1

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);
Mohamed Mansour
  • 39,445
  • 10
  • 116
  • 90
-5

I think there's a reason why web browsers and text editors are called the way they are. Why would you wan't a functionallity like that? There are other tools for that.

Maybe your answer is a server which handles this kind of requests - allows information to be added, and stores it in it's own dropbox folder which is shared with other users.

The main problem is that browser can't that easily access files on your computer if those aren't cookies, tmp files.

Mārtiņš Briedis
  • 17,396
  • 5
  • 54
  • 76
  • Fair enough, my request was so I could have a to-do list that I could access from my browser (one less reader to use) and also that it's backed up across computers. Maybe a compromise is using an out of the box google chrome app. – Nikhil Feb 07 '11 at 11:46
  • HTML5 has a feature called client side storage - [link](http://www.webreference.com/authoring/languages/html/HTML5-Client-Side/), but it's not that supported yet, and still, you have to figure out how to back-up the data. – Mārtiņš Briedis Feb 07 '11 at 11:53
  • Answers are for answering, not judging. You don't have to understand a use case for it to be valid. If you want to suggest an alternate approach you can do that without disparaging the the question. – Tony Jun 29 '23 at 14:53