Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 chrome 浏览器开发一个扩展。我使用 KangoExtensions 框架。该扩展是用 JavaScript 编写的。我想读取位于本地文件系统上的文件的内容。实现这一点的最简单方法是什么?
如果您已经知道文件系统中的文件路径,您只需要file://*在清单文件中添加权限并对 url 进行 GET XMLHttpRequest file://{filepath}。
file://*
file://{filepath}