Open saizai opened 4 years ago
I am not sure how to replicate this. As far as I see, the function does not rely on the existing entries of downloads.cache
after a restart. The downloads.download({}, id => {..})
is supposed to prepare a new download entry so the cache must be available.
If
downloads.cache
isn't populated (e.g. the extension crashed & was reloaded), then this will fail. https://github.com/inbasic/turbo-download-manager-v2/blob/6b565b09dc8934547939c6b7ea7fddae1ffcdfd6/v3/downloads/manager.js#L457-L482This could be fixed by adding this to manager.js:
Then one could do something like this at that restore:
However, the IDB storage necessarily removes functions, callbacks, etc. So
downloads.download
would need to be refactored to accept this.