mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Workaround for FF17 to be able to download the pdf file
This commit is contained in:
parent
af1833c4d8
commit
c0bb71d2d2
1 changed files with 7 additions and 4 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue