Closed Bug 1734428 Opened 3 years ago Closed 3 years ago

PDF attachments are not opened in a tab when composing email, even though "Preview in Thunderbird" is selected as the action for PDFs

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 91
x86_64
All
defect

Tracking

(thunderbird_esr91+ verified, thunderbird94+ wontfix, thunderbird95 verified)

VERIFIED FIXED
95 Branch
Tracking Status
thunderbird_esr91 + verified
thunderbird94 + wontfix
thunderbird95 --- verified

People

(Reporter: bugzilla, Assigned: mkmelin)

References

Details

Attachments

(2 files)

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

Steps to reproduce:

In Thunderbird 91, when you receive an email with an attachment, such as a .pdf file, and you click on the attachment, the attachment is loaded in a new tab within Thunderbird. However, if you compose a new email, attach a file, and then click on the attached file (perhaps to verify that you attached the correct file), then the attachment is loaded in Firefox. This is inconsistent and confusing; indeed the first few times I clicked on an attachment after upgrading to Thunderbird 91, I thought that the attachment wasn't loading at all because I didn't know to check my Firefox window.

Expected results:

Thunderbird should load attachments that are clicked on in the compose window in a new tab within Thunderbird.

Is this with the message composition window still open, or the message saved as a draft?

Component: Untriaged → Message Compose Window
Flags: needinfo?(bugzilla)
OS: Unspecified → Linux
Hardware: Unspecified → x86_64

I just tested this with Thunderbird 91.1.0 from Fedora on Fedora 34.

With the mail composition window open, I am required to use right-click > Open on the PDF attachment, but it doesn't open in my Firefox or anywhere.

An attached .png file can be single clicked on to open it in my Image Viewer app.

With the message saved as a draft, the PDF attachment opens in the Thunderbird PDF Viewer tab.

Summary: Attachments opened in Firefox when composing email → pdf atachments opened in Firefox when composing email

This is with the compose email window still open.

Flags: needinfo?(bugzilla)

By the way, "atachments" in the updated title should be spelt "attachments".

Summary: pdf atachments opened in Firefox when composing email → pdf attachments opened in Firefox when composing email

I've updated the title.

Okay, I don't know what changed on my system since yesterday, but when I tested it again today using 91.1.0 from Fedora on Fedora 34 the PDF attachment in the composition window opened in my default Firefox Nightly application.

You want it to use the built-in PDF viewer.

I'm not sure whether this is a defect or an enhancement request, but I'll confirm it.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All

Could this be from bug 1698140? Because pdf attachments are treated as HTML files instead.

See Also: → 1698140
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Blocks: tb91found

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/194fce1c19d8
handle open pdf attachment during composition using pdf.js if wanted. r=henry

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch

Updated on Windows 10 to build 20211017105130.
Started composing a message.
Added a PDF attachment.
Double-clicked on it to open it and was asked what application I wanted to use.
Cancelled that dialog, saved the message as a draft and checked that my Daily was set to use the built-in PDF viewer, which it was, but I clicked the Action drop-down to see what other choices there were. Left it at the "Preview in Daily" action and closed the Settings tab.
Tried opening the attachment again, and it opened in the PDF Viewer tab.

Tested with a second message, and it appears I need to save the message as a draft, then open with Edit, before Thunderbird will open it in the viewer tab. Otherwise, I am asked what application I want to use if I just have the composition window open.

Comment on attachment 9245693 [details]
Bug 1734428 - handle open pdf attachment during composition using pdf.js if wanted. r=henry

[Approval Request Comment]
Regression caused by (bug #): pdf.js for tb
User impact if declined: problem opening pdfs from compose
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9245693 - Flags: approval-comm-esr91?
Attachment #9245693 - Flags: approval-comm-beta?

Comment on attachment 9245693 [details]
Bug 1734428 - handle open pdf attachment during composition using pdf.js if wanted. r=henry

[Triage Comment]
Approved for beta

Attachment #9245693 - Flags: approval-comm-beta? → approval-comm-beta+

(In reply to Rob Lemley [:rjl] from comment #16)

Thunderbird 94.0b5:
https://hg.mozilla.org/releases/comm-beta/rev/6619ba3deb40

Forgive me for being stupid but how do I get this ?
I checked and only see 94.0b4, when will this be available?
Thank you.

(In reply to efagent from comment #17)

(In reply to Rob Lemley [:rjl] from comment #16)

Thunderbird 94.0b5:
https://hg.mozilla.org/releases/comm-beta/rev/6619ba3deb40

Forgive me for being stupid but how do I get this ?
I checked and only see 94.0b4, when will this be available?
Thank you.

Probably sometime this week after the awesome release candidate testing team tests and approves it.

(In reply to WaltS48 [:walts48] from comment #18)

(In reply to efagent from comment #17)

(In reply to Rob Lemley [:rjl] from comment #16)

Thunderbird 94.0b5:
https://hg.mozilla.org/releases/comm-beta/rev/6619ba3deb40

Forgive me for being stupid but how do I get this ?
I checked and only see 94.0b4, when will this be available?
Thank you.

Probably sometime this week after the awesome release candidate testing team tests and approves it.

Thank you, I'll just keep checking back. You are awesome for taking the time to respond!

In my testing of the 94.0b5 release candidate on Windows 10, attempting to open the PDF attachment in the composition window gave me the what should Thunderbird do with this file prompt.

Testing on Linux, the attachment still opens in Firefox.

Both have "Preview in Thunderbird" as the Action in Preferences.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Error Console messages from 94.0b5:

17:17:29.906 TypeError: requestor is null PdfStreamConverter.jsm:140:13
getDOMWindow resource://pdf.js/PdfStreamConverter.jsm:140
onStopRequest resource://pdf.js/PdfStreamConverter.jsm:1262

From 95.0a1, where the PDF wants to be saved:

17:01:48.260 TypeError: can't access property "getInterface", requestor is null 3 PdfStreamConverter.jsm:140:13
getDOMWindow resource://pdf.js/PdfStreamConverter.jsm:140
onStopRequest resource://pdf.js/PdfStreamConverter.jsm:1262

(In reply to WaltS48 [:walts48] from comment #21)

Error Console messages from 94.0b5:

17:17:29.906 TypeError: requestor is null PdfStreamConverter.jsm:140:13
getDOMWindow resource://pdf.js/PdfStreamConverter.jsm:140
onStopRequest resource://pdf.js/PdfStreamConverter.jsm:1262

From 95.0a1, where the PDF wants to be saved:

17:01:48.260 TypeError: can't access property "getInterface", requestor is null 3 PdfStreamConverter.jsm:140:13
getDOMWindow resource://pdf.js/PdfStreamConverter.jsm:140
onStopRequest resource://pdf.js/PdfStreamConverter.jsm:1262

This seems to be because the attachment.contentType is empty for new attachments instead of application/pdf when it is read here https://searchfox.org/comm-central/rev/7be97df3877fcaef928606b01d455b2b49d8e9ab/mail/components/compose/content/MsgComposeCommands.js#7610). After this, the error is the same as Bug 1698140.

Note that if a message is saved and reopened for editing, any saved pdf attachments will open fine, but any newly added attachments are missing their contentType. I think the missing contentType is probably a recent regression, since I didn't notice this when reviewing this patch.

I'm changing the title to distinguish this from bug 1698140 (this is for PDF attachments that should be opened internally in Thunderbird, and the other bug is for PDF attachments being treated as a HTML when they are opened externally).

This title change is a bit verbose, but I couldn't think of a better one.

Summary: pdf attachments opened in Firefox when composing email → PDF attachments are not opened in a tab when composing email, even though "Preview in Thunderbird" is selected as the action for PDFs

(In reply to Henry Wilkes [:henry] from comment #22)

Note that if a message is saved and reopened for editing, any saved pdf attachments will open fine, but any newly added attachments are missing their contentType. I think the missing contentType is probably a recent regression, since I didn't notice this when reviewing this patch.

Just tested in 91.2, and similarly new attachments have no contentType. So I guess I only tested on reopening drafts ...

This kind of makes sense since the file's content is not read until it is saved/sent, so its contentType will not yet be determined.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/047ea135a09c
take2 - handle opening pdf attachments using pdf.js during composing email. r=henry

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Attachment #9245693 - Flags: approval-comm-esr91?

Verified fixed in testing the 95.0b1 release candidate on Windows 10.

Status: RESOLVED → VERIFIED

Comment on attachment 9248426 [details]
Bug 1734428 - take2 - handle opening pdf attachments using pdf.js during composing email. r=henry

[Approval Request Comment]
Uplift for both patches.

Attachment #9248426 - Flags: approval-comm-esr91?

Comment on attachment 9248426 [details]
Bug 1734428 - take2 - handle opening pdf attachments using pdf.js during composing email. r=henry

[Triage Comment]
Approved for esr91

Attachment #9248426 - Flags: approval-comm-esr91? → approval-comm-esr91+

Also verified testing the 91.3.1 rc on Windows 10.

I just upgraded to 91.3.1 from 91.3.0 and when composing an email I still can't open an attached PDF file to confirm I am sending the correct attachment. I thought I read that acknowledged bug was fixed in 91.3.1 ?

Error message is: C:\Users\BOB MAIN\Documents\BELMOON-RPT-1.PDF could not be opened, because the associated helper application does not exist. Change the association in your preferences.

Thank you.

(In reply to BOB from comment #33)

I just upgraded to 91.3.1 from 91.3.0 and when composing an email I still can't open an attached PDF file to confirm I am sending the correct attachment. I thought I read that acknowledged bug was fixed in 91.3.1 ?

Error message is: C:\Users\BOB MAIN\Documents\BELMOON-RPT-1.PDF could not be opened, because the associated helper application does not exist. Change the association in your preferences.

Thank you.

Your helper application is "Preview in Thunderbird" for "Portable Document Type (PDF)"?

That is what this bug report is about, and verified again using the 91.3.1 release on Windows 10 and Fedora Linux.

Your issue is bug 1698140.

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

Attachment

General

Created:
Updated:
Size: