1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28:06 +02:00

Add the new preprocessor.

This commit is contained in:
Brendan Dahl 2012-08-01 11:29:13 -07:00
parent 6d35073a9c
commit 492fa6edb4
6 changed files with 431 additions and 315 deletions

View file

@ -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;

View file

@ -7,9 +7,13 @@ var PDFJS = {};
// Use strict in our context only - users might not want it
'use strict';
PDFJS.build = 'PDFJSSCRIPT_BUNDLE_VER';
PDFJS.build =
//#if !BUNDLE_VERSION
'PDFJSSCRIPT_BUNDLE_VER';
//#else
//#expand '__BUNDLE_VERSION__';
//#endif
// Files are inserted below - see Makefile
/* PDFJSSCRIPT_INCLUDE_ALL */
//#expand __BUNDLE__
}).call((typeof window === 'undefined') ? this : window);