Additional check in globalScope detections

This commit is contained in:
Yury Delendik 2017-06-12 10:14:46 -05:00
parent 08c6437196
commit db7a770542
2 changed files with 8 additions and 6 deletions

View File

@ -21,9 +21,10 @@ if ((typeof PDFJSDev === 'undefined' ||
!PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) && !PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) &&
(typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked)) { (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked)) {
var globalScope = (typeof window !== 'undefined') ? window : var globalScope =
(typeof global !== 'undefined') ? global : (typeof window !== 'undefined' && window.Math === Math) ? window :
(typeof self !== 'undefined') ? self : this; (typeof global !== 'undefined' && global.Math === Math) ? global :
(typeof self !== 'undefined' && self.Math === Math) ? self : this;
var userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || ''; var userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || '';
var isAndroid = /Android/.test(userAgent); var isAndroid = /Android/.test(userAgent);

View File

@ -17,9 +17,10 @@
import './compatibility'; import './compatibility';
import { ReadableStream } from '../../external/streams/streams-lib'; import { ReadableStream } from '../../external/streams/streams-lib';
var globalScope = (typeof window !== 'undefined') ? window : var globalScope =
(typeof global !== 'undefined') ? global : (typeof window !== 'undefined' && window.Math === Math) ? window :
(typeof self !== 'undefined') ? self : this; (typeof global !== 'undefined' && global.Math === Math) ? global :
(typeof self !== 'undefined' && self.Math === Math) ? self : this;
var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];