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?
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:
- Make a Chrome App instead. Might not be possible if you need browser integration.
- 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.
- 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.
- 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. - 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