Chrome extensions with text files [closed]

南笙酒味 提交于 2019-12-01 12:20:53

问题


I am new to chrome extension and i need to develop a chrome extension which can handle text/json files (should be able to perform read-write operations).Files will be stored at the same machine(path may be D:/abc/xyz.text) where i will install chrome extension.Does any one have any idea?


回答1:


That would sadly be not easy or downright impossible - a Chrome Extension cannot get read/write permissions for the real filesystem.

A Chrome App on the other hand can, using chrome.fileSystem API.

Your options:

  1. Make a Chrome App instead. Might not be possible if you need browser integration.
  2. Make an extension and a Chrome App that talk to each other, letting the Chrome App handle the file operations. Complicated install, but maximum flexibility.
  3. Make an extension that uses a Native Host module to do operations with the filesystem. It will be even more complicated install, but UNLIMITED POWER.
  4. Make an extension that works with its own virtual filesystem; if the user needs a file, you can use chrome.downloads API to export it.
  5. Make an extension that works with some sort of cloud storage solution, e.g. with files in Dropbox.


来源:https://stackoverflow.com/questions/37342661/chrome-extensions-with-text-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!