native-fn 1.0.82 → 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 +102 -255
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +102 -255
- package/dist/plugin/app/index.umd.js +102 -255
- 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 +0 -6
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +55 -208
- package/dist/plugin/appearance/index.d.ts +1 -7
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +55 -208
- package/dist/plugin/appearance/index.umd.js +55 -208
- 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 +0 -6
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +61 -214
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +61 -214
- package/dist/plugin/clipboard/index.umd.js +61 -214
- 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 +0 -6
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +935 -1
- package/dist/plugin/dimension/index.d.ts +9 -0
- package/dist/plugin/dimension/index.min.cjs +1 -1
- package/dist/plugin/dimension/index.min.mjs +1 -1
- package/dist/plugin/dimension/index.mjs +935 -1
- package/dist/plugin/dimension/index.umd.js +935 -1
- package/dist/plugin/dimension/index.umd.min.js +1 -1
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +54 -207
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +54 -207
- package/dist/plugin/fullscreen/index.umd.js +54 -207
- 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 +0 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +50 -203
- package/dist/plugin/platform/index.d.ts +4 -20
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +50 -203
- package/dist/plugin/platform/index.umd.js +50 -203
- 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 +0 -6
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +51 -204
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +51 -204
- package/dist/plugin/theme/index.umd.js +51 -204
- 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 +0 -6
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
- 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 +0 -6
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
else
|
|
31
31
|
error.__proto__ = CustomError.prototype;
|
|
32
32
|
error.name = name;
|
|
33
|
-
if (message !== undefined)
|
|
33
|
+
if (typeof message !== 'undefined')
|
|
34
34
|
error.message = message;
|
|
35
35
|
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
36
36
|
try {
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
var result = '';
|
|
214
214
|
for (var i = 0; i < groups.length - 2; i++) {
|
|
215
215
|
var arg = groups[i];
|
|
216
|
-
if (arg !== undefined)
|
|
216
|
+
if (typeof arg !== 'undefined')
|
|
217
217
|
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
218
218
|
}
|
|
219
219
|
return result;
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
add: function (target, eventListenerOptions) {
|
|
238
238
|
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
239
239
|
var callback = eventListenerOptions.callback;
|
|
240
|
-
if (target === undefined || callback === null)
|
|
240
|
+
if (typeof target === 'undefined' || callback === null)
|
|
241
241
|
return;
|
|
242
242
|
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
243
243
|
var options = eventListenerOptions.options;
|
|
@@ -265,9 +265,9 @@
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
function wrapper(event) {
|
|
268
|
-
if (event === undefined)
|
|
268
|
+
if (typeof event === 'undefined')
|
|
269
269
|
event = globalThis.event;
|
|
270
|
-
if (event === undefined)
|
|
270
|
+
if (typeof event === 'undefined')
|
|
271
271
|
return;
|
|
272
272
|
event.currentTarget = target;
|
|
273
273
|
if (typeof event.preventDefault !== 'function')
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
remove: function (target, eventListenerOptions) {
|
|
289
289
|
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
290
290
|
var callback = eventListenerOptions.callback;
|
|
291
|
-
if (target === undefined || callback === null)
|
|
291
|
+
if (typeof target === 'undefined' || callback === null)
|
|
292
292
|
return;
|
|
293
293
|
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
294
294
|
var options = eventListenerOptions.options;
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
}
|
|
318
318
|
if (typeof target.detachEvent === 'function') {
|
|
319
319
|
var wrapper = callback.__ieWrapper;
|
|
320
|
-
if (wrapper !== undefined) {
|
|
320
|
+
if (typeof wrapper !== 'undefined') {
|
|
321
321
|
target.detachEvent('on' + type, wrapper);
|
|
322
322
|
delete callback.__ieWrapper;
|
|
323
323
|
}
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
}
|
|
326
326
|
},
|
|
327
327
|
withVender: function (target, type) {
|
|
328
|
-
if (type === undefined)
|
|
328
|
+
if (typeof type === 'undefined')
|
|
329
329
|
return '';
|
|
330
330
|
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
331
331
|
return type;
|
|
@@ -396,6 +396,14 @@
|
|
|
396
396
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
397
397
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
398
398
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
399
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
400
|
+
'Google Chrome': 'Chrome',
|
|
401
|
+
'Microsoft Edge': 'Edge',
|
|
402
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
403
|
+
'Android WebView': 'Chrome WebView',
|
|
404
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
405
|
+
'OperaMobile': 'Opera Mobi',
|
|
406
|
+
};
|
|
399
407
|
|
|
400
408
|
var readyState = 'loading';
|
|
401
409
|
var readyCallback = [];
|
|
@@ -409,15 +417,9 @@
|
|
|
409
417
|
get readyState() {
|
|
410
418
|
return readyState;
|
|
411
419
|
},
|
|
412
|
-
get network() {
|
|
413
|
-
return getNetwork();
|
|
414
|
-
},
|
|
415
420
|
get locale() {
|
|
416
421
|
return getLocale();
|
|
417
422
|
},
|
|
418
|
-
get dimension() {
|
|
419
|
-
return getDimension();
|
|
420
|
-
},
|
|
421
423
|
get device() {
|
|
422
424
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
423
425
|
return Devices.Mobile;
|
|
@@ -432,7 +434,7 @@
|
|
|
432
434
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
433
435
|
},
|
|
434
436
|
get isNode() {
|
|
435
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
437
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
436
438
|
},
|
|
437
439
|
get isStandalone() {
|
|
438
440
|
if (this.os.name === OS.iOS)
|
|
@@ -454,6 +456,33 @@
|
|
|
454
456
|
}
|
|
455
457
|
}
|
|
456
458
|
};
|
|
459
|
+
function resolveWindowsVersion(string) {
|
|
460
|
+
if (typeof string === 'undefined')
|
|
461
|
+
return '';
|
|
462
|
+
var mapped = {
|
|
463
|
+
'4.90': 'ME',
|
|
464
|
+
'NT3.51': 'NT 3.11',
|
|
465
|
+
'NT4.0': 'NT 4.0',
|
|
466
|
+
'NT 5.0': '2000',
|
|
467
|
+
'NT 5.1': 'XP',
|
|
468
|
+
'NT 5.2': 'XP',
|
|
469
|
+
'NT 6.0': 'Vista',
|
|
470
|
+
'NT 6.1': '7',
|
|
471
|
+
'NT 6.2': '8',
|
|
472
|
+
'NT 6.3': '8.1',
|
|
473
|
+
'NT 6.4': '10',
|
|
474
|
+
'NT 10.0': '10',
|
|
475
|
+
'ARM': 'RT'
|
|
476
|
+
}[string];
|
|
477
|
+
if (typeof mapped !== 'undefined')
|
|
478
|
+
return mapped;
|
|
479
|
+
return string;
|
|
480
|
+
}
|
|
481
|
+
function resolveUnderscoreVersion(string) {
|
|
482
|
+
if (typeof string === 'undefined')
|
|
483
|
+
return '';
|
|
484
|
+
return string.replace(/_/g, '.');
|
|
485
|
+
}
|
|
457
486
|
var OS_RESOLVER_MAP = [
|
|
458
487
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
459
488
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -512,14 +541,6 @@
|
|
|
512
541
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
513
542
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
514
543
|
];
|
|
515
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
516
|
-
'Google Chrome': 'Chrome',
|
|
517
|
-
'Microsoft Edge': 'Edge',
|
|
518
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
519
|
-
'Android WebView': 'Chrome WebView',
|
|
520
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
521
|
-
'OperaMobile': 'Opera Mobi',
|
|
522
|
-
};
|
|
523
544
|
function incrementPendingTasks() {
|
|
524
545
|
pendingTasks++;
|
|
525
546
|
}
|
|
@@ -540,33 +561,6 @@
|
|
|
540
561
|
readyCallback.length = 0;
|
|
541
562
|
}
|
|
542
563
|
}
|
|
543
|
-
function resolveWindowsVersion(string) {
|
|
544
|
-
if (string === undefined)
|
|
545
|
-
return '';
|
|
546
|
-
var mapped = {
|
|
547
|
-
'4.90': 'ME',
|
|
548
|
-
'NT3.51': 'NT 3.11',
|
|
549
|
-
'NT4.0': 'NT 4.0',
|
|
550
|
-
'NT 5.0': '2000',
|
|
551
|
-
'NT 5.1': 'XP',
|
|
552
|
-
'NT 5.2': 'XP',
|
|
553
|
-
'NT 6.0': 'Vista',
|
|
554
|
-
'NT 6.1': '7',
|
|
555
|
-
'NT 6.2': '8',
|
|
556
|
-
'NT 6.3': '8.1',
|
|
557
|
-
'NT 6.4': '10',
|
|
558
|
-
'NT 10.0': '10',
|
|
559
|
-
'ARM': 'RT'
|
|
560
|
-
}[string];
|
|
561
|
-
if (mapped !== undefined)
|
|
562
|
-
return mapped;
|
|
563
|
-
return string;
|
|
564
|
-
}
|
|
565
|
-
function resolveUnderscoreVersion(string) {
|
|
566
|
-
if (string === undefined)
|
|
567
|
-
return '';
|
|
568
|
-
return string.replace(/_/g, '.');
|
|
569
|
-
}
|
|
570
564
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
571
565
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
572
566
|
return '11';
|
|
@@ -703,12 +697,12 @@
|
|
|
703
697
|
return resolver(string);
|
|
704
698
|
if (typeof resolver === 'string')
|
|
705
699
|
return resolver;
|
|
706
|
-
if (string === undefined)
|
|
700
|
+
if (typeof string === 'undefined')
|
|
707
701
|
return '';
|
|
708
702
|
return string;
|
|
709
703
|
}
|
|
710
704
|
function normalizeBrand(entry) {
|
|
711
|
-
if (entry === null || entry === undefined)
|
|
705
|
+
if (entry === null || typeof entry === 'undefined')
|
|
712
706
|
return { brand: '', version: '' };
|
|
713
707
|
if (typeof entry === 'string')
|
|
714
708
|
return { brand: entry, version: '' };
|
|
@@ -762,102 +756,13 @@
|
|
|
762
756
|
return '';
|
|
763
757
|
}
|
|
764
758
|
}
|
|
765
|
-
function getNetwork() {
|
|
766
|
-
var network = {
|
|
767
|
-
isOnline: null,
|
|
768
|
-
effectiveType: null,
|
|
769
|
-
type: null,
|
|
770
|
-
downlink: null,
|
|
771
|
-
rtt: null,
|
|
772
|
-
saveData: null,
|
|
773
|
-
};
|
|
774
|
-
if (typeof globalThis.navigator !== 'undefined') {
|
|
775
|
-
if (typeof globalThis.navigator.onLine !== 'undefined')
|
|
776
|
-
network.isOnline = globalThis.navigator.onLine;
|
|
777
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
778
|
-
if (typeof connection !== 'undefined') {
|
|
779
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
780
|
-
network.effectiveType = connection.effectiveType;
|
|
781
|
-
if (typeof connection.type !== 'undefined')
|
|
782
|
-
network.type = connection.type;
|
|
783
|
-
if (typeof connection.downlink !== 'undefined')
|
|
784
|
-
network.downlink = connection.downlink;
|
|
785
|
-
if (typeof connection.rtt !== 'undefined')
|
|
786
|
-
network.rtt = connection.rtt;
|
|
787
|
-
if (typeof connection.saveData !== 'undefined')
|
|
788
|
-
network.saveData = connection.saveData;
|
|
789
|
-
return network;
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
if (Platform.isNode) {
|
|
793
|
-
try {
|
|
794
|
-
var os = require('os');
|
|
795
|
-
var networkInterfaces = os.networkInterfaces();
|
|
796
|
-
var networkInterfaceNames = Object.keys(networkInterfaces);
|
|
797
|
-
for (var i = 0; i < networkInterfaceNames.length; i++) {
|
|
798
|
-
var name_1 = networkInterfaceNames[i];
|
|
799
|
-
var networkInterface = networkInterfaces[name_1];
|
|
800
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
801
|
-
var address = networkInterface[j];
|
|
802
|
-
if (!address.internal && address.family === 'IPv4')
|
|
803
|
-
network.isOnline = true;
|
|
804
|
-
}
|
|
805
|
-
if (network.isOnline)
|
|
806
|
-
break;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
catch (_) {
|
|
810
|
-
}
|
|
811
|
-
try {
|
|
812
|
-
var childProcess = require('child_process');
|
|
813
|
-
if (Platform.os.name === OS.Windows) {
|
|
814
|
-
try {
|
|
815
|
-
var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
|
|
816
|
-
if (output.includes('State') && output.includes('connected'))
|
|
817
|
-
network.type = 'wifi';
|
|
818
|
-
}
|
|
819
|
-
catch (_) {
|
|
820
|
-
}
|
|
821
|
-
if (network.type === null) {
|
|
822
|
-
try {
|
|
823
|
-
var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
|
|
824
|
-
if (output.includes('Ethernet adapter'))
|
|
825
|
-
network.type = 'ethernet';
|
|
826
|
-
}
|
|
827
|
-
catch (_) {
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
if (network.type === null)
|
|
831
|
-
network.type = 'other';
|
|
832
|
-
}
|
|
833
|
-
else if (Platform.os.name === OS.MacOS) {
|
|
834
|
-
try {
|
|
835
|
-
var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
|
|
836
|
-
var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
|
|
837
|
-
if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
|
|
838
|
-
network.type = 'wifi';
|
|
839
|
-
else if (activeInterface.includes('en') || output.includes('Ethernet'))
|
|
840
|
-
network.type = 'ethernet';
|
|
841
|
-
else
|
|
842
|
-
network.type = 'other';
|
|
843
|
-
}
|
|
844
|
-
catch (_) {
|
|
845
|
-
network.type = 'other';
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
catch (_) {
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
return network;
|
|
853
|
-
}
|
|
854
759
|
function normalizeLocale(locale) {
|
|
855
|
-
if (locale === null || locale === undefined)
|
|
760
|
+
if (locale === null || typeof locale === 'undefined')
|
|
856
761
|
return locale;
|
|
857
762
|
if (locale.length === 0)
|
|
858
763
|
return null;
|
|
859
764
|
locale = locale.replace(/_/g, '-');
|
|
860
|
-
if (locale === 'C' || locale === 'posix'
|
|
765
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
861
766
|
return 'en-US';
|
|
862
767
|
if (locale.indexOf('.') !== -1)
|
|
863
768
|
return normalizeLocale(locale.split('.')[0]);
|
|
@@ -875,9 +780,9 @@
|
|
|
875
780
|
}
|
|
876
781
|
function getLocale() {
|
|
877
782
|
var locale = {
|
|
878
|
-
language:
|
|
783
|
+
language: null,
|
|
879
784
|
languages: [],
|
|
880
|
-
timezone:
|
|
785
|
+
timezone: null,
|
|
881
786
|
timezoneOffset: 0,
|
|
882
787
|
};
|
|
883
788
|
function addLanguages(language) {
|
|
@@ -887,7 +792,7 @@
|
|
|
887
792
|
function addLanguage(language) {
|
|
888
793
|
language = normalizeLocale(language);
|
|
889
794
|
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
890
|
-
if (locale.language
|
|
795
|
+
if (locale.language === null)
|
|
891
796
|
locale.language = language;
|
|
892
797
|
locale.languages.push(language);
|
|
893
798
|
}
|
|
@@ -945,6 +850,11 @@
|
|
|
945
850
|
}
|
|
946
851
|
catch (_) {
|
|
947
852
|
}
|
|
853
|
+
try {
|
|
854
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
855
|
+
}
|
|
856
|
+
catch (_) {
|
|
857
|
+
}
|
|
948
858
|
}
|
|
949
859
|
if (typeof globalThis.navigator !== 'undefined') {
|
|
950
860
|
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
@@ -958,13 +868,6 @@
|
|
|
958
868
|
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
959
869
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
960
870
|
}
|
|
961
|
-
try {
|
|
962
|
-
if (typeof Intl !== 'undefined') {
|
|
963
|
-
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
catch (_) {
|
|
967
|
-
}
|
|
968
871
|
try {
|
|
969
872
|
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
970
873
|
}
|
|
@@ -972,63 +875,8 @@
|
|
|
972
875
|
}
|
|
973
876
|
return locale;
|
|
974
877
|
}
|
|
975
|
-
function getDimension() {
|
|
976
|
-
var dimension = {
|
|
977
|
-
innerWidth: -1,
|
|
978
|
-
innerHeight: -1,
|
|
979
|
-
outerWidth: -1,
|
|
980
|
-
outerHeight: -1,
|
|
981
|
-
scale: 1,
|
|
982
|
-
};
|
|
983
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
984
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
985
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
986
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
987
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
988
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
989
|
-
return dimension;
|
|
990
|
-
}
|
|
991
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
992
|
-
try {
|
|
993
|
-
var reactNative = require('react-native');
|
|
994
|
-
var dimensions = reactNative.Dimensions;
|
|
995
|
-
var pixelRatio = reactNative.PixelRatio;
|
|
996
|
-
var screenDimensions = dimensions.get('screen');
|
|
997
|
-
var windowDimensions = dimensions.get('window');
|
|
998
|
-
dimension.innerWidth = screenDimensions.width;
|
|
999
|
-
dimension.innerHeight = screenDimensions.height;
|
|
1000
|
-
dimension.outerWidth = windowDimensions.width;
|
|
1001
|
-
dimension.outerHeight = windowDimensions.height;
|
|
1002
|
-
dimension.scale = pixelRatio.get();
|
|
1003
|
-
return dimension;
|
|
1004
|
-
}
|
|
1005
|
-
catch (_) {
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
1009
|
-
try {
|
|
1010
|
-
var electron = require('electron');
|
|
1011
|
-
var screen_1 = electron.screen;
|
|
1012
|
-
var browserWindow = electron.BrowserWindow;
|
|
1013
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
1014
|
-
if (focusedWindow !== undefined) {
|
|
1015
|
-
var contentSize = focusedWindow.getContentSize();
|
|
1016
|
-
var size = focusedWindow.getSize();
|
|
1017
|
-
dimension.innerWidth = contentSize[0];
|
|
1018
|
-
dimension.innerHeight = contentSize[1];
|
|
1019
|
-
dimension.outerWidth = size[0];
|
|
1020
|
-
dimension.outerHeight = size[1];
|
|
1021
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
1022
|
-
}
|
|
1023
|
-
return dimension;
|
|
1024
|
-
}
|
|
1025
|
-
catch (_) {
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
return dimension;
|
|
1029
|
-
}
|
|
1030
878
|
function init() {
|
|
1031
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
879
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
1032
880
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
1033
881
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
1034
882
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -1224,8 +1072,7 @@
|
|
|
1224
1072
|
finally {
|
|
1225
1073
|
decrementPendingTasks();
|
|
1226
1074
|
}
|
|
1227
|
-
})
|
|
1228
|
-
.catch(decrementPendingTasks);
|
|
1075
|
+
});
|
|
1229
1076
|
}
|
|
1230
1077
|
checkReady();
|
|
1231
1078
|
}
|
|
@@ -1248,15 +1095,15 @@
|
|
|
1248
1095
|
if (xhr.status === 200) {
|
|
1249
1096
|
try {
|
|
1250
1097
|
var response = JSON.parse(xhr.response);
|
|
1251
|
-
if (response.results === undefined)
|
|
1098
|
+
if (typeof response.results === 'undefined')
|
|
1252
1099
|
return undefined;
|
|
1253
1100
|
var results = response.results;
|
|
1254
|
-
if (
|
|
1101
|
+
if (results.length === 0)
|
|
1255
1102
|
return undefined;
|
|
1256
1103
|
var result = results[0];
|
|
1257
|
-
if (result === undefined)
|
|
1104
|
+
if (typeof result === 'undefined')
|
|
1258
1105
|
return undefined;
|
|
1259
|
-
return result.trackId;
|
|
1106
|
+
return "" + result.trackId;
|
|
1260
1107
|
}
|
|
1261
1108
|
catch (_) {
|
|
1262
1109
|
return undefined;
|
|
@@ -1273,17 +1120,17 @@
|
|
|
1273
1120
|
var prefix = split[0];
|
|
1274
1121
|
var suffix = split[1];
|
|
1275
1122
|
var intent = 'intent://';
|
|
1276
|
-
if (suffix !== undefined)
|
|
1123
|
+
if (typeof suffix !== 'undefined')
|
|
1277
1124
|
intent = intent + suffix;
|
|
1278
1125
|
intent = intent + '#Intent;'
|
|
1279
1126
|
+ 'scheme=' + prefix + ';'
|
|
1280
1127
|
+ 'action=android.intent.action.VIEW;'
|
|
1281
1128
|
+ 'category=android.intent.category.BROWSABLE;';
|
|
1282
|
-
if (packageName !== undefined)
|
|
1129
|
+
if (typeof packageName !== 'undefined')
|
|
1283
1130
|
intent = intent + 'package=' + packageName + ';';
|
|
1284
|
-
if (fallback !== undefined && typeof fallback === 'string')
|
|
1131
|
+
if (typeof fallback !== 'undefined' && typeof fallback === 'string')
|
|
1285
1132
|
intent = intent + 'S.browser_fallback_url=' + fallback + ';';
|
|
1286
|
-
else if (packageName !== undefined)
|
|
1133
|
+
else if (typeof packageName !== 'undefined')
|
|
1287
1134
|
intent = intent + 'S.browser_fallback_url=' + createAppStoreURL(packageName, OS.Android) + ';';
|
|
1288
1135
|
return intent + 'end';
|
|
1289
1136
|
}
|
|
@@ -1301,16 +1148,16 @@
|
|
|
1301
1148
|
if (index !== -1)
|
|
1302
1149
|
extras[part.substring(0, index)] = part.substring(index + 1);
|
|
1303
1150
|
}
|
|
1304
|
-
if (extras['scheme'] !== undefined)
|
|
1151
|
+
if (typeof extras['scheme'] !== 'undefined')
|
|
1305
1152
|
parsed.scheme = (extras['scheme'] + '://' + host);
|
|
1306
|
-
if (extras['package'] !== undefined)
|
|
1153
|
+
if (typeof extras['package'] !== 'undefined')
|
|
1307
1154
|
parsed.packageName = extras['package'];
|
|
1308
|
-
if (extras['S.browser_fallback_url'] !== undefined)
|
|
1155
|
+
if (typeof extras['S.browser_fallback_url'] !== 'undefined')
|
|
1309
1156
|
parsed.fallback = extras['S.browser_fallback_url'];
|
|
1310
1157
|
return parsed;
|
|
1311
1158
|
}
|
|
1312
1159
|
function createAppStoreURL(packageName, os) {
|
|
1313
|
-
if (packageName === undefined)
|
|
1160
|
+
if (typeof packageName === 'undefined')
|
|
1314
1161
|
return undefined;
|
|
1315
1162
|
switch (os) {
|
|
1316
1163
|
case OS.Android:
|
|
@@ -1326,7 +1173,7 @@
|
|
|
1326
1173
|
}
|
|
1327
1174
|
}
|
|
1328
1175
|
function createWebStoreURL(packageName, os) {
|
|
1329
|
-
if (packageName === undefined)
|
|
1176
|
+
if (typeof packageName === 'undefined')
|
|
1330
1177
|
return undefined;
|
|
1331
1178
|
switch (os) {
|
|
1332
1179
|
case OS.Android:
|
|
@@ -1391,7 +1238,7 @@
|
|
|
1391
1238
|
return;
|
|
1392
1239
|
}
|
|
1393
1240
|
a = createHiddenElement('a');
|
|
1394
|
-
if (a === undefined)
|
|
1241
|
+
if (typeof a === 'undefined')
|
|
1395
1242
|
return;
|
|
1396
1243
|
a.href = url;
|
|
1397
1244
|
topDocument.body.appendChild(a);
|
|
@@ -1401,7 +1248,7 @@
|
|
|
1401
1248
|
catch (_) {
|
|
1402
1249
|
}
|
|
1403
1250
|
finally {
|
|
1404
|
-
if (a !== undefined) {
|
|
1251
|
+
if (typeof a !== 'undefined') {
|
|
1405
1252
|
try {
|
|
1406
1253
|
topDocument.body.removeChild(a);
|
|
1407
1254
|
}
|
|
@@ -1416,12 +1263,12 @@
|
|
|
1416
1263
|
var iframe = undefined;
|
|
1417
1264
|
try {
|
|
1418
1265
|
iframe = createHiddenElement('iframe');
|
|
1419
|
-
if (iframe === undefined)
|
|
1266
|
+
if (typeof iframe === 'undefined')
|
|
1420
1267
|
return;
|
|
1421
1268
|
iframe.src = url;
|
|
1422
1269
|
topDocument.body.appendChild(iframe);
|
|
1423
1270
|
globalThis.setTimeout(function () {
|
|
1424
|
-
if (iframe !== undefined) {
|
|
1271
|
+
if (typeof iframe !== 'undefined') {
|
|
1425
1272
|
try {
|
|
1426
1273
|
topDocument.body.removeChild(iframe);
|
|
1427
1274
|
}
|
|
@@ -1445,13 +1292,13 @@
|
|
|
1445
1292
|
return true;
|
|
1446
1293
|
if (topDocument.msVisibilityState === 'hidden')
|
|
1447
1294
|
return true;
|
|
1448
|
-
if (topDocument.hidden !== undefined)
|
|
1295
|
+
if (typeof topDocument.hidden !== 'undefined')
|
|
1449
1296
|
return topDocument.hidden;
|
|
1450
|
-
if (topDocument.webkitHidden !== undefined)
|
|
1297
|
+
if (typeof topDocument.webkitHidden !== 'undefined')
|
|
1451
1298
|
return topDocument.webkitHidden;
|
|
1452
|
-
if (topDocument.mozHidden !== undefined)
|
|
1299
|
+
if (typeof topDocument.mozHidden !== 'undefined')
|
|
1453
1300
|
return topDocument.mozHidden;
|
|
1454
|
-
if (topDocument.msHidden !== undefined)
|
|
1301
|
+
if (typeof topDocument.msHidden !== 'undefined')
|
|
1455
1302
|
return topDocument.msHidden;
|
|
1456
1303
|
if (typeof topDocument.hasFocus === 'function')
|
|
1457
1304
|
return !topDocument.hasFocus();
|
|
@@ -1488,7 +1335,7 @@
|
|
|
1488
1335
|
var input = undefined;
|
|
1489
1336
|
try {
|
|
1490
1337
|
input = createHiddenElement('input');
|
|
1491
|
-
if (input === undefined)
|
|
1338
|
+
if (typeof input === 'undefined')
|
|
1492
1339
|
return false;
|
|
1493
1340
|
input.type = 'text';
|
|
1494
1341
|
input.readOnly = true;
|
|
@@ -1505,7 +1352,7 @@
|
|
|
1505
1352
|
catch (_) {
|
|
1506
1353
|
}
|
|
1507
1354
|
finally {
|
|
1508
|
-
if (input !== undefined) {
|
|
1355
|
+
if (typeof input !== 'undefined') {
|
|
1509
1356
|
try {
|
|
1510
1357
|
input.blur();
|
|
1511
1358
|
}
|
|
@@ -1595,7 +1442,7 @@
|
|
|
1595
1442
|
var timeoutId;
|
|
1596
1443
|
var resolved = false;
|
|
1597
1444
|
function cleanup() {
|
|
1598
|
-
if (timeoutId !== undefined) {
|
|
1445
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1599
1446
|
clearTimeout(timeoutId);
|
|
1600
1447
|
timeoutId = undefined;
|
|
1601
1448
|
}
|
|
@@ -1606,14 +1453,14 @@
|
|
|
1606
1453
|
}
|
|
1607
1454
|
catch (_) {
|
|
1608
1455
|
}
|
|
1609
|
-
if (a !== undefined) {
|
|
1456
|
+
if (typeof a !== 'undefined') {
|
|
1610
1457
|
try {
|
|
1611
1458
|
topDocument.body.removeChild(a);
|
|
1612
1459
|
}
|
|
1613
1460
|
catch (_) {
|
|
1614
1461
|
}
|
|
1615
1462
|
}
|
|
1616
|
-
if (iframe !== undefined) {
|
|
1463
|
+
if (typeof iframe !== 'undefined') {
|
|
1617
1464
|
try {
|
|
1618
1465
|
topDocument.body.removeChild(iframe);
|
|
1619
1466
|
}
|
|
@@ -1637,7 +1484,7 @@
|
|
|
1637
1484
|
}
|
|
1638
1485
|
}
|
|
1639
1486
|
function onBlur() {
|
|
1640
|
-
if (timeoutId !== undefined) {
|
|
1487
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1641
1488
|
clearTimeout(timeoutId);
|
|
1642
1489
|
timeoutId = undefined;
|
|
1643
1490
|
}
|
|
@@ -1680,7 +1527,7 @@
|
|
|
1680
1527
|
var timeout;
|
|
1681
1528
|
if (Platform.os.name === OS.Android) {
|
|
1682
1529
|
var option = options[OS.Android] || options['android'];
|
|
1683
|
-
if (option === undefined)
|
|
1530
|
+
if (typeof option === 'undefined')
|
|
1684
1531
|
return Promise.reject(getURLOpenError(tried));
|
|
1685
1532
|
timeout = option.timeout;
|
|
1686
1533
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1691,21 +1538,21 @@
|
|
|
1691
1538
|
infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
|
|
1692
1539
|
infos.allowAppStore = option.allowAppStore;
|
|
1693
1540
|
infos.allowWebStore = option.allowWebStore;
|
|
1694
|
-
if (infos.intent !== undefined && (infos.scheme === undefined || infos.packageName === undefined || infos.fallback === undefined)) {
|
|
1541
|
+
if (typeof infos.intent !== 'undefined' && (typeof infos.scheme === 'undefined' || typeof infos.packageName === 'undefined' || typeof infos.fallback === 'undefined')) {
|
|
1695
1542
|
var parsed = parseIntentURL(infos.intent);
|
|
1696
|
-
if (parsed.scheme !== undefined && infos.scheme === undefined)
|
|
1543
|
+
if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
|
|
1697
1544
|
infos.scheme = parsed.scheme;
|
|
1698
|
-
if (parsed.packageName !== undefined && infos.packageName === undefined)
|
|
1545
|
+
if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
|
|
1699
1546
|
infos.packageName = parsed.packageName;
|
|
1700
|
-
if (parsed.fallback !== undefined && infos.fallback === undefined)
|
|
1547
|
+
if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
|
|
1701
1548
|
infos.fallback = parsed.fallback;
|
|
1702
1549
|
}
|
|
1703
|
-
if (infos.scheme !== undefined && infos.intent === undefined)
|
|
1550
|
+
if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
|
|
1704
1551
|
infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
|
|
1705
1552
|
}
|
|
1706
1553
|
else if (Platform.os.name === OS.iOS) {
|
|
1707
1554
|
var option = options[OS.iOS] || options['ios'];
|
|
1708
|
-
if (option === undefined)
|
|
1555
|
+
if (typeof option === 'undefined')
|
|
1709
1556
|
return Promise.reject(getURLOpenError(tried));
|
|
1710
1557
|
timeout = option.timeout;
|
|
1711
1558
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1717,12 +1564,12 @@
|
|
|
1717
1564
|
infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
|
|
1718
1565
|
infos.allowAppStore = option.allowAppStore;
|
|
1719
1566
|
infos.allowWebStore = option.allowWebStore;
|
|
1720
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1567
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1721
1568
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1722
1569
|
}
|
|
1723
1570
|
else if (Platform.os.name === OS.Windows) {
|
|
1724
1571
|
var option = options[OS.Windows] || options['windows'];
|
|
1725
|
-
if (option === undefined)
|
|
1572
|
+
if (typeof option === 'undefined')
|
|
1726
1573
|
return Promise.reject(getURLOpenError(tried));
|
|
1727
1574
|
timeout = option.timeout;
|
|
1728
1575
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1735,7 +1582,7 @@
|
|
|
1735
1582
|
}
|
|
1736
1583
|
else if (Platform.os.name === OS.MacOS) {
|
|
1737
1584
|
var option = options[OS.MacOS] || options['mac'];
|
|
1738
|
-
if (option === undefined)
|
|
1585
|
+
if (typeof option === 'undefined')
|
|
1739
1586
|
return Promise.reject(getURLOpenError(tried));
|
|
1740
1587
|
timeout = option.timeout;
|
|
1741
1588
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1746,7 +1593,7 @@
|
|
|
1746
1593
|
infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
|
|
1747
1594
|
infos.allowAppStore = option.allowAppStore;
|
|
1748
1595
|
infos.allowWebStore = option.allowWebStore;
|
|
1749
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1596
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1750
1597
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1751
1598
|
}
|
|
1752
1599
|
pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
|
|
@@ -1755,7 +1602,7 @@
|
|
|
1755
1602
|
pushURL(urls, infos.fallback, AppOpenState.Fallback);
|
|
1756
1603
|
pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
|
|
1757
1604
|
pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
|
|
1758
|
-
if (timeout === undefined)
|
|
1605
|
+
if (typeof timeout === 'undefined')
|
|
1759
1606
|
timeout = getDefaultTimeoutByOS(os);
|
|
1760
1607
|
return new Promise(function (resolve, reject) {
|
|
1761
1608
|
function openURLSequential(index) {
|
|
@@ -1896,15 +1743,15 @@
|
|
|
1896
1743
|
var key = keys[i];
|
|
1897
1744
|
result[key] = stringifiableToString(value[key]);
|
|
1898
1745
|
}
|
|
1899
|
-
if (result.to === undefined)
|
|
1746
|
+
if (typeof result.to === 'undefined')
|
|
1900
1747
|
result.to = '';
|
|
1901
|
-
if (result.cc === undefined)
|
|
1748
|
+
if (typeof result.cc === 'undefined')
|
|
1902
1749
|
result.cc = '';
|
|
1903
|
-
if (result.bcc === undefined)
|
|
1750
|
+
if (typeof result.bcc === 'undefined')
|
|
1904
1751
|
result.bcc = '';
|
|
1905
|
-
if (result.subject === undefined)
|
|
1752
|
+
if (typeof result.subject === 'undefined')
|
|
1906
1753
|
result.subject = '';
|
|
1907
|
-
if (result.body === undefined)
|
|
1754
|
+
if (typeof result.body === 'undefined')
|
|
1908
1755
|
result.body = '';
|
|
1909
1756
|
return result;
|
|
1910
1757
|
}
|