Disables fetch when ReadableStream is not available.
This commit is contained in:
parent
3cff7da0e7
commit
cd95b426c7
@ -34,7 +34,8 @@ if (typeof PDFJSDev === 'undefined' ||
|
|||||||
if (pdfjsSharedUtil.isNodeJS()) {
|
if (pdfjsSharedUtil.isNodeJS()) {
|
||||||
var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
|
var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
|
||||||
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFNodeStream);
|
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFNodeStream);
|
||||||
} else if (typeof Response !== 'undefined' && 'body' in Response.prototype) {
|
} else if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
|
||||||
|
typeof ReadableStream !== 'undefined') {
|
||||||
var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
|
var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
|
||||||
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFFetchStream);
|
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFFetchStream);
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,8 @@ function initializePDFJS(callback) {
|
|||||||
var PDFFetchStream = modules[3].PDFFetchStream;
|
var PDFFetchStream = modules[3].PDFFetchStream;
|
||||||
|
|
||||||
// Set network stream class for unit tests.
|
// Set network stream class for unit tests.
|
||||||
if (typeof Response !== 'undefined' && 'body' in Response.prototype) {
|
if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
|
||||||
|
typeof ReadableStream !== 'undefined') {
|
||||||
displayApi.setPDFNetworkStreamClass(PDFFetchStream);
|
displayApi.setPDFNetworkStreamClass(PDFFetchStream);
|
||||||
} else {
|
} else {
|
||||||
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);
|
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);
|
||||||
|
Loading…
Reference in New Issue
Block a user