Skip to content

Commit

Permalink
Merge pull request #8744 from yurydelendik/stream-edge
Browse files Browse the repository at this point in the history
Checks Edge support for streams.
  • Loading branch information
yurydelendik authored Aug 3, 2017
2 parents e20d4a9 + 6beb925 commit 0c95bc7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/shared/streams_polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 0c95bc7

Please sign in to comment.