[upstream] PDF attachment opens in Firefox instead of the built-in viewer when opened from the compose window

Bug #1945741 reported by Alistair Cunningham
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
Unknown
thunderbird (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

In Thunderbird 78, you could double click on an attachment you've just attached when composing an email. This was very useful, so that you could double check that you attached the correct file. In Thunderbird 91, this doesn't seem to work. When you double click on the attachment, nothing happens.

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: thunderbird 1:91.1.1+build2-0ubuntu1
ProcVersionSignature: Ubuntu 5.13.0-16.16-generic 5.13.13
Uname: Linux 5.13.0-16-generic x86_64
AddonCompatCheckDisabled: False
ApportVersion: 2.20.11-0ubuntu69
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: alistair 2076 F.... pulseaudio
BuildID: 20210916142849
CasperMD5CheckResult: unknown
Channel: Unavailable
CurrentDesktop: Unity:Unity7:ubuntu
Date: Fri Oct 1 08:44:34 2021
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 # Include files from /etc/network/interfaces.d:
 source-directory /etc/network/interfaces.d
IncompatibleExtensions:
 Lightning - {e2fda1a4-762b-4020-b5ad-a41df1933103}
 English (GB) Language Pack - <email address hidden>
 Thunderbird (default) - {972ce4c6-7e08-4474-a285-3208198ce6fd}
InstallationDate: Installed on 2020-07-14 (443 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
IpRoute:
 default via 172.30.3.254 dev wlp0s20f3 proto dhcp metric 600
 10.0.0.0/24 dev wg0 proto kernel scope link src 10.0.0.2
 169.254.0.0/16 dev wg0 scope link metric 1000
 172.30.0.0/22 dev wlp0s20f3 proto kernel scope link src 172.30.0.92 metric 600
PrefErrors: Unexpected character ',' before close parenthesis @ /usr/lib/thunderbird/omni.ja:greprefs.js:359
PrefSources: prefs.js
Profiles: Profile0 (Default) - LastVersion=91.1.1/20210916142849 (In use)
RebootRequiredPkgs: Error: path contained symlinks.
RunningIncompatibleAddons: True
SourcePackage: thunderbird
UpgradeStatus: Upgraded to impish on 2021-09-24 (6 days ago)
dmi.bios.date: 06/21/2021
dmi.bios.release: 1.19
dmi.bios.vendor: LENOVO
dmi.bios.version: N2WET29W (1.19 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20U9CTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0R32862 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.8
dmi.modalias: dmi:bvnLENOVO:bvrN2WET29W(1.19):bd06/21/2021:br1.19:efr1.8:svnLENOVO:pn20U9CTO1WW:pvrThinkPadX1CarbonGen8:skuLENOVO_MT_20U9_BU_Think_FM_ThinkPadX1CarbonGen8:rvnLENOVO:rn20U9CTO1WW:rvrSDK0R32862WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad X1 Carbon Gen 8
dmi.product.name: 20U9CTO1WW
dmi.product.sku: LENOVO_MT_20U9_BU_Think_FM_ThinkPad X1 Carbon Gen 8
dmi.product.version: ThinkPad X1 Carbon Gen 8
dmi.sys.vendor: LENOVO

Revision history for this message
Alistair Cunningham (acunningham) wrote :
Revision history for this message
Alistair Cunningham (acunningham) wrote :

I've just discovered that the links are opened in Firefox, which I have running in another virtual window. That's strange and counter-intuitive, especially when PDF files in emails I've received are opened in another tab within Thunderbird, but it does actually work.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. So the issue is that pdf files are not open in the software you would expect?

Changed in thunderbird (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Alistair Cunningham (acunningham) wrote :

Yes.

Revision history for this message
Olivier Tilloy (osomon) wrote :

I can observe the same thing: opening a PDF attachment from the compose window will open it in firefox (or whatever application is configured for it), but opening the same attachment from the message after it's been sent opens it in a new tab in thunderbird.

That looks like an upstream problem, and from a cursory search I didn't find an existing bug for it. Would you mind filing one at https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes%7CThunderbird and sharing the link to it here? Thanks!

Changed in thunderbird (Ubuntu):
status: Incomplete → Confirmed
summary: - Can't view attachment after attaching
+ PDF attachment is opened in Firefox from the compose window
summary: - PDF attachment is opened in Firefox from the compose window
+ PDF attachment opens in Firefox instead of the built-in viewer when
+ opened from the compose window
Revision history for this message
In , Bugzilla-7 (bugzilla-7) wrote :

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.

Revision history for this message
Alistair Cunningham (acunningham) wrote : Re: PDF attachment opens in Firefox instead of the built-in viewer when opened from the compose window
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks Alistair!

summary: - PDF attachment opens in Firefox instead of the built-in viewer when
- opened from the compose window
+ [upstream] PDF attachment opens in Firefox instead of the built-in
+ viewer when opened from the compose window
Revision history for this message
In , Wls220spring (wls220spring) wrote :

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

Revision history for this message
In , Wls220spring (wls220spring) wrote :

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.

Revision history for this message
In , Bugzilla-7 (bugzilla-7) wrote :

This is with the compose email window still open.

Revision history for this message
In , Bugzilla-7 (bugzilla-7) wrote :

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

Revision history for this message
In , Bugzilla-7 (bugzilla-7) wrote :

I've updated the title.

Changed in thunderbird:
status: Unknown → New
Revision history for this message
In , Wls220spring (wls220spring) wrote :

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.

Changed in thunderbird:
status: New → Confirmed
Revision history for this message
In , 9-henry (9-henry) wrote :

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

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

Created attachment 9245693
Bug 1734428 - handle open pdf attachment during composition using pdf.js if wanted. r=henry

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1735585 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/comm-central/rev/194fce1c19d8
handle open pdf attachment during composition using pdf.js if wanted. r=henry

Revision history for this message
In , Wls220spring (wls220spring) wrote :

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.

Changed in thunderbird:
status: Confirmed → Fix Released
Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1737408 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

Comment on attachment 9245693
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

Revision history for this message
In , Vseerror (vseerror) wrote :

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

[Triage Comment]
Approved for beta

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1737742 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Rob Lemley (rjl-tbird) wrote :
Revision history for this message
In , Eldene (eldene) wrote :

(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.

Revision history for this message
In , Wls220spring (wls220spring) wrote :

(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.

Revision history for this message
In , Eldene (eldene) wrote :

(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!

Revision history for this message
In , Wls220spring (wls220spring) wrote :

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.

Revision history for this message
In , Wls220spring (wls220spring) wrote :

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

Revision history for this message
In , 9-henry (9-henry) wrote :

(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.~~

Revision history for this message
In , 9-henry (9-henry) wrote :

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.

Revision history for this message
In , 9-henry (9-henry) wrote :

(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.

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

Created attachment 9248426
Bug 1734428 - take2 - handle opening pdf attachments using pdf.js during composing email. r=henry

Changed in thunderbird:
status: Fix Released → Confirmed
Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/comm-central/rev/047ea135a09c
take2 - handle opening pdf attachments using pdf.js during composing email. r=henry

Revision history for this message
In , Wls220spring (wls220spring) wrote :

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

Changed in thunderbird:
status: Confirmed → Fix Released
Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

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

[Approval Request Comment]
Uplift for both patches.

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1739616 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Vseerror (vseerror) wrote :

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

[Triage Comment]
Approved for esr91

Revision history for this message
In , Rob Lemley (rjl-tbird) wrote :
Revision history for this message
In , Wls220spring (wls220spring) wrote :

Also verified testing the 91.3.1 rc on Windows 10.

Revision history for this message
In , Infobob (infobob) wrote :

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.

Revision history for this message
In , Wls220spring (wls220spring) wrote :

(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.

Olivier Tilloy (osomon)
Changed in thunderbird (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.