1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Merge upstream and change test pdf file.

This commit is contained in:
Brendan Dahl 2011-11-22 10:39:26 -08:00
commit faa202df1e
24 changed files with 4306 additions and 635 deletions

View file

@ -15,10 +15,6 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {};
}
// Temporarily disabling workers until 'localhost' FF bugfix lands:
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
globalScope.PDFJS.disableWorker = true;
// getPdf()
// Convenience function to perform binary Ajax GET
// Usage: getPdf('http://...', callback)
@ -471,6 +467,7 @@ var PDFDoc = (function pdfDoc() {
this.objs = new PDFObjects();
this.pageCache = [];
this.fontsLoading = {};
this.workerReadyPromise = new Promise('workerReady');
// If worker support isn't disabled explicit and the browser has worker
@ -484,7 +481,16 @@ var PDFDoc = (function pdfDoc() {
throw 'No PDFJS.workerSrc specified';
}
var worker = new Worker(workerSrc);
var worker;
try {
worker = new Worker(workerSrc);
} catch (e) {
// Some versions of FF can't create a worker on localhost, see:
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
globalScope.PDFJS.disableWorker = true;
this.setupFakeWorker();
return;
}
var messageHandler = new MessageHandler('main', worker);
@ -505,8 +511,6 @@ var PDFDoc = (function pdfDoc() {
} else {
this.setupFakeWorker();
}
this.fontsLoading = {};
}
constructor.prototype = {