Handle old downloads in chrome.downloads

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Request Handling
P3
normal
a year ago
6 months ago

People

(Reporter: aswan, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [downloads]triaged)

(Reporter)

Description

a year ago
The current implementation of chrome.download.search() just fetches a list of downloads from Downloads.getList(), which only gets downloads from the current browser session (which also includes downloads that were in progress at the end of the previous session and were restored in the current session).
For search() to retrieve historical downloads, we'll need to integrate with places and make an appropriate query.
(Reporter)

Updated

a year ago
Whiteboard: [downloads]
Downloads.jsm should return downloads from previous sessions, as long as they haven't been cleared. Is the downloads.search() API expected to remember downloads after they've been removed from the download manager?
(Reporter)

Comment 2

a year ago
> Downloads.jsm should return downloads from previous sessions, as long as they haven't been cleared.
I don't think so.

You switched from Downloads.jsm to the download manager, they're two different things.  Although the Chrome documentation doesn't say this explicitly, I think the desired behavior is for results from search() to match what is visible in the download manager.
But like I said above, download manager != Downloads.jsm.  The download manager uses Downloads.jsm for details about downloads in the current session and places/history for details about downloads from past sessions (for example see https://dxr.mozilla.org/mozilla-central/rev/dd1abe874252e507b825a0a4e1063b0e13578288/browser/components/downloads/content/allDownloadsViewOverlay.js#470).
chrome.downloads.search() currently just uses Downloads.jsm, this bug is about adding places support to bring search() in sync with what's visible in the downloads manager.  Sorry if that wasn't clear from the description.
(In reply to Andrew Swan [:aswan] from comment #2)
> > Downloads.jsm should return downloads from previous sessions, as long as they haven't been cleared.
> I don't think so.
> 
> You switched from Downloads.jsm to the download manager, they're two
> different things.

They are, but for this purpose they aren't. Removing a download from the
downloads manager removes it from the views in Downloads.jsm.

> The download manager uses Downloads.jsm for details about downloads in the
> current session and places/history for details about downloads from past
> sessions

Hm. I see. Downloads.jsm only persists downloads that haven't finished at
shutdown time. That didn't used to be the case.
(Reporter)

Updated

a year ago
Whiteboard: [downloads] → [downloads]triaged

Updated

7 months ago
Blocks: 1306879

Updated

7 months ago
Duplicate of this bug: 1306879
(Reporter)

Comment 5

7 months ago
Generalizing this to cover all of downloads, I don't think it will make sense to implement this piecemeal.
Summary: Handle old downloads in chrome.downloads.search() → Handle old downloads in chrome.downloads

Updated

6 months ago
Component: WebExtensions: Untriaged → WebExtensions: Request Handling
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.