I'm going to develop a Chrome Extension detecting status when files begin to download from chrome browser and read the files for certain purposes.
let downloadIds = [];
chrome.downloads.onCreated.addListener(function (downloadItem) {
console.log("filename with absolute local path " , downloadItem.filename); // prints ""
// Just FYI, you won't get downloadItem.filename here. So store the downloadId
downloadIds.push(downloadItem.id);
});
chrome.downloads.search({id: downloadIds[0]}, function (downloadItem) {
console.log("filename with absolute local path " , downloadItem.filename);
// prints "C:/user/downloads/yourfile"
});
Now use <input type="file" > in your popup.html
and access the file which match with your filename acquired from step
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With