javascript - How to open a downloaded file? -
javascript - How to open a downloaded file? -
i have link file. how know user clicked on link , download file? need downloadid? google chrome api has method chrome.downloads.open (integer downloadid). how know downloadid, open file? help me please.
you can seek illustration code below tested in google chrome version 38.0.2125.111 m (64-bit)
chrome.downloads.onchanged.addlistener(function (detail){ console.log("detail",detail); //save log debugging //if file download finished if(detail.state.current == "complete"){ var downloadid = detail.id; //download id console.log("download id",downloadid); //save log debugging /* */ } });
javascript google-chrome-extension
Comments
Post a Comment