Dongw1126 / Auto-Resume-Downloads

Auto Download Resume Chrome extension
https://chrome.google.com/webstore/detail/auto-resume-downloads/pifbhionjpacnpjoaomhdpbekkdphdgd
MIT License
40 stars 4 forks source link

Fix unable to resume downloads if >1000 in list #13

Closed OhKai closed 9 months ago

OhKai commented 9 months ago

I noticed that the extension didn't work for me. After some testing I figured out that the reason is that chrome.downloads.search() returns at max 1000 items in random order.

This means if the user has more than 1000 downloads in the list, the extension won't load the newest ones and is thus unable to resume (which can easily happen if you don't clear the downloads page for multiple years).

A manual workaround is to simply clear the downloads page with the button in the top right.

This PR should fix this by always loading the newest downloads from the list.

Dongw1126 commented 9 months ago

Thank you for contributing the code!

According to the Chrome Extension API documentation, your code seems to be the correct solution. Docs

I will merge after testing and update the extension. Thank you.