Open Bug 977822 Opened 10 years ago Updated 3 years ago

pdf.js can't display SeaMonkey mail attachments

Categories

(SeaMonkey :: MailNews: Message Display, defect)

SeaMonkey 2.25 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: info, Unassigned)

References

Details

I installed pdf.js as a SeaMonkey add-on, I just updated it to PDF Viewer 0.8.649. It works great, but not on mail attachments. In the Attachments pane of a mail message in my IMAP Inbox, if I double-click "foo.PDF" or right-click > Open, nothing happens and the JavaScript Error console shows

Timestamp: 02/27/2014 12:46:56 PM
Error: [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsISupports.QueryInterface]"  nsresult: "0x80004002 (NS_NOINTERFACE)"  location: "JS frame :: jar:file:///home/skierpage/.mozilla/seamonkey/xxxx.SMfromFx/extensions/uriloader@pdf.js.xpi!/components/PdfStreamConverter.js :: <TOP_LEVEL> :: line 759"  data: no]
Source File: jar:file:///home/skierpage/.mozilla/seamonkey/xxxx.SMfromFx/extensions/uriloader@pdf.js.xpi!/components/PdfStreamConverter.js
Line: 759

I think that line is
    aRequest.QueryInterface(Ci.nsIWritablePropertyBag);

Maybe the problem is pdf.js does not know how to handle an imap attachment the way SeaMonkey can.  E.g. when I double-click a .jpg attachment it opens in a browser window titled imap://mail.xxxx.net:993/fetch%3EUID%3E.xxxx?part=1.2&filename=nov2013_v1.jpg. I don't know if this SeaMonkey integration is the responsibility of SeaMonkey or pdf.js.

I have Edit > Preferences > Helper Applications > Content Type application/pdf set to "Always ask" but pdf.js seems to bypass that.

The workaround is to save the attachment and then open it from the filesystem in the browser.

Thanks for all your hard work on these fine products!
There are some useful comments in Thunderbird Bug 810815 (Integrate pdf.js to Thunderbird) I'll set some dependencies.
Component: Download & File Handling → MailNews: Message Display
Depends on: 810815
Status: UNCONFIRMED → NEW
Ever confirmed: true
Also see https://github.com/mozilla/pdf.js/issues/1236
As long as it can't open email attachments it would be nice if it didn't pretend to be able to, so that Seamonkey can open them in an external program as it would if pdf.js wasn't installed.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.5.1

Based on the release notes, I decided to give PDF.js a try. Seems to work in the browser, based brief testing. NICE! Clicking on a PDF attached to an email hangs. A new tab labeled PDF.js viewer opens with the PDF.js menu bar, but no contents display. The tab has spinning arrows chasing each other to the left of the label. The progress bar in the lower right (file load?) seems to be complete, or very nearly so, but stays. The progress indicator along the top of the PDF contents never appears. So maybe the attachment contents never finishes being handed off to the PDF.js program?

It's trying to load from (somewhat redacted):
mailbox:///Users/rich/Library/Application%20Support/SeaMonkey/Profiles/xxxxxxxx.default/Mail/xxxxxx.xxxxxxxx.net/Inbox.sbd/Deals?number=1965223&part=1.2&filename=xx-xxxxxxx.pdf&type=application/pdf&filename=xx-xxxxxxx.pdf

View Source on the attachment works.

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