From: notmasteryet Date: Sat, 29 Oct 2011 21:00:13 +0000 (-0500) Subject: Fixing 'compatibility.js' load order; add Object.keys emulation X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0912959503cc566af7ac04f0d277931fb6647dea;p=pdf.js.git Fixing 'compatibility.js' load order; add Object.keys emulation --- diff --git a/web/compatibility.js b/web/compatibility.js index ad4c8f8..7d1d725 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 f7a5378..0c6ab38 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -3,6 +3,7 @@ Simple pdf.js page viewer + @@ -25,7 +26,6 @@ -