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?
Asked
Active
Viewed 1,374 times
0
-
1I doubt there's an easy way, see how it's done in other extensions like `Chrono Download Manager`. – wOxxOm Nov 30 '15 at 19:11
-
@wOxxOm, Thank you for your help but unfortunately Chrono is not open-source or at least I could not find any source in their website. – Arashsoft Nov 30 '15 at 19:57
-
possible duplicate: http://stackoverflow.com/questions/32323278/how-download-managers-like-idm-orbit-disable-built-in-chrome-download-manag?rq=1 – Eloims Dec 01 '15 at 16:47
-
1@Eloims, that is correct. That question is same as mine but I could not find it after lots of search. I think my question title is more accurate. Could you link that question to this one? – Arashsoft Dec 01 '15 at 19:53
1 Answers
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!

Eloims
- 5,106
- 4
- 25
- 41
-
Thanks for the answer. I am not new to extension development and I have worked with most of APIs you have listed. I am wondering if you know any workflow (not necessary the code) to access the download element before starting? So I can stop the default process and start my own? – Arashsoft Nov 30 '15 at 20:05
-
If you know any open-source download manager which can interrupt the default download process, please provide its name. I could not find any open source download manager to do so. – Arashsoft Nov 30 '15 at 20:08
-
-
@Arashsoft Not sure it is possible: maybe by hooking the chrome.webRequest API? This feels like a hack – Eloims Dec 01 '15 at 10:08
-
chrome.webRequest can interrupt send and receive packets (a good download manager should handle packets itself with that api instead of relying on chrome download). It is possible to interrupt a download with it but we cannot override download process with it. – Arashsoft Dec 01 '15 at 19:59
-
Have your tried to look at the code of IDM and Orbit (see linked question)? – Eloims Dec 02 '15 at 09:54