Fixing 'compatibility.js' load order; add Object.keys emulation
This commit is contained in:
parent
a7a6e41ec6
commit
0912959503
@ -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 ?
|
// No XMLHttpRequest.response ?
|
||||||
(function checkXMLHttpRequestResponseCompatibility() {
|
(function checkXMLHttpRequestResponseCompatibility() {
|
||||||
var xhrPrototype = XMLHttpRequest.prototype;
|
var xhrPrototype = XMLHttpRequest.prototype;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Simple pdf.js page viewer</title>
|
<title>Simple pdf.js page viewer</title>
|
||||||
<link rel="stylesheet" href="viewer.css"/>
|
<link rel="stylesheet" href="viewer.css"/>
|
||||||
|
<script type="text/javascript" src="compatibility.js"></script>
|
||||||
|
|
||||||
<!-- PDFJSSCRIPT_INCLUDE_BUILD -->
|
<!-- PDFJSSCRIPT_INCLUDE_BUILD -->
|
||||||
|
|
||||||
@ -25,7 +26,6 @@
|
|||||||
<script type="text/javascript" src="../src/stream.js"></script> <!-- PDFJSSCRIPT_REMOVE -->
|
<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="../src/worker.js"></script> <!-- PDFJSSCRIPT_REMOVE -->
|
||||||
|
|
||||||
<script type="text/javascript" src="compatibility.js"></script>
|
|
||||||
<script type="text/javascript" src="viewer.js"></script>
|
<script type="text/javascript" src="viewer.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user