How to hook download in Chrome extension?
I need to write a Chrome extension that gets notified everytime a download is initiated or about to begin. The extension also needs to be able to prevent the download from continuing.
I tried searching everywhere for ways to do this... but I wasn't getting anywhere.
How would I 开发者_如何学JAVAgo about doing this? Is there some function I can call to register a callback?
You cannot do that, there is currently no API that hooks up to the download manager. There were talks about adding an API, but no plans were announced just yet.
I don't know if you can use NPAPI. But here is the issue on the tracker if you want to be notified when the Downloads API will be developed: http://code.google.com/p/chromium/issues/detail?id=12133
精彩评论