ephemeral icon indicating copy to clipboard operation
ephemeral copied to clipboard

Support Downloads

Open arshubham opened this issue 6 years ago • 14 comments

arshubham avatar Jan 11 '19 12:01 arshubham

I can point you to Odysseus's code for this, but first I want to ask: What UX do you want here?

I might even implement it, but I want to be your design not mine.

alcinnz avatar Oct 14 '19 20:10 alcinnz

@alcinnz I think something close to Firefox/Epiphany would make sense as a start. I haven't decided how I want the empty/no-downloads state to work, whether the button is completely hidden (like Firefox/Epiphany), or whether I want to make it insensitive (more elementary-like).

cassidyjames avatar Oct 14 '19 23:10 cassidyjames

I think I might also want to explore a toast with an "Open" button on it when the download is complete; I think that's something Firefox Focus on Android does, and I like that it makes it super quick to perform the likely action.

cassidyjames avatar Oct 14 '19 23:10 cassidyjames

@alcinnz I'm working on a prototype branch now and will push that for the UI direction. :smile:

cassidyjames avatar Oct 15 '19 00:10 cassidyjames

Hmmm, that (optionally combined with a confirmation dialog like you have external links) should be more straightforward than what I've done in Odysseus. My aversion to popups lead me to fight WebKit a little bit.

You should watch out for application/octet-stream MIMEtypes, that means the client should be guessing the real MIMEtype. Otherwise they can be passed straight to GIO for handling. https://github.com/alcinnz/Odysseus/blob/master/src/Models/Download.vala#L188

And you'll need to instruct WebKit to download pages it can't display, that behavior doesn't come out of the box. https://github.com/alcinnz/Odysseus/blob/master/src/Traits/navigate/autodownload.vala#L27

alcinnz avatar Oct 15 '19 03:10 alcinnz

I'll try implementing this myself.

alcinnz avatar Oct 15 '19 05:10 alcinnz

@alcinnz rather than a dialog, I think I'd prefer a Granite.Widgets.Toast so it's self-contained within the WebView. I am already using a toast for undoing setting a site as a favorite, for example.

cassidyjames avatar Oct 15 '19 18:10 cassidyjames

I've almost got it working! Though I'm struggling with implementing the "show in folder button", any tips?

alcinnz avatar Oct 16 '19 03:10 alcinnz

@alcinnz that could be dropped to start, but I think Torrential does it here: https://github.com/davidmhewitt/torrential/blob/49ee0d870dc53e45b7638ecd00d6a60378d10b69/src/TorrentManager.vala#L304

cassidyjames avatar Oct 16 '19 15:10 cassidyjames

When I think of a download feature related to Ephemeral as a private-by-default, always-incognito browser, I ask myself the following questions: How can safe downloads be realized with Ephemeral and how can users be informed about the risks of downloads and at the same time learn how safe ways of dealing with downloads could look like?

That's what the Tor browser does: Files that the browser can display directly, such as PDFs, are displayed inside the browser. For all downloadable files, the following pop-up window appears:

Screenshot

4jNsY6fCVqZv avatar Oct 26 '19 15:10 4jNsY6fCVqZv

I dislike the idea of a dialog, just to inform a user about something.

How can safe downloads be realized with Ephemeral and how can users be informed about the risks of downloads and at the same time learn how safe ways of dealing with downloads could look like?

Instead, I think it would be better to add this information into the text of new Ephemeral window. I believe Chrome also mentiones downloaded files in it's private windows, so it's not a weird place.

janxkoci avatar Mar 07 '20 18:03 janxkoci

@janxkoci a potential compromise could be copy on the welcome screen plus an in-app toast (like I have for removing a favorite) for confirming downloads. It could be short and sweet, like,

x “example.com” is trying to download “filename.foo” Download

cassidyjames avatar Mar 10 '20 18:03 cassidyjames

@cassidyjames yeah the thing is I still don't know what is a toast :smiley: How do I see it? I tried adding a page to favs and then removing it, but didn't see anything special...

janxkoci avatar Mar 10 '20 18:03 janxkoci

@janxkoci ah, hit Ctrl+D to remove a favorite; I only throw it on keyboard (in case it was an accidental shortcut press).

cassidyjames avatar Mar 10 '20 19:03 cassidyjames