mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Add the new preprocessor.
This commit is contained in:
parent
6d35073a9c
commit
492fa6edb4
6 changed files with 431 additions and 315 deletions
25
src/api.js
25
src/api.js
|
@ -430,19 +430,18 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||
|
||||
try {
|
||||
var worker;
|
||||
if (PDFJS.isFirefoxExtension) {
|
||||
// The firefox extension can't load the worker from the resource://
|
||||
// url so we have to inline the script and then use the blob loader.
|
||||
var bb = new MozBlobBuilder();
|
||||
bb.append(document.querySelector('#PDFJS_SCRIPT_TAG').textContent);
|
||||
var blobUrl = window.URL.createObjectURL(bb.getBlob());
|
||||
worker = new Worker(blobUrl);
|
||||
} else {
|
||||
// Some versions of FF can't create a worker on localhost, see:
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
|
||||
worker = new Worker(workerSrc);
|
||||
}
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
// Some versions of FF can't create a worker on localhost, see:
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
|
||||
worker = new Worker(workerSrc);
|
||||
//#else
|
||||
// // The firefox extension can't load the worker from the resource://
|
||||
// // url so we have to inline the script and then use the blob loader.
|
||||
// var bb = new MozBlobBuilder();
|
||||
// bb.append(document.querySelector('#PDFJS_SCRIPT_TAG').textContent);
|
||||
// var blobUrl = window.URL.createObjectURL(bb.getBlob());
|
||||
// worker = new Worker(blobUrl);
|
||||
//#endif
|
||||
var messageHandler = new MessageHandler('main', worker);
|
||||
this.messageHandler = messageHandler;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue