native-fn 1.0.81 → 1.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -1
- package/dist/native.cjs +4 -10
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +4 -10
- package/dist/native.umd.js +4 -10
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +189 -224
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +189 -224
- package/dist/plugin/app/index.umd.js +189 -224
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/app/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/app/src/utils/request.d.ts +1 -0
- package/dist/plugin/appearance/index.cjs +165 -222
- package/dist/plugin/appearance/index.d.ts +2 -8
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +165 -222
- package/dist/plugin/appearance/index.umd.js +165 -222
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/appearance/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
- package/dist/plugin/clipboard/index.cjs +148 -183
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +148 -183
- package/dist/plugin/clipboard/index.umd.js +148 -183
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/clipboard/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +947 -0
- package/dist/plugin/dimension/index.d.ts +36 -0
- package/dist/plugin/dimension/index.min.cjs +1 -0
- package/dist/plugin/dimension/index.min.mjs +1 -0
- package/dist/plugin/dimension/index.mjs +945 -0
- package/dist/plugin/dimension/index.umd.js +953 -0
- package/dist/plugin/dimension/index.umd.min.js +1 -0
- package/dist/plugin/dimension/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +6 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +43 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +27 -0
- package/dist/plugin/dimension/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +4 -0
- package/dist/plugin/dimension/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/dimension/src/types/index.d.ts +1 -0
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/types/native.d.ts +27 -0
- package/dist/plugin/dimension/src/utils/assign.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/create-custom-error.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/dimension/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +156 -188
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +156 -188
- package/dist/plugin/fullscreen/index.umd.js +156 -188
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +137 -172
- package/dist/plugin/platform/index.d.ts +8 -19
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +137 -172
- package/dist/plugin/platform/index.umd.js +137 -172
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/platform/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/platform/src/utils/request.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +138 -173
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +138 -173
- package/dist/plugin/theme/index.umd.js +138 -173
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/plugin/theme/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/theme/src/utils/request.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +1 -7
- package/dist/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/src/plugin/dimension/index.d.ts +4 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +11 -0
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +5 -10
- package/dist/src/plugin/platform/types/platform.d.ts +7 -18
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +15 -15
|
@@ -26,7 +26,7 @@ function createCustomError(name, Base) {
|
|
|
26
26
|
else
|
|
27
27
|
error.__proto__ = CustomError.prototype;
|
|
28
28
|
error.name = name;
|
|
29
|
-
if (message !== undefined)
|
|
29
|
+
if (typeof message !== 'undefined')
|
|
30
30
|
error.message = message;
|
|
31
31
|
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
32
32
|
try {
|
|
@@ -209,7 +209,7 @@ function capitalize(_) {
|
|
|
209
209
|
var result = '';
|
|
210
210
|
for (var i = 0; i < groups.length - 2; i++) {
|
|
211
211
|
var arg = groups[i];
|
|
212
|
-
if (arg !== undefined)
|
|
212
|
+
if (typeof arg !== 'undefined')
|
|
213
213
|
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
214
214
|
}
|
|
215
215
|
return result;
|
|
@@ -233,7 +233,7 @@ var EventListenerUtils = {
|
|
|
233
233
|
add: function (target, eventListenerOptions) {
|
|
234
234
|
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
235
235
|
var callback = eventListenerOptions.callback;
|
|
236
|
-
if (target === undefined || callback === null)
|
|
236
|
+
if (typeof target === 'undefined' || callback === null)
|
|
237
237
|
return;
|
|
238
238
|
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
239
239
|
var options = eventListenerOptions.options;
|
|
@@ -261,9 +261,9 @@ var EventListenerUtils = {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
function wrapper(event) {
|
|
264
|
-
if (event === undefined)
|
|
264
|
+
if (typeof event === 'undefined')
|
|
265
265
|
event = globalThis.event;
|
|
266
|
-
if (event === undefined)
|
|
266
|
+
if (typeof event === 'undefined')
|
|
267
267
|
return;
|
|
268
268
|
event.currentTarget = target;
|
|
269
269
|
if (typeof event.preventDefault !== 'function')
|
|
@@ -284,7 +284,7 @@ var EventListenerUtils = {
|
|
|
284
284
|
remove: function (target, eventListenerOptions) {
|
|
285
285
|
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
286
286
|
var callback = eventListenerOptions.callback;
|
|
287
|
-
if (target === undefined || callback === null)
|
|
287
|
+
if (typeof target === 'undefined' || callback === null)
|
|
288
288
|
return;
|
|
289
289
|
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
290
290
|
var options = eventListenerOptions.options;
|
|
@@ -313,7 +313,7 @@ var EventListenerUtils = {
|
|
|
313
313
|
}
|
|
314
314
|
if (typeof target.detachEvent === 'function') {
|
|
315
315
|
var wrapper = callback.__ieWrapper;
|
|
316
|
-
if (wrapper !== undefined) {
|
|
316
|
+
if (typeof wrapper !== 'undefined') {
|
|
317
317
|
target.detachEvent('on' + type, wrapper);
|
|
318
318
|
delete callback.__ieWrapper;
|
|
319
319
|
}
|
|
@@ -321,7 +321,7 @@ var EventListenerUtils = {
|
|
|
321
321
|
}
|
|
322
322
|
},
|
|
323
323
|
withVender: function (target, type) {
|
|
324
|
-
if (type === undefined)
|
|
324
|
+
if (typeof type === 'undefined')
|
|
325
325
|
return '';
|
|
326
326
|
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
327
327
|
return type;
|
|
@@ -392,6 +392,14 @@ var CrossPlatformFramework;
|
|
|
392
392
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
393
393
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
394
394
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
395
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
396
|
+
'Google Chrome': 'Chrome',
|
|
397
|
+
'Microsoft Edge': 'Edge',
|
|
398
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
399
|
+
'Android WebView': 'Chrome WebView',
|
|
400
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
401
|
+
'OperaMobile': 'Opera Mobi',
|
|
402
|
+
};
|
|
395
403
|
|
|
396
404
|
var readyState = 'loading';
|
|
397
405
|
var readyCallback = [];
|
|
@@ -405,11 +413,8 @@ var Platform = {
|
|
|
405
413
|
get readyState() {
|
|
406
414
|
return readyState;
|
|
407
415
|
},
|
|
408
|
-
get
|
|
409
|
-
return
|
|
410
|
-
},
|
|
411
|
-
get dimension() {
|
|
412
|
-
return getDimension();
|
|
416
|
+
get locale() {
|
|
417
|
+
return getLocale();
|
|
413
418
|
},
|
|
414
419
|
get device() {
|
|
415
420
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
@@ -421,17 +426,11 @@ var Platform = {
|
|
|
421
426
|
get renderer() {
|
|
422
427
|
return getRenderer();
|
|
423
428
|
},
|
|
424
|
-
get isMobile() {
|
|
425
|
-
return this.device === Devices.Mobile;
|
|
426
|
-
},
|
|
427
|
-
get isDesktop() {
|
|
428
|
-
return this.device === Devices.Desktop;
|
|
429
|
-
},
|
|
430
429
|
get isWebview() {
|
|
431
430
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
432
431
|
},
|
|
433
432
|
get isNode() {
|
|
434
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
433
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
435
434
|
},
|
|
436
435
|
get isStandalone() {
|
|
437
436
|
if (this.os.name === OS.iOS)
|
|
@@ -453,6 +452,33 @@ var Platform = {
|
|
|
453
452
|
}
|
|
454
453
|
}
|
|
455
454
|
};
|
|
455
|
+
function resolveWindowsVersion(string) {
|
|
456
|
+
if (typeof string === 'undefined')
|
|
457
|
+
return '';
|
|
458
|
+
var mapped = {
|
|
459
|
+
'4.90': 'ME',
|
|
460
|
+
'NT3.51': 'NT 3.11',
|
|
461
|
+
'NT4.0': 'NT 4.0',
|
|
462
|
+
'NT 5.0': '2000',
|
|
463
|
+
'NT 5.1': 'XP',
|
|
464
|
+
'NT 5.2': 'XP',
|
|
465
|
+
'NT 6.0': 'Vista',
|
|
466
|
+
'NT 6.1': '7',
|
|
467
|
+
'NT 6.2': '8',
|
|
468
|
+
'NT 6.3': '8.1',
|
|
469
|
+
'NT 6.4': '10',
|
|
470
|
+
'NT 10.0': '10',
|
|
471
|
+
'ARM': 'RT'
|
|
472
|
+
}[string];
|
|
473
|
+
if (typeof mapped !== 'undefined')
|
|
474
|
+
return mapped;
|
|
475
|
+
return string;
|
|
476
|
+
}
|
|
477
|
+
function resolveUnderscoreVersion(string) {
|
|
478
|
+
if (typeof string === 'undefined')
|
|
479
|
+
return '';
|
|
480
|
+
return string.replace(/_/g, '.');
|
|
481
|
+
}
|
|
456
482
|
var OS_RESOLVER_MAP = [
|
|
457
483
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
458
484
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -511,14 +537,6 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
511
537
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
512
538
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
513
539
|
];
|
|
514
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
515
|
-
'Google Chrome': 'Chrome',
|
|
516
|
-
'Microsoft Edge': 'Edge',
|
|
517
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
518
|
-
'Android WebView': 'Chrome WebView',
|
|
519
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
520
|
-
'OperaMobile': 'Opera Mobi',
|
|
521
|
-
};
|
|
522
540
|
function incrementPendingTasks() {
|
|
523
541
|
pendingTasks++;
|
|
524
542
|
}
|
|
@@ -539,33 +557,6 @@ function checkReady() {
|
|
|
539
557
|
readyCallback.length = 0;
|
|
540
558
|
}
|
|
541
559
|
}
|
|
542
|
-
function resolveWindowsVersion(string) {
|
|
543
|
-
if (string === undefined)
|
|
544
|
-
return '';
|
|
545
|
-
var mapped = {
|
|
546
|
-
'4.90': 'ME',
|
|
547
|
-
'NT3.51': 'NT 3.11',
|
|
548
|
-
'NT4.0': 'NT 4.0',
|
|
549
|
-
'NT 5.0': '2000',
|
|
550
|
-
'NT 5.1': 'XP',
|
|
551
|
-
'NT 5.2': 'XP',
|
|
552
|
-
'NT 6.0': 'Vista',
|
|
553
|
-
'NT 6.1': '7',
|
|
554
|
-
'NT 6.2': '8',
|
|
555
|
-
'NT 6.3': '8.1',
|
|
556
|
-
'NT 6.4': '10',
|
|
557
|
-
'NT 10.0': '10',
|
|
558
|
-
'ARM': 'RT'
|
|
559
|
-
}[string];
|
|
560
|
-
if (mapped !== undefined)
|
|
561
|
-
return mapped;
|
|
562
|
-
return string;
|
|
563
|
-
}
|
|
564
|
-
function resolveUnderscoreVersion(string) {
|
|
565
|
-
if (string === undefined)
|
|
566
|
-
return '';
|
|
567
|
-
return string.replace(/_/g, '.');
|
|
568
|
-
}
|
|
569
560
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
570
561
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
571
562
|
return '11';
|
|
@@ -702,12 +693,12 @@ function resolveVersion(string, resolver) {
|
|
|
702
693
|
return resolver(string);
|
|
703
694
|
if (typeof resolver === 'string')
|
|
704
695
|
return resolver;
|
|
705
|
-
if (string === undefined)
|
|
696
|
+
if (typeof string === 'undefined')
|
|
706
697
|
return '';
|
|
707
698
|
return string;
|
|
708
699
|
}
|
|
709
700
|
function normalizeBrand(entry) {
|
|
710
|
-
if (entry === null || entry === undefined)
|
|
701
|
+
if (entry === null || typeof entry === 'undefined')
|
|
711
702
|
return { brand: '', version: '' };
|
|
712
703
|
if (typeof entry === 'string')
|
|
713
704
|
return { brand: entry, version: '' };
|
|
@@ -761,152 +752,127 @@ function getRenderer() {
|
|
|
761
752
|
return '';
|
|
762
753
|
}
|
|
763
754
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
755
|
+
function normalizeLocale(locale) {
|
|
756
|
+
if (locale === null || typeof locale === 'undefined')
|
|
757
|
+
return locale;
|
|
758
|
+
if (locale.length === 0)
|
|
759
|
+
return null;
|
|
760
|
+
locale = locale.replace(/_/g, '-');
|
|
761
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
762
|
+
return 'en-US';
|
|
763
|
+
if (locale.indexOf('.') !== -1)
|
|
764
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
765
|
+
if (locale.indexOf('@') !== -1)
|
|
766
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
767
|
+
var parts = locale.split('-');
|
|
768
|
+
if (parts.length === 0)
|
|
769
|
+
return null;
|
|
770
|
+
parts[0] = parts[0].toLowerCase();
|
|
771
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
772
|
+
parts[1] = parts[1].toUpperCase();
|
|
773
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
774
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
775
|
+
return parts.join('-');
|
|
776
|
+
}
|
|
777
|
+
function getLocale() {
|
|
778
|
+
var locale = {
|
|
779
|
+
language: null,
|
|
780
|
+
languages: [],
|
|
781
|
+
timezone: null,
|
|
782
|
+
timezoneOffset: 0,
|
|
772
783
|
};
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
777
|
-
if (typeof connection !== 'undefined') {
|
|
778
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
779
|
-
network.effectiveType = connection.effectiveType;
|
|
780
|
-
if (typeof connection.type !== 'undefined')
|
|
781
|
-
network.type = connection.type;
|
|
782
|
-
if (typeof connection.downlink !== 'undefined')
|
|
783
|
-
network.downlink = connection.downlink;
|
|
784
|
-
if (typeof connection.rtt !== 'undefined')
|
|
785
|
-
network.rtt = connection.rtt;
|
|
786
|
-
if (typeof connection.saveData !== 'undefined')
|
|
787
|
-
network.saveData = connection.saveData;
|
|
788
|
-
return network;
|
|
789
|
-
}
|
|
784
|
+
function addLanguages(language) {
|
|
785
|
+
for (var i = 0; i < language.length; i++)
|
|
786
|
+
addLanguage(language[i]);
|
|
790
787
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
var name_1 = networkInterfaceNames[i];
|
|
798
|
-
var networkInterface = networkInterfaces[name_1];
|
|
799
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
800
|
-
var address = networkInterface[j];
|
|
801
|
-
if (!address.internal && address.family === 'IPv4')
|
|
802
|
-
network.isOnline = true;
|
|
803
|
-
}
|
|
804
|
-
if (network.isOnline)
|
|
805
|
-
break;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
catch (_) {
|
|
788
|
+
function addLanguage(language) {
|
|
789
|
+
language = normalizeLocale(language);
|
|
790
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
791
|
+
if (locale.language === null)
|
|
792
|
+
locale.language = language;
|
|
793
|
+
locale.languages.push(language);
|
|
809
794
|
}
|
|
795
|
+
}
|
|
796
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
810
797
|
try {
|
|
811
|
-
var
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
}
|
|
826
|
-
catch (_) {
|
|
798
|
+
var reactNative = require('react-native');
|
|
799
|
+
var nativeModules = reactNative.NativeModules;
|
|
800
|
+
if (typeof nativeModules.SettingsManager !== 'undefined') {
|
|
801
|
+
var settingManager = nativeModules.SettingsManager;
|
|
802
|
+
if (typeof settingManager !== 'undefined') {
|
|
803
|
+
var constant = typeof settingManager.getConstants === 'function'
|
|
804
|
+
? settingManager.getConstants()
|
|
805
|
+
: settingManager;
|
|
806
|
+
if (typeof constant !== 'undefined' && typeof constant.settings !== 'undefined') {
|
|
807
|
+
var settings = constant.settings;
|
|
808
|
+
if (typeof settings.AppleLocale === 'string')
|
|
809
|
+
addLanguage(settings.AppleLocale);
|
|
810
|
+
if (Array.isArray(settings.AppleLanguages) && settings.AppleLanguages.length > 0)
|
|
811
|
+
addLanguages(settings.AppleLanguages);
|
|
827
812
|
}
|
|
828
813
|
}
|
|
829
|
-
if (network.type === null)
|
|
830
|
-
network.type = 'other';
|
|
831
814
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
var
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
else
|
|
841
|
-
network.type = 'other';
|
|
842
|
-
}
|
|
843
|
-
catch (_) {
|
|
844
|
-
network.type = 'other';
|
|
815
|
+
if (typeof nativeModules.I18nManager !== 'undefined') {
|
|
816
|
+
var i18nManager = nativeModules.I18nManager;
|
|
817
|
+
if (typeof i18nManager !== 'undefined') {
|
|
818
|
+
var constant = typeof i18nManager.getConstants === 'function'
|
|
819
|
+
? i18nManager.getConstants()
|
|
820
|
+
: i18nManager;
|
|
821
|
+
if (typeof constant !== 'undefined' && typeof constant.localeIdentifier !== 'undefined')
|
|
822
|
+
addLanguage(constant.localeIdentifier);
|
|
845
823
|
}
|
|
846
824
|
}
|
|
847
825
|
}
|
|
848
826
|
catch (_) {
|
|
849
827
|
}
|
|
850
828
|
}
|
|
851
|
-
|
|
852
|
-
}
|
|
853
|
-
function getDimension() {
|
|
854
|
-
var dimension = {
|
|
855
|
-
innerWidth: -1,
|
|
856
|
-
innerHeight: -1,
|
|
857
|
-
outerWidth: -1,
|
|
858
|
-
outerHeight: -1,
|
|
859
|
-
scale: 1,
|
|
860
|
-
};
|
|
861
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
862
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
863
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
864
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
865
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
866
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
867
|
-
return dimension;
|
|
868
|
-
}
|
|
869
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
829
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
870
830
|
try {
|
|
871
|
-
var
|
|
872
|
-
var
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
dimension.outerHeight = windowDimensions.height;
|
|
880
|
-
dimension.scale = pixelRatio.get();
|
|
881
|
-
return dimension;
|
|
831
|
+
var electron = require('electron');
|
|
832
|
+
var app = electron.app;
|
|
833
|
+
if (typeof app.getLocale !== 'undefined')
|
|
834
|
+
addLanguage(app.getLocale());
|
|
835
|
+
if (typeof app.getSystemLocale !== 'undefined')
|
|
836
|
+
addLanguage(app.getSystemLocale());
|
|
837
|
+
if (typeof app.getPreferredSystemLanguages !== 'undefined')
|
|
838
|
+
addLanguages(app.getPreferredSystemLanguages());
|
|
882
839
|
}
|
|
883
840
|
catch (_) {
|
|
884
841
|
}
|
|
885
842
|
}
|
|
886
|
-
if (
|
|
843
|
+
if (typeof Intl !== 'undefined') {
|
|
887
844
|
try {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
var size = focusedWindow.getSize();
|
|
895
|
-
dimension.innerWidth = contentSize[0];
|
|
896
|
-
dimension.innerHeight = contentSize[1];
|
|
897
|
-
dimension.outerWidth = size[0];
|
|
898
|
-
dimension.outerHeight = size[1];
|
|
899
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
900
|
-
}
|
|
901
|
-
return dimension;
|
|
845
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
846
|
+
}
|
|
847
|
+
catch (_) {
|
|
848
|
+
}
|
|
849
|
+
try {
|
|
850
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
902
851
|
}
|
|
903
852
|
catch (_) {
|
|
904
853
|
}
|
|
905
854
|
}
|
|
906
|
-
|
|
855
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
856
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
857
|
+
addLanguages(globalThis.navigator.languages);
|
|
858
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
859
|
+
addLanguage(globalThis.navigator.language);
|
|
860
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
861
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
862
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
863
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
864
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
865
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
866
|
+
}
|
|
867
|
+
try {
|
|
868
|
+
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
869
|
+
}
|
|
870
|
+
catch (_) {
|
|
871
|
+
}
|
|
872
|
+
return locale;
|
|
907
873
|
}
|
|
908
874
|
function init() {
|
|
909
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
875
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
910
876
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
911
877
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
912
878
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -1102,8 +1068,7 @@ function init() {
|
|
|
1102
1068
|
finally {
|
|
1103
1069
|
decrementPendingTasks();
|
|
1104
1070
|
}
|
|
1105
|
-
})
|
|
1106
|
-
.catch(decrementPendingTasks);
|
|
1071
|
+
});
|
|
1107
1072
|
}
|
|
1108
1073
|
checkReady();
|
|
1109
1074
|
}
|
|
@@ -1126,15 +1091,15 @@ function getTrackId(bundle) {
|
|
|
1126
1091
|
if (xhr.status === 200) {
|
|
1127
1092
|
try {
|
|
1128
1093
|
var response = JSON.parse(xhr.response);
|
|
1129
|
-
if (response.results === undefined)
|
|
1094
|
+
if (typeof response.results === 'undefined')
|
|
1130
1095
|
return undefined;
|
|
1131
1096
|
var results = response.results;
|
|
1132
|
-
if (
|
|
1097
|
+
if (results.length === 0)
|
|
1133
1098
|
return undefined;
|
|
1134
1099
|
var result = results[0];
|
|
1135
|
-
if (result === undefined)
|
|
1100
|
+
if (typeof result === 'undefined')
|
|
1136
1101
|
return undefined;
|
|
1137
|
-
return result.trackId;
|
|
1102
|
+
return "" + result.trackId;
|
|
1138
1103
|
}
|
|
1139
1104
|
catch (_) {
|
|
1140
1105
|
return undefined;
|
|
@@ -1151,17 +1116,17 @@ function createIntentURL(scheme, packageName, fallback) {
|
|
|
1151
1116
|
var prefix = split[0];
|
|
1152
1117
|
var suffix = split[1];
|
|
1153
1118
|
var intent = 'intent://';
|
|
1154
|
-
if (suffix !== undefined)
|
|
1119
|
+
if (typeof suffix !== 'undefined')
|
|
1155
1120
|
intent = intent + suffix;
|
|
1156
1121
|
intent = intent + '#Intent;'
|
|
1157
1122
|
+ 'scheme=' + prefix + ';'
|
|
1158
1123
|
+ 'action=android.intent.action.VIEW;'
|
|
1159
1124
|
+ 'category=android.intent.category.BROWSABLE;';
|
|
1160
|
-
if (packageName !== undefined)
|
|
1125
|
+
if (typeof packageName !== 'undefined')
|
|
1161
1126
|
intent = intent + 'package=' + packageName + ';';
|
|
1162
|
-
if (fallback !== undefined && typeof fallback === 'string')
|
|
1127
|
+
if (typeof fallback !== 'undefined' && typeof fallback === 'string')
|
|
1163
1128
|
intent = intent + 'S.browser_fallback_url=' + fallback + ';';
|
|
1164
|
-
else if (packageName !== undefined)
|
|
1129
|
+
else if (typeof packageName !== 'undefined')
|
|
1165
1130
|
intent = intent + 'S.browser_fallback_url=' + createAppStoreURL(packageName, OS.Android) + ';';
|
|
1166
1131
|
return intent + 'end';
|
|
1167
1132
|
}
|
|
@@ -1179,16 +1144,16 @@ function parseIntentURL(intent) {
|
|
|
1179
1144
|
if (index !== -1)
|
|
1180
1145
|
extras[part.substring(0, index)] = part.substring(index + 1);
|
|
1181
1146
|
}
|
|
1182
|
-
if (extras['scheme'] !== undefined)
|
|
1147
|
+
if (typeof extras['scheme'] !== 'undefined')
|
|
1183
1148
|
parsed.scheme = (extras['scheme'] + '://' + host);
|
|
1184
|
-
if (extras['package'] !== undefined)
|
|
1149
|
+
if (typeof extras['package'] !== 'undefined')
|
|
1185
1150
|
parsed.packageName = extras['package'];
|
|
1186
|
-
if (extras['S.browser_fallback_url'] !== undefined)
|
|
1151
|
+
if (typeof extras['S.browser_fallback_url'] !== 'undefined')
|
|
1187
1152
|
parsed.fallback = extras['S.browser_fallback_url'];
|
|
1188
1153
|
return parsed;
|
|
1189
1154
|
}
|
|
1190
1155
|
function createAppStoreURL(packageName, os) {
|
|
1191
|
-
if (packageName === undefined)
|
|
1156
|
+
if (typeof packageName === 'undefined')
|
|
1192
1157
|
return undefined;
|
|
1193
1158
|
switch (os) {
|
|
1194
1159
|
case OS.Android:
|
|
@@ -1204,7 +1169,7 @@ function createAppStoreURL(packageName, os) {
|
|
|
1204
1169
|
}
|
|
1205
1170
|
}
|
|
1206
1171
|
function createWebStoreURL(packageName, os) {
|
|
1207
|
-
if (packageName === undefined)
|
|
1172
|
+
if (typeof packageName === 'undefined')
|
|
1208
1173
|
return undefined;
|
|
1209
1174
|
switch (os) {
|
|
1210
1175
|
case OS.Android:
|
|
@@ -1269,7 +1234,7 @@ function openURLViaHref(url, index) {
|
|
|
1269
1234
|
return;
|
|
1270
1235
|
}
|
|
1271
1236
|
a = createHiddenElement('a');
|
|
1272
|
-
if (a === undefined)
|
|
1237
|
+
if (typeof a === 'undefined')
|
|
1273
1238
|
return;
|
|
1274
1239
|
a.href = url;
|
|
1275
1240
|
topDocument.body.appendChild(a);
|
|
@@ -1279,7 +1244,7 @@ function openURLViaHref(url, index) {
|
|
|
1279
1244
|
catch (_) {
|
|
1280
1245
|
}
|
|
1281
1246
|
finally {
|
|
1282
|
-
if (a !== undefined) {
|
|
1247
|
+
if (typeof a !== 'undefined') {
|
|
1283
1248
|
try {
|
|
1284
1249
|
topDocument.body.removeChild(a);
|
|
1285
1250
|
}
|
|
@@ -1294,12 +1259,12 @@ function openURLViaIframe(url) {
|
|
|
1294
1259
|
var iframe = undefined;
|
|
1295
1260
|
try {
|
|
1296
1261
|
iframe = createHiddenElement('iframe');
|
|
1297
|
-
if (iframe === undefined)
|
|
1262
|
+
if (typeof iframe === 'undefined')
|
|
1298
1263
|
return;
|
|
1299
1264
|
iframe.src = url;
|
|
1300
1265
|
topDocument.body.appendChild(iframe);
|
|
1301
1266
|
globalThis.setTimeout(function () {
|
|
1302
|
-
if (iframe !== undefined) {
|
|
1267
|
+
if (typeof iframe !== 'undefined') {
|
|
1303
1268
|
try {
|
|
1304
1269
|
topDocument.body.removeChild(iframe);
|
|
1305
1270
|
}
|
|
@@ -1323,13 +1288,13 @@ function isDocumentHidden() {
|
|
|
1323
1288
|
return true;
|
|
1324
1289
|
if (topDocument.msVisibilityState === 'hidden')
|
|
1325
1290
|
return true;
|
|
1326
|
-
if (topDocument.hidden !== undefined)
|
|
1291
|
+
if (typeof topDocument.hidden !== 'undefined')
|
|
1327
1292
|
return topDocument.hidden;
|
|
1328
|
-
if (topDocument.webkitHidden !== undefined)
|
|
1293
|
+
if (typeof topDocument.webkitHidden !== 'undefined')
|
|
1329
1294
|
return topDocument.webkitHidden;
|
|
1330
|
-
if (topDocument.mozHidden !== undefined)
|
|
1295
|
+
if (typeof topDocument.mozHidden !== 'undefined')
|
|
1331
1296
|
return topDocument.mozHidden;
|
|
1332
|
-
if (topDocument.msHidden !== undefined)
|
|
1297
|
+
if (typeof topDocument.msHidden !== 'undefined')
|
|
1333
1298
|
return topDocument.msHidden;
|
|
1334
1299
|
if (typeof topDocument.hasFocus === 'function')
|
|
1335
1300
|
return !topDocument.hasFocus();
|
|
@@ -1366,7 +1331,7 @@ function restoreFocus() {
|
|
|
1366
1331
|
var input = undefined;
|
|
1367
1332
|
try {
|
|
1368
1333
|
input = createHiddenElement('input');
|
|
1369
|
-
if (input === undefined)
|
|
1334
|
+
if (typeof input === 'undefined')
|
|
1370
1335
|
return false;
|
|
1371
1336
|
input.type = 'text';
|
|
1372
1337
|
input.readOnly = true;
|
|
@@ -1383,7 +1348,7 @@ function restoreFocus() {
|
|
|
1383
1348
|
catch (_) {
|
|
1384
1349
|
}
|
|
1385
1350
|
finally {
|
|
1386
|
-
if (input !== undefined) {
|
|
1351
|
+
if (typeof input !== 'undefined') {
|
|
1387
1352
|
try {
|
|
1388
1353
|
input.blur();
|
|
1389
1354
|
}
|
|
@@ -1473,7 +1438,7 @@ function tryOpenURL(url, index, timeout) {
|
|
|
1473
1438
|
var timeoutId;
|
|
1474
1439
|
var resolved = false;
|
|
1475
1440
|
function cleanup() {
|
|
1476
|
-
if (timeoutId !== undefined) {
|
|
1441
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1477
1442
|
clearTimeout(timeoutId);
|
|
1478
1443
|
timeoutId = undefined;
|
|
1479
1444
|
}
|
|
@@ -1484,14 +1449,14 @@ function tryOpenURL(url, index, timeout) {
|
|
|
1484
1449
|
}
|
|
1485
1450
|
catch (_) {
|
|
1486
1451
|
}
|
|
1487
|
-
if (a !== undefined) {
|
|
1452
|
+
if (typeof a !== 'undefined') {
|
|
1488
1453
|
try {
|
|
1489
1454
|
topDocument.body.removeChild(a);
|
|
1490
1455
|
}
|
|
1491
1456
|
catch (_) {
|
|
1492
1457
|
}
|
|
1493
1458
|
}
|
|
1494
|
-
if (iframe !== undefined) {
|
|
1459
|
+
if (typeof iframe !== 'undefined') {
|
|
1495
1460
|
try {
|
|
1496
1461
|
topDocument.body.removeChild(iframe);
|
|
1497
1462
|
}
|
|
@@ -1515,7 +1480,7 @@ function tryOpenURL(url, index, timeout) {
|
|
|
1515
1480
|
}
|
|
1516
1481
|
}
|
|
1517
1482
|
function onBlur() {
|
|
1518
|
-
if (timeoutId !== undefined) {
|
|
1483
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1519
1484
|
clearTimeout(timeoutId);
|
|
1520
1485
|
timeoutId = undefined;
|
|
1521
1486
|
}
|
|
@@ -1558,7 +1523,7 @@ function open(options) {
|
|
|
1558
1523
|
var timeout;
|
|
1559
1524
|
if (Platform.os.name === OS.Android) {
|
|
1560
1525
|
var option = options[OS.Android] || options['android'];
|
|
1561
|
-
if (option === undefined)
|
|
1526
|
+
if (typeof option === 'undefined')
|
|
1562
1527
|
return Promise.reject(getURLOpenError(tried));
|
|
1563
1528
|
timeout = option.timeout;
|
|
1564
1529
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1569,21 +1534,21 @@ function open(options) {
|
|
|
1569
1534
|
infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
|
|
1570
1535
|
infos.allowAppStore = option.allowAppStore;
|
|
1571
1536
|
infos.allowWebStore = option.allowWebStore;
|
|
1572
|
-
if (infos.intent !== undefined && (infos.scheme === undefined || infos.packageName === undefined || infos.fallback === undefined)) {
|
|
1537
|
+
if (typeof infos.intent !== 'undefined' && (typeof infos.scheme === 'undefined' || typeof infos.packageName === 'undefined' || typeof infos.fallback === 'undefined')) {
|
|
1573
1538
|
var parsed = parseIntentURL(infos.intent);
|
|
1574
|
-
if (parsed.scheme !== undefined && infos.scheme === undefined)
|
|
1539
|
+
if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
|
|
1575
1540
|
infos.scheme = parsed.scheme;
|
|
1576
|
-
if (parsed.packageName !== undefined && infos.packageName === undefined)
|
|
1541
|
+
if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
|
|
1577
1542
|
infos.packageName = parsed.packageName;
|
|
1578
|
-
if (parsed.fallback !== undefined && infos.fallback === undefined)
|
|
1543
|
+
if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
|
|
1579
1544
|
infos.fallback = parsed.fallback;
|
|
1580
1545
|
}
|
|
1581
|
-
if (infos.scheme !== undefined && infos.intent === undefined)
|
|
1546
|
+
if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
|
|
1582
1547
|
infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
|
|
1583
1548
|
}
|
|
1584
1549
|
else if (Platform.os.name === OS.iOS) {
|
|
1585
1550
|
var option = options[OS.iOS] || options['ios'];
|
|
1586
|
-
if (option === undefined)
|
|
1551
|
+
if (typeof option === 'undefined')
|
|
1587
1552
|
return Promise.reject(getURLOpenError(tried));
|
|
1588
1553
|
timeout = option.timeout;
|
|
1589
1554
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1595,12 +1560,12 @@ function open(options) {
|
|
|
1595
1560
|
infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
|
|
1596
1561
|
infos.allowAppStore = option.allowAppStore;
|
|
1597
1562
|
infos.allowWebStore = option.allowWebStore;
|
|
1598
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1563
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1599
1564
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1600
1565
|
}
|
|
1601
1566
|
else if (Platform.os.name === OS.Windows) {
|
|
1602
1567
|
var option = options[OS.Windows] || options['windows'];
|
|
1603
|
-
if (option === undefined)
|
|
1568
|
+
if (typeof option === 'undefined')
|
|
1604
1569
|
return Promise.reject(getURLOpenError(tried));
|
|
1605
1570
|
timeout = option.timeout;
|
|
1606
1571
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1613,7 +1578,7 @@ function open(options) {
|
|
|
1613
1578
|
}
|
|
1614
1579
|
else if (Platform.os.name === OS.MacOS) {
|
|
1615
1580
|
var option = options[OS.MacOS] || options['mac'];
|
|
1616
|
-
if (option === undefined)
|
|
1581
|
+
if (typeof option === 'undefined')
|
|
1617
1582
|
return Promise.reject(getURLOpenError(tried));
|
|
1618
1583
|
timeout = option.timeout;
|
|
1619
1584
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1624,7 +1589,7 @@ function open(options) {
|
|
|
1624
1589
|
infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
|
|
1625
1590
|
infos.allowAppStore = option.allowAppStore;
|
|
1626
1591
|
infos.allowWebStore = option.allowWebStore;
|
|
1627
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1592
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1628
1593
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1629
1594
|
}
|
|
1630
1595
|
pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
|
|
@@ -1633,7 +1598,7 @@ function open(options) {
|
|
|
1633
1598
|
pushURL(urls, infos.fallback, AppOpenState.Fallback);
|
|
1634
1599
|
pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
|
|
1635
1600
|
pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
|
|
1636
|
-
if (timeout === undefined)
|
|
1601
|
+
if (typeof timeout === 'undefined')
|
|
1637
1602
|
timeout = getDefaultTimeoutByOS(os);
|
|
1638
1603
|
return new Promise(function (resolve, reject) {
|
|
1639
1604
|
function openURLSequential(index) {
|
|
@@ -1774,15 +1739,15 @@ function normalize(value) {
|
|
|
1774
1739
|
var key = keys[i];
|
|
1775
1740
|
result[key] = stringifiableToString(value[key]);
|
|
1776
1741
|
}
|
|
1777
|
-
if (result.to === undefined)
|
|
1742
|
+
if (typeof result.to === 'undefined')
|
|
1778
1743
|
result.to = '';
|
|
1779
|
-
if (result.cc === undefined)
|
|
1744
|
+
if (typeof result.cc === 'undefined')
|
|
1780
1745
|
result.cc = '';
|
|
1781
|
-
if (result.bcc === undefined)
|
|
1746
|
+
if (typeof result.bcc === 'undefined')
|
|
1782
1747
|
result.bcc = '';
|
|
1783
|
-
if (result.subject === undefined)
|
|
1748
|
+
if (typeof result.subject === 'undefined')
|
|
1784
1749
|
result.subject = '';
|
|
1785
|
-
if (result.body === undefined)
|
|
1750
|
+
if (typeof result.body === 'undefined')
|
|
1786
1751
|
result.body = '';
|
|
1787
1752
|
return result;
|
|
1788
1753
|
}
|