How to override download process in Chrome Extension

半世苍凉 提交于 2019-12-25 10:02:25

问题


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 filesystem
  • chrome.contextMenus will allow adding your "save as" button
  • chrome.notifications for notifications
  • chrome.downloads may allow to intercept chrome downloads event and redirect to your extension
  • chrome.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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!