Configuration
SM-2.49.4/5, LXLE 16.04 Linux i686
PDF.js 2.2.253
Steps to reproduce the problem:
- Set emails to view as text
- Edit>Preferences>Browser>Helper Applications should show "PDF: Always Ask"
- Open an email with attached PDF file
- Open (double-click or context-menu>Open) the attachment
- Nothing happens
- Instead try context-menu>Open With...>Document Viewer
- The attached file opens in Document Viewer.
What is the expected behaviour?
At step 5, a browser tab with a pdf.js view of the attached file should open.
What went wrong?
There's an invalid assumption in PdfstreamConversion.jsm. When step 5 fails, the Error Console fingers this fragment (lines 941...)
aRequest.QueryInterface(Ci.nsIChannel);
/*943*/ aRequest.QueryInterface(Ci.nsIWritablePropertyBag);
var contentDispositionFilename;
try {
contentDispositionFilename = aRequest.contentDispositionFilename;
} catch (e) {}
// Change the content type so we don't get stuck in a loop.
/*951*/ aRequest.setProperty("contentType", aRequest.contentType);
aRequest.contentType = "text/html";
Line 943 fails (and the viewer then fails to open) because aRequest in this context doesn't support the nsIWritablePropertyBag interface, as logged in the Console.
However line 951 expects that it does. If both lines are removed, the viewer works as expected, despite the comment above: not just in the test case, but generally. I couldn't find any code in the viewer that might retrieve the contentType stashed at line 951.
Configuration
SM-2.49.4/5, LXLE 16.04 Linux i686
PDF.js 2.2.253
Steps to reproduce the problem:
What is the expected behaviour?
At step 5, a browser tab with a pdf.js view of the attached file should open.
What went wrong?
There's an invalid assumption in PdfstreamConversion.jsm. When step 5 fails, the Error Console fingers this fragment (lines 941...)
Line 943 fails (and the viewer then fails to open) because
aRequestin this context doesn't support thensIWritablePropertyBaginterface, as logged in the Console.However line 951 expects that it does. If both lines are removed, the viewer works as expected, despite the comment above: not just in the test case, but generally. I couldn't find any code in the viewer that might retrieve the
contentTypestashed at line 951.