Closed Bug 1769368 Opened 3 years ago Closed 5 months ago

Incorrect PDF download behavior in gmail

Categories

(Firefox :: File Handling, defect)

defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox137 --- affected

People

(Reporter: srahman53171618, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0

Steps to reproduce:

Attempted to download a pdf from gmail using gmail's download pdf button. Download behavior is set to always ask before downloading in firefox. pdf behavior is set to "open in firefox".

Actual results:

Firefox downloaded the pdf file without prompting for download location (into downloads folder). Firefox then opened said pdf for viewing in a new tab.

Expected results:

Firefox should prompt user for download location. Firefox should not open the pdf in new tab.

If Firefox pdf behavior is set to ask every time, then firefox asks user what to do. This is not the correct behavior - user should be asked where to save using the save file dialog box directly. This option also takes away the users ability to open pdf links directly without any prompt.

Correct behavior is observed for png file from gmail. Issue seems linked to pdfs and isolated to gmail.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

This is likely caused by the fix for https://bugzilla.mozilla.org/show_bug.cgi?id=453455. Previously, the Content-disposition: attachment header meant "download the file". Now, the Content-disposition: attachment header means nothing.

Component: Widget: Gtk → File Handling
Product: Core → Firefox
Version: Firefox 100 → unspecified

Hello! I have managed to reproduce the issue with firefox 137.0a1(2025-02-07) on Ubuntu 22.04 following the steps provided in the description.

I will mark this issue as NEW in order to get our developers involved and provide a solution in the future.

Have a nice day!

Status: UNCONFIRMED → NEW
Ever confirmed: true

This is currently the expected behavior.
It's a complicate matter, where one side there's the server saying "download this" and on the other side the user has pdf set to "Open in Firefox". And unfortunately a huge amount of servers are misconfigured, so we decided to trust the user.
Note the global "Ask me before saving" checkbox, is in reality overridden by extension specific settings in the Applications section, so it applies to things that are not set there.
There is a preference in about:config called browser.download.force_save_internally_handled_attachments that will revert to the old behavior if you prefer that.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.