From c0bb71d2d205f8bcf594e4c331dcfca928d36d8c Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Tue, 2 Apr 2013 08:07:01 -0500 Subject: [PATCH] Workaround for FF17 to be able to download the pdf file --- extensions/firefox/components/PdfStreamConverter.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extensions/firefox/components/PdfStreamConverter.js b/extensions/firefox/components/PdfStreamConverter.js index 803b6d842..0d3bb3ab4 100644 --- a/extensions/firefox/components/PdfStreamConverter.js +++ b/extensions/firefox/components/PdfStreamConverter.js @@ -268,10 +268,13 @@ ChromeActions.prototype = { var channel = Cc['@mozilla.org/network/input-stream-channel;1']. createInstance(Ci.nsIInputStreamChannel); channel.QueryInterface(Ci.nsIChannel); - channel.contentDisposition = Ci.nsIChannel.DISPOSITION_ATTACHMENT; - if (self.contentDispositionFilename) { - channel.contentDispositionFilename = self.contentDispositionFilename; - } + try { + // contentDisposition/contentDispositionFilename is readonly before FF18 + channel.contentDisposition = Ci.nsIChannel.DISPOSITION_ATTACHMENT; + if (self.contentDispositionFilename) { + channel.contentDispositionFilename = self.contentDispositionFilename; + } + } catch (e) {} channel.setURI(originalUri); channel.contentStream = aInputStream; if ('nsIPrivateBrowsingChannel' in Ci &&