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

Merge pull request #4025 from gjuggler/singlefile

Add singlefile build target
This commit is contained in:
Yury Delendik 2013-12-20 05:44:40 -08:00
commit cfb4e95521
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();
// });