mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Checks Edge support for streams.
This commit is contained in:
parent
e20d4a9c21
commit
6beb925f0b
1 changed files with 15 additions and 0 deletions
|
@ -13,7 +13,22 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
let isReadableStreamSupported = false;
|
||||
if (typeof ReadableStream !== 'undefined') {
|
||||
// MS Edge may say it has ReadableStream but they are not up to spec yet.
|
||||
try {
|
||||
// eslint-disable-next-line no-new
|
||||
new ReadableStream({
|
||||
start(controller) {
|
||||
controller.close();
|
||||
},
|
||||
});
|
||||
isReadableStreamSupported = true;
|
||||
} catch (e) {
|
||||
// The ReadableStream constructor cannot be used.
|
||||
}
|
||||
}
|
||||
if (isReadableStreamSupported) {
|
||||
exports.ReadableStream = ReadableStream;
|
||||
} else {
|
||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue