D
D
Dimazsever2014-11-06 13:36:09
Google Chrome
Dimazsever, 2014-11-06 13:36:09

How to open downloaded file?

I have a link to a file. How do I know that the user clicked on this link and downloaded the file? After that I need to open this file. I found this thing in Google Chrome API chrome.downloads.open(integer downloadId). As I understand it, this is exactly what I need. But my English is bad. And the translator translates in such a way that nothing is understood at all. How do I know that the user has downloaded this file?
The idea is this. Hang a click event handler on this link. Then, using chrome.runtime.sendMessage, pass the url to the file to the background script. But how do you know that it has loaded? How do you know that this is exactly the file, and not some other?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question