开发者

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

开发者 https://www.devze.com 2023-02-08 19:14 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

Improve this question

This isn't necessarily a coding problem, but users here would be the perfect people to ask.

Is there an ea开发者_如何学编程sy 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);


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号