mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 07:38:07 +02:00
Merge pull request #9363 from Rob--W/fetch-http/s-only
Limit PDFFetchStream to http(s) in the Chrome extension
This commit is contained in:
commit
fe5102a27f
3 changed files with 51 additions and 17 deletions
|
@ -85,9 +85,13 @@ function initializePDFJS(callback) {
|
|||
// Set network stream class for unit tests.
|
||||
if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
|
||||
typeof ReadableStream !== 'undefined') {
|
||||
displayApi.setPDFNetworkStreamClass(PDFFetchStream);
|
||||
displayApi.setPDFNetworkStreamFactory(function(params) {
|
||||
return new PDFFetchStream(params);
|
||||
});
|
||||
} else {
|
||||
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);
|
||||
displayApi.setPDFNetworkStreamFactory(function(params) {
|
||||
return new PDFNetworkStream(params);
|
||||
});
|
||||
}
|
||||
|
||||
// Configure the worker.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue