Browse Source

Fix bug in api.js whereby fake workers didn't load the worker code

PDFJS does not work on Windows Safari, due to the lack of support for workers passing typed arrays. At some point, the code to set up the fake worker so that things work on Safari seems to have become broken and nobody noticed - it was just calling setupFakeWorker() without actually calling loadFakeWorkerFiles(). With this patch, the PDFJS works again on Windows Safari.
Jon Ribbens 12 years ago
parent
commit
3ddb1720d9
  1. 5
      src/display/api.js

5
src/display/api.js

@ -494,12 +494,15 @@ var WorkerTransport = (function WorkerTransportClosure() { @@ -494,12 +494,15 @@ var WorkerTransport = (function WorkerTransportClosure() {
if (supportTypedArray) {
this.worker = worker;
this.setupMessageHandler(messageHandler);
workerInitializedPromise.resolve();
} else {
globalScope.PDFJS.disableWorker = true;
this.loadFakeWorkerFiles().then(function() {
this.setupFakeWorker();
}
workerInitializedPromise.resolve();
}.bind(this));
}
}.bind(this));
var testObj = new Uint8Array(1);
// Some versions of Opera throw a DATA_CLONE_ERR on

Loading…
Cancel
Save