Merge pull request #728 from notmasteryet/tree-36
Fixing 'compatibility.js' load order; add Object.keys emulation
This commit is contained in:
commit
6bf65979d4
@ -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;
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<title>Simple pdf.js page viewer</title>
|
||||
<link rel="stylesheet" href="viewer.css"/>
|
||||
<script type="text/javascript" src="compatibility.js"></script>
|
||||
|
||||
<!-- PDFJSSCRIPT_INCLUDE_BUILD -->
|
||||
|
||||
@ -25,7 +26,6 @@
|
||||
<script type="text/javascript" src="../src/stream.js"></script> <!-- PDFJSSCRIPT_REMOVE -->
|
||||
<script type="text/javascript" src="../src/worker.js"></script> <!-- PDFJSSCRIPT_REMOVE -->
|
||||
|
||||
<script type="text/javascript" src="compatibility.js"></script>
|
||||
<script type="text/javascript" src="viewer.js"></script>
|
||||
</head>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user