As a follow up to #25770 (moved), it turns out Tor Browser actually begins (and sometimes completes) the download before the user can confirm they actually want the-thing. This manifests in #7449 (moved) and #11254 (moved) as the file being downloaded in /tmp (on Unix, or similar on other platforms) and then it is moved into the correct directory.
This provides an obvious performance improvement, especially for our use case. Unfortunately, this download begins before the user is even given the "where do you want this file saved" prompt, and I'm worried subtly downloading a file in the background is dangerous is some context, particularly some of our users.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I should also mention that because this download occurs speculatively, it is not bound to/associated with a firstPartyURI, so if the server requires a cookie (or the same originating-ip-address, or some other auth) obtained from another context/tab/domain-isolation, then this download will fail in a confusing way for the user.
I should also mention that because this download occurs speculatively, it is not bound to/associated with a firstPartyURI, so if the server requires a cookie (or the same originating-ip-address, or some other auth) obtained from another context/tab/domain-isolation, then this download will fail in a confusing way for the user.
I think I don't understand this comment. Do you have an example where I can see this scenario live?
As a follow up to #25770 (moved), it turns out Tor Browser actually begins (and sometimes completes) the download before the user can confirm they actually want the-thing. This manifests in #7449 (moved) and #11254 (moved) as the file being downloaded in /tmp (on Unix, or similar on other platforms) and then it is moved into the correct directory.
I think there are two things that we need to keep separate:
The download starting early
Using /tmp for saving parts of the download before it is finally transferred to the location it should be in.
Is a bug and you cited some tickets for it. I am not sure whether 1) is a bug, though: the users clicked on the resource indicating that they want to have it, no?
Or maybe there is even a third thing involved: 3) The external helper app dialog is implying the download has not started yet while it indeed has (see: comment:2:ticket:18587). So, I agree with that one being confusing and we should come up with a better wording for what is happening. Historically, it has been a pain getting the message on that dialog right but I bet we can improve it further.
As a follow up to #25770 (moved), it turns out Tor Browser actually begins (and sometimes completes) the download before the user can confirm they actually want the-thing. This manifests in #7449 (moved) and #11254 (moved) as the file being downloaded in /tmp (on Unix, or similar on other platforms) and then it is moved into the correct directory.
I think there are two things that we need to keep separate:
The download starting early
Using /tmp for saving parts of the download before it is finally transferred to the location it should be in.
Is a bug and you cited some tickets for it. I am not sure whether 1) is a bug, though: the users clicked on the resource indicating that they want to have it, no?
I agree this isn't strictly a bug, but I classify this as a Firefox feature that we don't want. I understand why Firefox begins downloading the file when a user clicks on the link/button. However, if a users opens the context menu of a link and selects "Save Link As...", then I do not believe users expect Firefox begins downloading the file until they select the destination directory/filename and click "Save".
The issue with saving files in /tmp is a complete mess, and after reading that moz bug I don't know what we should do when a user clicks a link and Firefox cannot handle it internally (opening a pdf using pdfjs, show a plaintext file directly, etc). We should leave this question for the other open /tmp tickets.
Or maybe there is even a third thing involved: 3) The external helper app dialog is implying the download has not started yet while it indeed has (see: comment:2:ticket:18587). So, I agree with that one being confusing and we should come up with a better wording for what is happening. Historically, it has been a pain getting the message on that dialog right but I bet we can improve it further.
I originally thought this was worse because the downloading begins before the "External App Blocker" is shown, but after I thought about this more I didn't think the timing makes a difference. That warning/popup is specifically about opening the file, it doesn't say anything about downloading. Considering previous pain related to this, I expect showing the message earlier will not be easy.
Oh, interesting, I didn't remember this section. Indeed, these are two different features, but maybe they should be treated the same (do not open speculative connections when a proxy is configured). (Thanks for clarifying that difference before anyone else became confused)
Right, Mozilla have a couple long bugs and reading them is painful - and they're filled with comments about modem lights blinking, T-DSL, and 500MB exceeding available memory.
The reason I opened this bug is because Tor Browser should not begin downloading a file unless the user explicitly confirms they want the file downloaded and where they want it saved. If clicking "Save Link As..." starts any network transactions before the users clicks "Save" within the file-chooser dialog box, then Tor Browser should make this obvious. I believe Tor Browser should treat the two scenarios differently:
I click on the link and Firefox doesn't know what to do, so it asked me where to save the file
I click on "Save Link As..." and specify where I want the file saved (or I click cancel)
Within scenario (1), Firefox cannot know what it should do without beginning the download. That's okay. With scenario (2), that is completely against what the user requested. This is almost certainly a Firefox bug, unfortunately it seems Firefox handles (1) and (2) using the same logic.
Within scenario (1), Firefox cannot know what it should do without beginning the download. That's okay. With scenario (2), that is completely against what the user requested. This is almost certainly a Firefox bug, unfortunately it seems Firefox handles (1) and (2) using the same logic.
Hrm, and this is related to #22649 (moved) (coming from #25672 (moved)). But, to clarify, it may be that #22649 (moved) is resolved if "Save Link As..." does not use a speculative connection. If it uses a connection created within the context of the current first party domain, then maybe the download will use the correct circuit.
Within scenario (1), Firefox cannot know what it should do without beginning the download. That's okay. With scenario (2), that is completely against what the user requested. This is almost certainly a Firefox bug, unfortunately it seems Firefox handles (1) and (2) using the same logic.
Of course, Firefox wants to handle (2) in a smart way:
// an object to proxy the data through to // nsIExternalHelperAppService.doContent, which will wait for the // appropriate MIME-type headers and then prompt the user with a // file picker
I wonder if we can simply use the timeout case instead, and skip the async fetch (?):
onStopRequest: function saveLinkAs_onStopRequest(aRequest, aContext, aStatusCode) { if (aStatusCode == NS_ERROR_SAVE_LINK_AS_TIMEOUT) { // do it the old fashioned way, which will pick the best filename // it can without waiting. saveURL(linkURL, linkText, dialogTitle, bypassCache, false, docURI, doc); }
The reason I opened this bug is because Tor Browser should not begin downloading a file unless the user explicitly confirms they want the file downloaded and where they want it saved. If clicking "Save Link As..." starts any network transactions before the users clicks "Save" within the file-chooser dialog box, then Tor Browser should make this obvious. I believe Tor Browser should treat the two scenarios differently:
I click on the link and Firefox doesn't know what to do, so it asked me where to save the file
I click on "Save Link As..." and specify where I want the file saved (or I click cancel)
Within scenario (1), Firefox cannot know what it should do without beginning the download. That's okay. With scenario (2), that is completely against what the user requested. This is almost certainly a Firefox bug, unfortunately it seems Firefox handles (1) and (2) using the same logic.
Why is (2) against what the user requested? The user said: "I want to have that thing AND want to specify where it will be after the download finished." And they get both. Note that the "Save Link" part already means "Yes, I want to have it!1!!" (unrelated to the "As") even if they might not know yet where to put the result or how to name it, or want to select the place themselves with a GUI . Thus, starting the download in the meantime while they are selecting the place where it should land sounds reasonable to me. Sure, if they decided "Nah, I actually don't really want it" (i.e. clicking the Cancel button) it gets discarded, no damage done.
The reason I opened this bug is because Tor Browser should not begin downloading a file unless the user explicitly confirms they want the file downloaded and where they want it saved. If clicking "Save Link As..." starts any network transactions before the users clicks "Save" within the file-chooser dialog box, then Tor Browser should make this obvious. I believe Tor Browser should treat the two scenarios differently:
I click on the link and Firefox doesn't know what to do, so it asked me where to save the file
I click on "Save Link As..." and specify where I want the file saved (or I click cancel)
Within scenario (1), Firefox cannot know what it should do without beginning the download. That's okay. With scenario (2), that is completely against what the user requested. This is almost certainly a Firefox bug, unfortunately it seems Firefox handles (1) and (2) using the same logic.
Why is (2) against what the user requested? The user said: "I want to have that thing AND want to specify where it will be after the download finished." And they get both.
Yes, except as a user, I do not confirm this is the action I want until I click the "Save" button on the file selector. Downloading the file before I click "Save" is preemptive and it is an optimization.
Note that the "Save Link" part already means "Yes, I want to have it!1!!" (unrelated to the "As") even if they might not know yet where to put the result or how to name it, or want to select the place themselves with a GUI . Thus, starting the download in the meantime while they are selecting the place where it should land sounds reasonable to me. Sure, if they decided "Nah, I actually don't really want it" (i.e. clicking the Cancel button) it gets discarded, no damage done.
I understand why this design is useful - especially for slow connections (and therefore it is useful for many Tor users). I'm worried this breaks the [of least surprise] and it creates a network call the user may not want - and in some situations it could put a user at risk, I think. I am not saying this is a bad feature, but I did not expect Firefox would begin the downloading process before I clicked "Save". From the Browser's perspective, I agree this behavior makes sense - as you described.
Trac: Resolution: N/Ato not a bug Status: new to closed