Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: HTTP download questions

30 views
Skip to first unread message

Ben Francis

unread,
Apr 5, 2013, 8:33:27 AM4/5/13
to Vivien, Etienne Segonzac, Casey Yee, hba...@mozilla.com, swi...@mozilla.com, <dev-gaia@lists.mozilla.org>, Rob MacDonald
+dev-gaia

On Tue, Mar 26, 2013 at 2:19 PM, Vivien <vnic...@mozilla.com> wrote:

> On 22/03/2013 08:12, Casey Yee wrote:
> > Hey Etienne!
> > These questions have made it around to a few places now, but I hear you
> are the one that may have the answers!
> >
> > I'm working on UX design around how uploads and downloads are handled in
> their various forms on the platform and I have a few questions about HTTP
> downloads that I think you may be able to help out with:
>
> Can you describe a little bit more what you want to do exactly? Is it
> like a kind of Download center? Otherwise the main issue I see is that
> all apps handled downloads separately. So for example if you click on a
> pdf file in the browser the file will be download by the pdf.js
> application, not by the system or by the platform. What it means is
> whatever you want to do it has to be done on a per app basis if the
> current workflow is kept. And those apps does not have more or less
> control than what a regular web page can do with an XHR (except that an
> app can have systemXHR privileges and so can request cross domain
> resources).
>

The way that audio and video downloads are currently being implemented in a
patch for the browser in bug
853351<https://bugzilla.mozilla.org/show_bug.cgi?id=853351>is for the
browser to initiate an XHR from a context menu and save directly
to DeviceStorage. The problem with this approach is that the system app has
no way of knowing this download has been initiated so can't display the
download manager UI in the utility tray as shown in the UX spec
https://www.dropbox.com/s/1fb2yxa7yb74403/browser-downloading-draft.pdf

My suggestion in bug
848371<https://bugzilla.mozilla.org/show_bug.cgi?id=848371>was to have
a more generic mechanism where whenever Gecko comes across a
MIME type it can't render, it fires an event (or even a download web
activity) which the system app can catch in order to manage that download.
The system app could then display the download UI and put the file in the
correct place in DeviceStorage based on the MIME type in the blob (as the
patch in bug 853351 <https://bugzilla.mozilla.org/show_bug.cgi?id=853351>does).

If the system app sends the XHR then it can display the UI in the utility
tray as shown in the UX spec, but there is the issue of authenticated
resources as Vivien mentioned because the system app has a different data
jar to e.g. the browser app.

Gecko can fire a web activity when the user navigates directly to a file
when browsing, and if an app wants to trigger downloads in different ways
(by long pressing on a hyperlink or long pressing on an audio or video
element for example) the app could fire a "download" web activity itself.
Do you think that would work?

Ben

--
Ben Francis
http://tola.me.uk

Fabrice Desre

unread,
Apr 5, 2013, 12:44:32 PM4/5/13
to dev-...@lists.mozilla.org
On 04/05/2013 05:33 AM, Ben Francis wrote:

> Gecko can fire a web activity when the user navigates directly to a file
> when browsing, and if an app wants to trigger downloads in different ways
> (by long pressing on a hyperlink or long pressing on an audio or video
> element for example) the app could fire a "download" web activity itself.
> Do you think that would work?

Yes, we can do that. That would also work when we move to gecko20 that
added support for the "download" attribute on <a>.

I have a gecko patch mostly ready for that once we'll have decided what
we want to use as parameters for the activity.

Fabrice
--
Fabrice Desré
b2g team
Mozilla Corporation

Fabrice Desre

unread,
Apr 5, 2013, 2:00:32 PM4/5/13
to dev-...@lists.mozilla.org, Jonas Sicking
The downside of doing it this way though is that we'll need to basically
reimplement in gaia the download manager that is part of gecko. I think
Jonas wanted to expose some kind of download API as part of the browser
API, but I'm not sure that solves all the UX use cases.
0 new messages