Explicitly state intended support in compatibility.js
Add comments with supported browser versions where missing. Method: - Use MDN compat tables if available. - Otherwise test in Chrome (31+) otherwise. (the Chrome Web Store does not update older versions of Chrome, so probably nobody is interested in even older versions, even though there is an existing comment for Chrome<29 at `document.currentScript`).
This commit is contained in:
parent
628e70fbb5
commit
44025a3ec1
@ -75,6 +75,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
// Checks if navigator.language is supported
|
// Checks if navigator.language is supported
|
||||||
|
// Support: IE<11
|
||||||
(function checkNavigatorLanguage() {
|
(function checkNavigatorLanguage() {
|
||||||
if (typeof navigator === 'undefined') {
|
if (typeof navigator === 'undefined') {
|
||||||
return;
|
return;
|
||||||
@ -151,7 +152,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
// Provides support for Object.values in legacy browsers.
|
// Provides support for Object.values in legacy browsers.
|
||||||
// Support: IE.
|
// Support: IE, Chrome<54
|
||||||
(function checkObjectValues() {
|
(function checkObjectValues() {
|
||||||
if (Object.values) {
|
if (Object.values) {
|
||||||
return;
|
return;
|
||||||
@ -160,7 +161,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
// Provides support for Array.prototype.includes in legacy browsers.
|
// Provides support for Array.prototype.includes in legacy browsers.
|
||||||
// Support: IE.
|
// Support: IE, Chrome<47
|
||||||
(function checkArrayIncludes() {
|
(function checkArrayIncludes() {
|
||||||
if (Array.prototype.includes) {
|
if (Array.prototype.includes) {
|
||||||
return;
|
return;
|
||||||
@ -169,7 +170,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
// Provides support for Math.log2 in legacy browsers.
|
// Provides support for Math.log2 in legacy browsers.
|
||||||
// Support: IE.
|
// Support: IE, Chrome<38
|
||||||
(function checkMathLog2() {
|
(function checkMathLog2() {
|
||||||
if (Math.log2) {
|
if (Math.log2) {
|
||||||
return;
|
return;
|
||||||
@ -187,7 +188,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
// Provides support for Number.isInteger in legacy browsers.
|
// Provides support for Number.isInteger in legacy browsers.
|
||||||
// Support: IE.
|
// Support: IE, Chrome<34
|
||||||
(function checkNumberIsInteger() {
|
(function checkNumberIsInteger() {
|
||||||
if (Number.isInteger) {
|
if (Number.isInteger) {
|
||||||
return;
|
return;
|
||||||
@ -195,6 +196,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
Number.isInteger = require('core-js/fn/number/is-integer');
|
Number.isInteger = require('core-js/fn/number/is-integer');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// Support: IE, Safari<8, Chrome<32
|
||||||
(function checkPromise() {
|
(function checkPromise() {
|
||||||
if (globalScope.Promise) {
|
if (globalScope.Promise) {
|
||||||
return;
|
return;
|
||||||
@ -202,6 +204,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
globalScope.Promise = require('core-js/fn/promise');
|
globalScope.Promise = require('core-js/fn/promise');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// Support: IE<11, Safari<8, Chrome<36
|
||||||
(function checkWeakMap() {
|
(function checkWeakMap() {
|
||||||
if (globalScope.WeakMap) {
|
if (globalScope.WeakMap) {
|
||||||
return;
|
return;
|
||||||
@ -209,6 +212,7 @@ PDFJS.compatibilityChecked = true;
|
|||||||
globalScope.WeakMap = require('core-js/fn/weak-map');
|
globalScope.WeakMap = require('core-js/fn/weak-map');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// Support: IE, Chrome<32
|
||||||
// Polyfill from https://github.com/Polymer/URL
|
// Polyfill from https://github.com/Polymer/URL
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user