1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Add a singlefile target to build one concatenated file

This commit is contained in:
Gregory Jordan 2013-12-19 08:18:47 -07:00
parent f2b717c637
commit 1838ec0427
2 changed files with 64 additions and 9 deletions

View file

@ -545,6 +545,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
// all requirements to run parts of pdf.js in a web worker.
// Right now, the requirement is, that an Uint8Array is still an Uint8Array
// as it arrives on the worker. Chrome added this with version 15.
//#if !SINGLE_FILE
if (!globalScope.PDFJS.disableWorker && typeof Worker !== 'undefined') {
var workerSrc = PDFJS.workerSrc;
if (!workerSrc) {
@ -591,6 +592,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
info('The worker has been disabled.');
}
}
//#endif
// Either workers are disabled, not supported or have thrown an exception.
// Thus, we fallback to a faked worker.
globalScope.PDFJS.disableWorker = true;
@ -619,7 +621,11 @@ var WorkerTransport = (function WorkerTransportClosure() {
// pdf.worker.js file is needed.
//#if !PRODUCTION
Util.loadScript(PDFJS.workerSrc);
//#else
//#endif
//#if PRODUCTION && SINGLE_FILE
// PDFJS.fakeWorkerFilesLoadedPromise.resolve();
//#endif
//#if PRODUCTION && !SINGLE_FILE
// Util.loadScript(PDFJS.workerSrc, function() {
// PDFJS.fakeWorkerFilesLoadedPromise.resolve();
// });