问题
I am trying to make a download manager extension in chrome browser. I can monitor chrome downloads via chrome.downloads API. But, I want to override the download process and handle download destination with my extension instead of default "saveFileDialog". Is there any way to do so?
回答1:
Many download managers are available from the store, so it is possible. Some of them are open-source and available on github, so have a look before starting your own.
If you want to replaces the default download manager by your own, you will need to use many of the APIs that are provided, not only chrome.download
!
chrome.fileSystem
will allow handing the filesystemchrome.contextMenus
will allow adding your "save as" buttonchrome.notifications
for notificationschrome.downloads
may allow to intercept chrome downloads event and redirect to your extensionchrome.storage
for persistent data?chrome.tabs
+ more to create your user interface- more!...
The Javascript APIs are documented here.
Good luck!
来源:https://stackoverflow.com/questions/34006028/how-to-override-download-process-in-chrome-extension