Closed Bug 1760778 Opened 4 years ago Closed 4 years ago

Firefox saves webp and other files configured to "always open in Firefox" without asking, despite browser.download.useDownloadDir=false

Categories

(Firefox :: File Handling, defect)

Firefox 97
defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox-esr91 --- unaffected
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- wontfix

People

(Reporter: Oriol, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: regression, reproducible)

  1. Use a clean profile
  2. In about:settings, choose "Always ask you where to save files", i.e. browser.download.useDownloadDir=false
  3. Open https://www.ghacks.net/wp-content/uploads/2022/03/azure-folder-listing-scaled.webp

Actual: Firefox saves the image into my downloads folder
Expected: I'm asked where I want to save the file

Regression window: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c9024bd9b6bf49c41de8a0a26eafc94994b3e038&tochange=98d579a676faca258a61f6365462b7d6c3d8148c

Yeah, I get it, if I had configured "WebP Image" to "Open in Nightly" then this behavior might make sense. The problem is that I never configured that, it's by default. This breaks any reasonable expectations.

And kinda off-topic, but Firefox should be able to show the WebP image without downloading it first?

:Gijs, since you are the author of the regressor, bug 1738916, could you take a look?
For more information, please visit auto_nag documentation.

Flags: needinfo?(gijskruitbosch+bugs)
Has Regression Range: --- → yes

(In reply to Oriol Brufau [:Oriol] from comment #0)

  1. Use a clean profile
  2. In about:settings, choose "Always ask you where to save files", i.e. browser.download.useDownloadDir=false
  3. Open https://www.ghacks.net/wp-content/uploads/2022/03/azure-folder-listing-scaled.webp

Actual: Firefox saves the image into my downloads folder
Expected: I'm asked where I want to save the file

Regression window: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c9024bd9b6bf49c41de8a0a26eafc94994b3e038&tochange=98d579a676faca258a61f6365462b7d6c3d8148c

Yeah, I get it, if I had configured "WebP Image" to "Open in Nightly" then this behavior might make sense. The problem is that I never configured that, it's by default.

I get that it's surprising, but this has been the default for several years now. We ignored it for Content-Disposition: attachment, forcing a prompt, because of bug 453455. Fixing that means that we now do what the intent was all along.

And kinda off-topic, but Firefox should be able to show the WebP image without downloading it first?

The server claims it's not a webp file. That is, the server sends no Content-Type at all, and also sends nosniff headers, telling the browser not to check first. We start a download process for this file of unknown type, then when checking whether to open/save/prompt for that download, realize it's a webp file based on the extension, and invoke the webp default action (open).

Short of changing the default for webp files (to what, exactly - "save to disk"? That likely isn't what most people would want...), I don't think there's much we can do here. I get that it's not ideal from your perspective, I just don't see what would be a reasonable solution that doesn't disadvantage much more common usecases. Am I missing some kind of obvious option?

Blocks: 1744297
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(oriol-bugzilla)
No longer regressed by: 1738916
Summary: Firefox saves files without asking despite browser.download.useDownloadDir=false → Firefox saves webp and other files configured to "always open in Firefox" without asking, despite browser.download.useDownloadDir=false

Maybe when the user chooses "Always ask you where to save files", check if there is any content type which is set to "Open in <whatever>", and if so show a warning telling the user that they may want to change that, and possibly offer a button to change them all to "Always ask".

Flags: needinfo?(oriol-bugzilla)

(In reply to Oriol Brufau [:Oriol] from comment #3)

Maybe when the user chooses "Always ask you where to save files", check if there is any content type which is set to "Open in <whatever>", and if so show a warning telling the user that they may want to change that, and possibly offer a button to change them all to "Always ask".

I understand that you think "always ask you where to save files" should imply that this happens even for files you want to open (or that there should be some other kind of prompt). But that isn't how everyone who uses that option uses it. See also e.g. people in bug 1738574 who change the default downloads directory, set some filetypes to "always open", and ask for a location for other file types, in order to separate out files that are opened from files that they save; switching those filetypes to "always ask" would be counterproductive for such users. Likewise, clearly folks who filed bug 1738916 and its dupe while this change was on Nightly didn't think this behaviour was problematic either.

I also don't think that we are likely to have any solid idea of how many people who have "always ask me where to save files" set, think that opened files not prompting for a location is a bug (as it's a question of user intent / mindset, rather than something we could determine with statistics or telemetry), and so I am very reluctant to do anything else here without a clearer idea of the cost/benefit. Certainly "warning" users about a behaviour many of them want seems wrong (and sure, we could make the warning dismissable, but it would still be confusing to users and either way that is yet more work and more preference clutter). So at the moment, I don't think the cost/benefit of the complexity of such a change really stack up.

I'm marking this wontfix, but I'll say it's a "soft" wontfix - I would be open to reconsidering if I'm missing some low-hanging-fruit way to address this problem that would not cause problems for users with other workflows.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX

I guess what's very confusing to me is that when I choose "Always ask you where to save files", then the field in "Save files to" is greyed out, implying that it will not be used at all. But actually, it's used if any content type is set to "always open in Firefox".

Then, my solution was,

  1. Switch back to "Save files to"
  2. Set folder to /tmp/mozilla_oriol
  3. Choose "Always ask you where to save files" again

Then if Firefox decides to save a file without asking me, at least it's a tmp folder. It won't unexpectedly pollute my Downloads folder.

I guess the UI should be clearer that:

  1. browser.download.dir and browser.download.useDownloadDir are independent preferences
  2. browser.download.useDownloadDir is only the default, it can be overridden by specific content types

(In reply to Oriol Brufau [:Oriol] from comment #5)

I guess the UI should be clearer

It should, that is tracked in bug 1762775. We've aligned on an approach there with thanks to Shane, so I'd be very happy to review patches for it - we'll likely eventually get to it ourselves but I don't have any timelines for that right now.

You need to log in before you can comment on or make changes to this bug.