Bug 1358335 - Update pdf.js to version 1.8.243. r=bdahl

This commit is contained in:
Ryan VanderMeulen 2017-04-20 22:02:35 -04:00
parent 1345634886
commit 2e10aa4902
6 changed files with 36 additions and 23 deletions

View File

@ -1,3 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.8.229
Current extension version is: 1.8.243

View File

@ -90,7 +90,7 @@ var PdfjsChromeUtils = {
this._mmg.addMessageListener("PDFJS:Parent:removeEventListener", this);
this._mmg.addMessageListener("PDFJS:Parent:updateControlState", this);
// observer to handle shutdown
// Observer to handle shutdown.
Services.obs.addObserver(this, "quit-application");
}
},

View File

@ -45,6 +45,7 @@ var PdfjsContentUtils = {
this._mm = Cc["@mozilla.org/childprocessmessagemanager;1"].
getService(Ci.nsISyncMessageSender);
this._mm.addMessageListener("PDFJS:Child:refreshSettings", this);
Services.obs.addObserver(this, "quit-application");
}
},

View File

@ -961,12 +961,12 @@ var createBlob = function createBlob(data, contentType) {
if (typeof Blob !== 'undefined') {
return new Blob([data], { type: contentType });
}
warn('The "Blob" constructor is not supported.');
throw new Error('The "Blob" constructor is not supported.');
};
var createObjectURL = function createObjectURLClosure() {
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
return function createObjectURL(data, contentType, forceDataSchema) {
if (!forceDataSchema && typeof URL !== 'undefined' && URL.createObjectURL) {
return function createObjectURL(data, contentType, forceDataSchema = false) {
if (!forceDataSchema) {
var blob = createBlob(data, contentType);
return URL.createObjectURL(blob);
}
@ -3391,8 +3391,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.229';
exports.build = build = '5ad3611c';
exports.version = version = '1.8.243';
exports.build = build = '96cb599e';
}
exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport;
@ -4394,8 +4394,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.229';
PDFJS.build = '5ad3611c';
PDFJS.version = '1.8.243';
PDFJS.build = '96cb599e';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -6709,8 +6709,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.229';
var pdfjsBuild = '5ad3611c';
var pdfjsVersion = '1.8.243';
var pdfjsBuild = '96cb599e';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
var pdfjsDisplayAPI = __w_pdfjs_require__(3);

View File

@ -961,12 +961,12 @@ var createBlob = function createBlob(data, contentType) {
if (typeof Blob !== 'undefined') {
return new Blob([data], { type: contentType });
}
warn('The "Blob" constructor is not supported.');
throw new Error('The "Blob" constructor is not supported.');
};
var createObjectURL = function createObjectURLClosure() {
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
return function createObjectURL(data, contentType, forceDataSchema) {
if (!forceDataSchema && typeof URL !== 'undefined' && URL.createObjectURL) {
return function createObjectURL(data, contentType, forceDataSchema = false) {
if (!forceDataSchema) {
var blob = createBlob(data, contentType);
return URL.createObjectURL(blob);
}
@ -36565,8 +36565,8 @@ exports.Type1Parser = Type1Parser;
"use strict";
var pdfjsVersion = '1.8.229';
var pdfjsBuild = '5ad3611c';
var pdfjsVersion = '1.8.243';
var pdfjsBuild = '96cb599e';
var pdfjsCoreWorker = __w_pdfjs_require__(17);
;
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

View File

@ -315,9 +315,18 @@ function getVisibleElements(scrollEl, views, sortByVisibility) {
function noContextMenuHandler(e) {
e.preventDefault();
}
function getPDFFileNameFromURL(url, defaultFilename) {
if (typeof defaultFilename === 'undefined') {
defaultFilename = 'document.pdf';
function isDataSchema(url) {
var i = 0,
ii = url.length;
while (i < ii && url[i].trim() === '') {
i++;
}
return url.substr(i, 5).toLowerCase() === 'data:';
}
function getPDFFileNameFromURL(url, defaultFilename = 'document.pdf') {
if (isDataSchema(url)) {
console.warn('getPDFFileNameFromURL: ' + 'ignoring "data:" URL for performance reasons.');
return defaultFilename;
}
var reURI = /^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;
var reFilename = /[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
@ -3869,11 +3878,14 @@ var PDFAttachmentViewer = function PDFAttachmentViewerClosure() {
});
this._renderedCapability.resolve();
},
_bindPdfLink: function PDFAttachmentViewer_bindPdfLink(button, content, filename) {
_bindPdfLink(button, content, filename) {
if (_pdfjs.PDFJS.disableCreateObjectURL) {
throw new Error('bindPdfLink: ' + 'Unsupported "PDFJS.disableCreateObjectURL" value.');
}
var blobUrl;
button.onclick = function () {
if (!blobUrl) {
blobUrl = (0, _pdfjs.createObjectURL)(content, 'application/pdf', _pdfjs.PDFJS.disableCreateObjectURL);
blobUrl = (0, _pdfjs.createObjectURL)(content, 'application/pdf');
}
var viewerUrl;
viewerUrl = blobUrl + '?' + encodeURIComponent(filename);
@ -3911,7 +3923,7 @@ var PDFAttachmentViewer = function PDFAttachmentViewerClosure() {
div.className = 'attachmentsItem';
var button = document.createElement('button');
button.textContent = filename;
if (/\.pdf$/i.test(filename)) {
if (/\.pdf$/i.test(filename) && !_pdfjs.PDFJS.disableCreateObjectURL) {
this._bindPdfLink(button, item.content, filename);
} else {
this._bindLink(button, item.content, filename);
@ -7630,7 +7642,7 @@ var pdfjsWebApp;
pdfjsWebApp = __webpack_require__(4);
}
{
window.FirefoxCom = __webpack_require__(10).FirefoxCom;
__webpack_require__(10);
__webpack_require__(9);
}
;