Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix PDFJS MIME type detection
Browse files Browse the repository at this point in the history
This reverts the old workaround for pdfjs returning status code 0 errors,
which was causing PDF MIME type detection to stop working in cases
where the URL is loaded directly instead of by navigation. A webview
reload seems to always get rid of the PDF status code 0 error.

This includes a merge of PDFJS latest master, but the fix commit is only
diracdeltas/pdf.js@6c18572

Fix #2633
Fix #2654
Fixes the session tab part of #2568

Auditors: @bbondy
  • Loading branch information
diracdeltas committed Jul 25, 2016
1 parent 776489b commit 611f617
Show file tree
Hide file tree
Showing 17 changed files with 255 additions and 202 deletions.
16 changes: 8 additions & 8 deletions app/extensions/pdfjs/content/build/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it
'use strict';

var pdfjsVersion = '1.5.340';
var pdfjsBuild = 'bc86419';
var pdfjsVersion = '1.5.361';
var pdfjsBuild = '452c06e';

var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ?
Expand Down Expand Up @@ -1080,7 +1080,7 @@ function isSpace(ch) {
*
* @typedef {Object} PromiseCapability
* @property {Promise} promise - A promise object.
* @property {function} resolve - Fullfills the promise.
* @property {function} resolve - Fulfills the promise.
* @property {function} reject - Rejects the promise.
*/

Expand All @@ -1103,8 +1103,8 @@ function createPromiseCapability() {
/**
* Polyfill for Promises:
* The following promise implementation tries to generally implement the
* Promise/A+ spec. Some notable differences from other promise libaries are:
* - There currently isn't a seperate deferred and promise object.
* Promise/A+ spec. Some notable differences from other promise libraries are:
* - There currently isn't a separate deferred and promise object.
* - Unhandled rejections eventually show an error if they aren't handled.
*
* Based off of the work in:
Expand Down Expand Up @@ -1285,7 +1285,7 @@ function createPromiseCapability() {
* Builds a promise that is resolved when all the passed in promises are
* resolved.
* @param {array} promises array of data and/or promises to wait for.
* @return {Promise} New dependant promise.
* @return {Promise} New dependent promise.
*/
Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll;
Expand Down Expand Up @@ -4712,7 +4712,7 @@ var createMeshCanvas = (function createMeshCanvasClosure() {
// MAX_PATTERN_SIZE is used to avoid OOM situation.
var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough
// We need to keep transparent border around our pattern for fill():
// createPattern with 'no-repeat' will bleed edges accross entire area.
// createPattern with 'no-repeat' will bleed edges across entire area.
var BORDER_SIZE = 2;

var offsetX = Math.floor(bounds[0]);
Expand Down Expand Up @@ -6785,7 +6785,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var currentCtx = this.ctx;
// TODO non-isolated groups - according to Rik at adobe non-isolated
// group results aren't usually that different and they even have tools
// that ignore this setting. Notes from Rik on implmenting:
// that ignore this setting. Notes from Rik on implementing:
// - When you encounter an transparency group, create a new canvas with
// the dimensions of the bbox
// - copy the content from the previous canvas to the new canvas
Expand Down
Loading

1 comment on commit 611f617

@bbondy
Copy link
Member

@bbondy bbondy commented on 611f617 Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.