Closed
Bug 930657
Opened 11 years ago
Closed 11 years ago
[Gaia][System] Download Manager API Design
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.3 Sprint 6 - 12/6
People
(Reporter: aus, Assigned: aus)
References
Details
(Whiteboard: [systemsfe])
Attachments
(1 file)
14.36 KB,
patch
|
Details | Diff | Splinter Review |
As part of the download manager work for 1.3 we'll be designing a new Download Manager API. This API will enable downloads to be triggered from any application. This API will enable applications to list all active downloads. This API will enable applications to interact with active and completed downloads. The API may reuse existing Gecko Download Manager objects. Basic API proposal from Fabrice (designed a while back): interface DownloadManager : EventTarget { // ondownloadstart, etc. Promise<Download[]> getDownloads(); ... // other misc functions like clearDone() ? } interface Download : EventTarget { // onprogress, onload, etc. long size; long downloaded; DOMString state; // "running", "paused", "canceled" DOMString uri; void cancel(); void pause(); void resume(); }
Comment 1•11 years ago
|
||
This patch makes the changes needed to let downloads end up in the default storage area (either the internal storage or the sdcard) and neither block on a confirmation prompt.
Comment 2•11 years ago
|
||
I may understand why a download API is needed for iterating/pausing/resuming/.. downloads, and this is fine. But can we additionaly bind the html5 download attribute to triggers downloads as well. Then websites/bookmarks will be able to opt-in in a cross-browser compatible way. For example with the download attribute you can do: <a href="foo.pdf" download="save_as_bar.pdf"> This will launch the file foo.pdf and save it as save_as_bar.pdf. I assume that if someone wants to trigger that with JS directly you can just do an xhr or a bit more ugly: var a = document.createElement('a'); a.href = 'foo.pdf'; a.download = 'save_as_bar.pdf'; a.click(); Or something similar. This is a little bit ugly but at least it should work all over the place, and websites/bookmars/applications will not need to know anything about a special API that will mostly be used to manage downloads. Does it makes sense or did I missed some dependencies of this bug that was looking to do that?
Updated•11 years ago
|
Blocks: fxos-download-mgr
Comment 3•11 years ago
|
||
Vivien, this api is explicitely only about *managing* downloads, not starting them. The usual ways to trigger downloads are supported: - download attribute, - content-disposition http header, - unknown mime type.
Updated•11 years ago
|
Whiteboard: [systemsfe]
Assignee | ||
Comment 4•11 years ago
|
||
This is done as far as I know.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Target Milestone: --- → 1.3 Sprint 6 - 12/6
You need to log in
before you can comment on or make changes to this bug.
Description
•