Skip to content

Commit 5c261b4

Browse files
committed
Merge branch 'refs/heads/master' into text-select
Conflicts: src/fonts.js
2 parents baf395a + 4bdc252 commit 5c261b4

File tree

10 files changed

+760
-526
lines changed

10 files changed

+760
-526
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using the pdf.js API.
2929

3030
### Extension
3131

32-
A up-to-date Firefox extension is also available:
32+
An up-to-date Firefox extension is also available:
3333

3434
+ http://mozilla.github.com/pdf.js/extensions/firefox/pdf.js.xpi
3535

extensions/firefox/components/pdfContentHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pdfContentHandler.prototype = {
5252
}
5353

5454
let targetUrl = aRequest.URI.spec;
55-
if (targetUrl.indexOf('?pdfjs.action=download') >= 0)
55+
if (targetUrl.indexOf('#pdfjs.action=download') >= 0)
5656
throw NS_ERROR_WONT_HANDLE_CONTENT;
5757

5858
aRequest.cancel(Cr.NS_BINDING_ABORTED);

extensions/firefox/install.rdf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Description>
1313
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
1414
<em:minVersion>6.0</em:minVersion>
15-
<em:maxVersion>10.0.*</em:maxVersion>
15+
<em:maxVersion>11.0.*</em:maxVersion>
1616
</Description>
1717
</em:targetApplication>
1818
<em:bootstrap>true</em:bootstrap>

src/canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ var CanvasGraphics = (function canvasGraphics() {
549549
this.save();
550550
ctx.scale(fontSize, fontSize);
551551
ctx.transform.apply(ctx, fontMatrix);
552-
this.executeIRQueue(glyph.IRQueue);
552+
this.executeIRQueue(glyph.codeIRQueue);
553553
this.restore();
554554

555555
var transformed = Util.applyTransform([glyph.width, 0], fontMatrix);

src/core.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ if (!globalScope.PDFJS) {
1515
globalScope.PDFJS = {};
1616
}
1717

18-
// Temporarily disabling workers until 'localhost' FF bugfix lands:
19-
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
20-
globalScope.PDFJS.disableWorker = true;
21-
2218
// getPdf()
2319
// Convenience function to perform binary Ajax GET
2420
// Usage: getPdf('http://...', callback)
@@ -473,6 +469,7 @@ var PDFDoc = (function pdfDoc() {
473469
this.objs = new PDFObjects();
474470

475471
this.pageCache = [];
472+
this.fontsLoading = {};
476473
this.workerReadyPromise = new Promise('workerReady');
477474

478475
// If worker support isn't disabled explicit and the browser has worker
@@ -486,7 +483,16 @@ var PDFDoc = (function pdfDoc() {
486483
throw 'No PDFJS.workerSrc specified';
487484
}
488485

489-
var worker = new Worker(workerSrc);
486+
var worker;
487+
try {
488+
worker = new Worker(workerSrc);
489+
} catch (e) {
490+
// Some versions of FF can't create a worker on localhost, see:
491+
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
492+
globalScope.PDFJS.disableWorker = true;
493+
this.setupFakeWorker();
494+
return;
495+
}
490496

491497
var messageHandler = new MessageHandler('main', worker);
492498

@@ -507,8 +513,6 @@ var PDFDoc = (function pdfDoc() {
507513
} else {
508514
this.setupFakeWorker();
509515
}
510-
511-
this.fontsLoading = {};
512516
}
513517

514518
constructor.prototype = {

0 commit comments

Comments
 (0)