mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Merge pull request #9729 from Snuffleupagus/gulp-image_decoders
Add a `gulp image_decoders` command to package the image decoders (i.e. jpg.js, jpx.js, jbig2.js) separately, and publish them in pdfjs-dist
This commit is contained in:
commit
14b69a4c1c
10 changed files with 288 additions and 14 deletions
|
@ -147,6 +147,11 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
|
||||
// Support: IE, Safari<8, Chrome<32
|
||||
(function checkPromise() {
|
||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('IMAGE_DECODERS')) {
|
||||
// The current image decoders are synchronous, hence `Promise` shouldn't
|
||||
// need to be polyfilled for the IMAGE_DECODERS build target.
|
||||
return;
|
||||
}
|
||||
if (globalScope.Promise) {
|
||||
return;
|
||||
}
|
||||
|
@ -166,6 +171,11 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
(function checkURLConstructor() {
|
||||
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('IMAGE_DECODERS')) {
|
||||
// The current image decoders doesn't utilize the `URL` constructor, hence
|
||||
// it shouldn't need to be polyfilled for the IMAGE_DECODERS build target.
|
||||
return;
|
||||
}
|
||||
// feature detect for URL constructor
|
||||
var hasWorkingUrl = false;
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue