I’m trying to delete everything that is in Download folder once Chrome browser is closed. The use case is for a public PC, which is why I need the feature. I am doing it in a Chrome extension. Currently, I can detect chrome close event using:
I tried chrome.downloads.removeFile(id, callback) and it works. But it depends on the download history in Chrome to retrieve the ids for removal. If the user clear the download history, this function won’t work and the files are not deleted. So I need something else.
I thought of sending a message to run a .cmd command to delete files in Download folder but I don’t understand how it works after reading the tutorial.
Is there anyone who can help share some other approach which I can use in this case? Thanks!