Completed and failed downloads incorrectly return a downloadItem.state of "in_progress"

Viewed 180

I am working on an extension that auto resumes downloads that have been interrupted by non-human input(eg network failure). I should note that my custom extension works just fine in google chrome. Converting the extension to work with firefox should have been simple, but I'm realizing that every download I have in firefox is stuck in the "in_progress" state (even when it has completed successfully, been cancelled, or terminated in failure) in the download manager itself.

if((downloadItem.state).localeCompare("interrupted") == 0)
        {
            if(!((downloadItem.error).localeCompare("USER_CANCELED") == 0)
                && !((downloadItem.error).localeCompare("USER_SHUTDOWN") == 0)
            )
            {
                RestartDownload(downloadItem);
            }
        }

is the snippet of code that is executed in chrome, but not firefox. That is because the state is always "in_progress" and never "interrupted", even when it is clearly interrupted in my download manager. Is anyone else having this issue or is it just me? Is this a bug?

0 Answers
Related