I have an extension which initiates downloads in its background page. The current problem is when you call chrome.downloads.download for, say 100 times, it will download 5 files at a time until all 100 files have been downloaded.
3 Answers
I had same problem with images and I found some answer which works for me:
Press "Windows-R" to open the Run tool. Type "regedit" into the box, click "OK" and then, if prompted, confirm the operation or type your administrator password to open the Registry Editor.
Double-click the "HKEY_CURRENT_USER" directory in the left pane. Double-click the "Software" sub-directory, double-click "Microsoft," double-click "Windows," double-click "CurrentVersion" and then single-click "Internet Settings."
Open the "Edit" menu, move your mouse cursor over "New" and then click "DWORD (32-bit) Value" to create a new registry entry. Name the entry "MaxConnectionsPerServer" (omit the quotes) and double-click it to view its properties.
Select the "Decimal" option from the "Base" section of the "Edit DWORD (32-bit) Value" dialog that opens up. Type the number of simultaneous downloads you want into the "Value Data" box, such as "10" (again, omit the quotes) and click "OK."
Repeat the previous two steps with only one change: This time name the new registry entry "MaxConnectionsPer1_0Server". Close the Registry Editor, close any open programs and restart your computer. The simultaneous download limit change will now go into effect.
For effect I added 650 connections or downloads and it worked for me downloaded 650 pictures from some html file with this code:
var a = document.getElementsByTagName('a');
for(var i=0; i<a.length; i++){
var myimg = a[i].getElementsByTagName('img')[0].src;
a[i].href = myimg;
a[i].download = myimg;
a[i].click();
}
-
Thanks for your answer. Could you provide the OS you tested under? Because from your answer, it looks like it's the limitation of the OS. However, now what happens to Chrome is that, when you instantiate downloads using Chrome API, it will only download 5 files at a time even if you make the API call for more than 5 times concurrently. When one download finished, another one will be started. Therefore, from that perspective, it looks like your solution doesn't solve this problem, as I am pretty sure MaxConnectionsPer1_0Server is not 5 by default? – Fries Aug 21 '17 at 10:56
-
I used it on chrome and torch, on win10 and win7 ultimate. And for MaxConnectionsPer1_0Server Idk is it 5 because I didn't have it in there I needed to add it and put my value. I made a yt video how its done: https://www.youtube.com/watch?v=AbyU-yephI4&t=1s – Aug 21 '17 at 16:31
-
1Thanks for your video. However, have you try to download those images without changing the registry? By the way, because the files you were small - it's not clear whether they had started sequentially right after one has finished... Are you sure those 96 downlaods were initiated almost at the same time? The other thing is that I am now using ubuntu and this problem still persists. I am pretty sure that Linux doesn't have such limits. Thanks! – Fries Sep 09 '17 at 14:50
HERE IS THE ANSWER... I almost gave up then I stumbled upon it. Settings >> Advanced >> Downloads >> Unclick "ask where to save each file before downloading". Done! Now you can have virtually unlimited concurrent downloads (given your also using a download manager addon or other). This was on a Mac - no idea how it is handled on Windows.

- 439
- 1
- 3
- 8
Unfortunately you can't control that. It's a limitation of chrome's browser. It would be a security issue if you can flood the user's browser with an unlimited number of downloads.

- 2,034
- 15
- 22
-
I think one of the possible workarounds is to create a new tab. But then, you can't specify the download path.... Which is essential to my extension. – Fries Jul 21 '16 at 18:19
-
I read somewhere that on Windows it's even worse. The OS limits the number of connections to the same server. I don't think i have ever tested this to see if it's still true. Maybe you can try to server the downloads from different server? – Ibrahim Jul 21 '16 at 18:24
-
Yes, I believe what you read just now is what I had read as well. And, I tried to start downloading them manually and the number of them is unlimited! When I press enter, it starts downloading immediately. So, I think by "windows", he meant Windows XP or Vista. – Fries Jul 21 '16 at 18:30
-
There is always a [limit of connections per host](https://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser) enforced by the browser's network stack. It's not specific to downloads. – Xan Jul 21 '16 at 19:25
-
@Xan if that's the case, why could I download so many files from the same host at the same time when I do it manually? – Fries Jul 22 '16 at 06:00
-
@HellowHi but do the downloads start all at once, or do they wait for the first one to finish? – Ibrahim Jul 22 '16 at 08:04
-
When start the downloads manually, all at once. When using the extension, it will start downloading 5 files. Then, when one of them is finished, new ones will start until all of them are finished. – Fries Jul 22 '16 at 08:33