Reputation: 3483
I'm working on a Chrome extension and I'd like to have the extension:
I see that the chrome.downloads API allows me to initiate the download and open the file, but is it possible for me to read the contents of the file (without writing native code)?
Upvotes: 8
Views: 8876
Reputation: 704
I'm copying the answer I gave here.
You just need to add a permission to file://*
in your manifest file and once you have your file's path in the system (with chrome.downloads.search
in the filename
property), make a GET XMLHttpRequest to the url file://{filepath}
.
Upvotes: 6