mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
[api-minor] Move the ReadableStream
polyfill to the global scope
Note that most (reasonably) modern browsers have supported this for a while now, see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#Browser_compatibility By moving the polyfill into `src/shared/compatibility.js` we can thus get rid of the need to manually export/import `ReadableStream` and simply use it directly instead. The only change here which *could* possibly lead to a difference in behavior is in the `isFetchSupported` function. Previously we attempted to check for the existence of a global `ReadableStream` implementation, which could now pass (assuming obviously that the preceding checks also succeeded). However I'm not sure if that's a problem, since the previous check only confirmed the existence of a native `ReadableStream` implementation and not that it actually worked correctly. Finally it *could* just as well have been a globally registered polyfill from an application embedding the PDF.js library.
This commit is contained in:
parent
af4ba75f68
commit
e24050fa13
8 changed files with 32 additions and 68 deletions
|
@ -15,7 +15,6 @@
|
|||
/* eslint no-var: error */
|
||||
|
||||
import './compatibility';
|
||||
import { ReadableStream } from './streams_polyfill';
|
||||
|
||||
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
|
||||
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
|
||||
|
@ -930,7 +929,6 @@ export {
|
|||
readUint16,
|
||||
readUint32,
|
||||
removeNullCharacters,
|
||||
ReadableStream,
|
||||
setVerbosityLevel,
|
||||
shadow,
|
||||
string32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue