diff --git a/web/compatibility.js b/web/compatibility.js index ad4c8f8a9..7d1d72553 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -83,6 +83,21 @@ }; })(); +// Object.keys() ? +(function checkObjectKeysCompatibility() { + if (typeof Object.keys !== 'undefined') + return; + + Object.keys = function objectKeys(obj) { + var result = []; + for (var i in obj) { + if (obj.hasOwnProperty(i)) + result.push(i); + } + return result; + }; +})(); + // No XMLHttpRequest.response ? (function checkXMLHttpRequestResponseCompatibility() { var xhrPrototype = XMLHttpRequest.prototype; diff --git a/web/viewer.html b/web/viewer.html index f7a5378ed..0c6ab385e 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -3,6 +3,7 @@ Simple pdf.js page viewer + @@ -25,7 +26,6 @@ -