diff --git a/bower.json b/bower.json index 8c318eb92..bfdb5c20d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.281", + "version": "1.0.284", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index bac3c62a4..e416adbd3 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.281'; -PDFJS.build = 'c7c1639'; +PDFJS.version = '1.0.284'; +PDFJS.build = '5ded0ea'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -6893,8 +6893,7 @@ var NetworkManager = (function NetworkManagerClosure() { } function getArrayBuffer(xhr) { - var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse || - xhr.responseArrayBuffer || xhr.response); + var data = xhr.response; if (typeof data !== 'string') { return data; } @@ -6946,7 +6945,7 @@ var NetworkManager = (function NetworkManagerClosure() { pendingRequest.expectedStatus = 200; } - xhr.mozResponseType = xhr.responseType = 'arraybuffer'; + xhr.responseType = 'arraybuffer'; if (args.onProgress) { xhr.onprogress = args.onProgress; @@ -43785,20 +43784,6 @@ var JpxImage = (function JpxImageClosure() { this.failOnCorruptedImage = false; } JpxImage.prototype = { - load: function JpxImage_load(url) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = (function() { - // TODO catch parse error - var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer); - this.parse(data); - if (this.onload) { - this.onload(); - } - }).bind(this); - xhr.send(null); - }, parse: function JpxImage_parse(data) { var head = readUint16(data, 0); diff --git a/build/pdf.js b/build/pdf.js index bf4b584e0..d3f9c6c1e 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.281'; -PDFJS.build = 'c7c1639'; +PDFJS.version = '1.0.284'; +PDFJS.build = '5ded0ea'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 615fd613e..84ea90db8 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.281'; -PDFJS.build = 'c7c1639'; +PDFJS.version = '1.0.284'; +PDFJS.build = '5ded0ea'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -2386,8 +2386,7 @@ var NetworkManager = (function NetworkManagerClosure() { } function getArrayBuffer(xhr) { - var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse || - xhr.responseArrayBuffer || xhr.response); + var data = xhr.response; if (typeof data !== 'string') { return data; } @@ -2439,7 +2438,7 @@ var NetworkManager = (function NetworkManagerClosure() { pendingRequest.expectedStatus = 200; } - xhr.mozResponseType = xhr.responseType = 'arraybuffer'; + xhr.responseType = 'arraybuffer'; if (args.onProgress) { xhr.onprogress = args.onProgress; @@ -39278,20 +39277,6 @@ var JpxImage = (function JpxImageClosure() { this.failOnCorruptedImage = false; } JpxImage.prototype = { - load: function JpxImage_load(url) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = (function() { - // TODO catch parse error - var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer); - this.parse(data); - if (this.onload) { - this.onload(); - } - }).bind(this); - xhr.send(null); - }, parse: function JpxImage_parse(data) { var head = readUint16(data, 0); diff --git a/package.json b/package.json index 8b7680a33..19965036e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.281", + "version": "1.0.284", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/compatibility.js b/web/compatibility.js index 07d26d3ed..c39162cbf 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -160,9 +160,13 @@ if (typeof PDFJS === 'undefined') { value: function xmlHttpRequestOverrideMimeType(mimeType) {} }); } - if ('response' in xhr || 'responseArrayBuffer' in xhr) { + if ('responseType' in xhr) { return; } + + // The worker will be using XHR, so we can save time and disable worker. + PDFJS.disableWorker = true; + // Support: IE9 if (typeof VBArray !== 'undefined') { Object.defineProperty(xhrPrototype, 'response', { @@ -189,7 +193,7 @@ if (typeof PDFJS === 'undefined') { for (i = 0; i < n; ++i) { result[i] = text.charCodeAt(i) & 0xFF; } - return result; + return result.buffer; } Object.defineProperty(xhrPrototype, 'response', { get: responseGetter }); })();