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

Popular posts from this blog

javascript - I need to update the text of a paragraph by inline edit -

javascript - THREE.js reposition vertices for RingGeometry -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -