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!