diff --git a/bower.json b/bower.json index e9c36055c..2a879d7d3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.435", + "version": "1.0.437", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 706e0d331..d8bb4cb78 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.435'; -PDFJS.build = 'cd79ac8'; +PDFJS.version = '1.0.437'; +PDFJS.build = 'b482393'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.js b/build/pdf.js index c34497b01..b25441e26 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.435'; -PDFJS.build = 'cd79ac8'; +PDFJS.version = '1.0.437'; +PDFJS.build = 'b482393'; (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 98f03cfe0..68ceb65ce 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.435'; -PDFJS.build = 'cd79ac8'; +PDFJS.version = '1.0.437'; +PDFJS.build = 'b482393'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/package.json b/package.json index 24c064a62..fe863cb1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.435", + "version": "1.0.437", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/compatibility.js b/web/compatibility.js index 400a940eb..3bb437780 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -481,9 +481,9 @@ if (typeof PDFJS === 'undefined') { } })(); -// TODO CanvasPixelArray is deprecated; use Uint8ClampedArray -// once it's supported. +// Support: IE<11, Chrome<21 (function checkSetPresenceInImageData() { + // IE < 11 will use window.CanvasPixelArray which lacks set function. if (window.CanvasPixelArray) { if (typeof window.CanvasPixelArray.prototype.set !== 'function') { window.CanvasPixelArray.prototype.set = function(arr) { @@ -492,6 +492,25 @@ if (typeof PDFJS === 'undefined') { } }; } + } else { + // Chrome < 21 uses an inaccessible CanvasPixelArray prototype. + // Because we cannot feature detect it, we rely on user agent. + if (navigator.userAgent.indexOf('Chrom') >= 0) { + var versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); + if (versionMatch && parseInt(versionMatch[2]) < 21) { + var contextPrototype = window.CanvasRenderingContext2D.prototype; + contextPrototype._createImageData = contextPrototype.createImageData; + contextPrototype.createImageData = function(w, h) { + var imageData = this._createImageData(w, h); + imageData.data.set = function(arr) { + for (var i = 0, ii = this.length; i < ii; i++) { + this[i] = arr[i]; + } + }; + return imageData; + }; + } + } } })();