Download PDF from cache for IE10 / IE11
IE9 falls back to downloading from the original URL.
This commit is contained in:
parent
84ae29c21d
commit
e583070deb
@ -1015,11 +1015,20 @@ var PDFView = {
|
||||
this.pdfDocument.getData().then(
|
||||
function getDataSuccess(data) {
|
||||
var blob = PDFJS.createBlob(data.buffer, 'application/pdf');
|
||||
//#if GENERIC
|
||||
if (navigator.msSaveBlob) {
|
||||
// IE10 / IE11
|
||||
if (!navigator.msSaveBlob(blob, getPDFFileNameFromURL(url))) {
|
||||
noData();
|
||||
}
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
var blobUrl = URL.createObjectURL(blob);
|
||||
triggerSaveAs(url, blobUrl);
|
||||
},
|
||||
noData // Error occurred try downloading with just the url.
|
||||
);
|
||||
).then(null, noData);
|
||||
},
|
||||
|
||||
fallback: function pdfViewFallback() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user