最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Read content of a local file with chrome extension - Stack Overflow

programmeradmin8浏览0评论

I am developing an extension for the chrome browser. I use the KangoExtensions framework. The extension is written in JavaScript. I want to read the content of a file, which is located on the local filesystem. What is the easiest way to implement this?

I am developing an extension for the chrome browser. I use the KangoExtensions framework. The extension is written in JavaScript. I want to read the content of a file, which is located on the local filesystem. What is the easiest way to implement this?

Share Improve this question asked Aug 4, 2016 at 15:02 RonquamRonquam 1452 silver badges13 bronze badges 2
  • local file system is like a d:\ folder or my home directory on linux? Nah, an extension can't see them. You can only have a standard HTML file-upload button or drag'n'drop support. See also Chrome extensions with text files – woxxom Commented Aug 4, 2016 at 15:45
  • 1 Possible duplicate of Chrome extensions with text files – Haibara Ai Commented Aug 5, 2016 at 0:08
Add a ment  | 

1 Answer 1

Reset to default 8

If you already know the file's path in the filesystem you just need to add a permission to file://*in your manifest file and make a GET XMLHttpRequest to the url file://{filepath}.

发布评论

评论列表(0)

  1. 暂无评论