Is there a way using webextension api to retry a failed download (for reasons like loss of network connectivity)? I looked through history and downloads but couldn’t find a way.
I mean, I can get a list of DownloadItems with downloads.search()but was unable to find a way to restart.
downloads.downloads() only seems to start a fresh download and downloads.resume()doesn’t seem to work for a failed download.
But does downloads.resume() work for failed downloads? I tried it when a download had failed due to network failure (downloads.InterruptReason) but it wouldn’t work.
Maybe downloads.resume() will work only if the download is paused and not failed? Like with the pause button or downloads.pause().
Well, if a download fails and the server doesn’t support resuming from offsets/a certain chunk, retrying would just restart the download, which is the expectation here.
Current conditions: When a download fails I can usually resume it if I catch the failure within a coupla minutes.
Assumption: the resume function presumes a paused download. So if it works the system is presenting the download as paused. However after a certain amount of time that flag is changed to “Failed” and the resume function no longer works. Obviously the server also plays a role.
Question.: What happens if we send the server a resume request repeatedly at some interval until the download resumes . The server will presume their is a user request.