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
|
@@ -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,11 +417,8 @@
|
|
|
409
417
|
get readyState() {
|
|
410
418
|
return readyState;
|
|
411
419
|
},
|
|
412
|
-
get
|
|
413
|
-
return
|
|
414
|
-
},
|
|
415
|
-
get dimension() {
|
|
416
|
-
return getDimension();
|
|
420
|
+
get locale() {
|
|
421
|
+
return getLocale();
|
|
417
422
|
},
|
|
418
423
|
get device() {
|
|
419
424
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
@@ -425,17 +430,11 @@
|
|
|
425
430
|
get renderer() {
|
|
426
431
|
return getRenderer();
|
|
427
432
|
},
|
|
428
|
-
get isMobile() {
|
|
429
|
-
return this.device === Devices.Mobile;
|
|
430
|
-
},
|
|
431
|
-
get isDesktop() {
|
|
432
|
-
return this.device === Devices.Desktop;
|
|
433
|
-
},
|
|
434
433
|
get isWebview() {
|
|
435
434
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
436
435
|
},
|
|
437
436
|
get isNode() {
|
|
438
|
-
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';
|
|
439
438
|
},
|
|
440
439
|
get isStandalone() {
|
|
441
440
|
if (this.os.name === OS.iOS)
|
|
@@ -457,6 +456,33 @@
|
|
|
457
456
|
}
|
|
458
457
|
}
|
|
459
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
|
+
}
|
|
460
486
|
var OS_RESOLVER_MAP = [
|
|
461
487
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
462
488
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -515,14 +541,6 @@
|
|
|
515
541
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
516
542
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
517
543
|
];
|
|
518
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
519
|
-
'Google Chrome': 'Chrome',
|
|
520
|
-
'Microsoft Edge': 'Edge',
|
|
521
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
522
|
-
'Android WebView': 'Chrome WebView',
|
|
523
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
524
|
-
'OperaMobile': 'Opera Mobi',
|
|
525
|
-
};
|
|
526
544
|
function incrementPendingTasks() {
|
|
527
545
|
pendingTasks++;
|
|
528
546
|
}
|
|
@@ -543,33 +561,6 @@
|
|
|
543
561
|
readyCallback.length = 0;
|
|
544
562
|
}
|
|
545
563
|
}
|
|
546
|
-
function resolveWindowsVersion(string) {
|
|
547
|
-
if (string === undefined)
|
|
548
|
-
return '';
|
|
549
|
-
var mapped = {
|
|
550
|
-
'4.90': 'ME',
|
|
551
|
-
'NT3.51': 'NT 3.11',
|
|
552
|
-
'NT4.0': 'NT 4.0',
|
|
553
|
-
'NT 5.0': '2000',
|
|
554
|
-
'NT 5.1': 'XP',
|
|
555
|
-
'NT 5.2': 'XP',
|
|
556
|
-
'NT 6.0': 'Vista',
|
|
557
|
-
'NT 6.1': '7',
|
|
558
|
-
'NT 6.2': '8',
|
|
559
|
-
'NT 6.3': '8.1',
|
|
560
|
-
'NT 6.4': '10',
|
|
561
|
-
'NT 10.0': '10',
|
|
562
|
-
'ARM': 'RT'
|
|
563
|
-
}[string];
|
|
564
|
-
if (mapped !== undefined)
|
|
565
|
-
return mapped;
|
|
566
|
-
return string;
|
|
567
|
-
}
|
|
568
|
-
function resolveUnderscoreVersion(string) {
|
|
569
|
-
if (string === undefined)
|
|
570
|
-
return '';
|
|
571
|
-
return string.replace(/_/g, '.');
|
|
572
|
-
}
|
|
573
564
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
574
565
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
575
566
|
return '11';
|
|
@@ -706,12 +697,12 @@
|
|
|
706
697
|
return resolver(string);
|
|
707
698
|
if (typeof resolver === 'string')
|
|
708
699
|
return resolver;
|
|
709
|
-
if (string === undefined)
|
|
700
|
+
if (typeof string === 'undefined')
|
|
710
701
|
return '';
|
|
711
702
|
return string;
|
|
712
703
|
}
|
|
713
704
|
function normalizeBrand(entry) {
|
|
714
|
-
if (entry === null || entry === undefined)
|
|
705
|
+
if (entry === null || typeof entry === 'undefined')
|
|
715
706
|
return { brand: '', version: '' };
|
|
716
707
|
if (typeof entry === 'string')
|
|
717
708
|
return { brand: entry, version: '' };
|
|
@@ -765,152 +756,127 @@
|
|
|
765
756
|
return '';
|
|
766
757
|
}
|
|
767
758
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
759
|
+
function normalizeLocale(locale) {
|
|
760
|
+
if (locale === null || typeof locale === 'undefined')
|
|
761
|
+
return locale;
|
|
762
|
+
if (locale.length === 0)
|
|
763
|
+
return null;
|
|
764
|
+
locale = locale.replace(/_/g, '-');
|
|
765
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
766
|
+
return 'en-US';
|
|
767
|
+
if (locale.indexOf('.') !== -1)
|
|
768
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
769
|
+
if (locale.indexOf('@') !== -1)
|
|
770
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
771
|
+
var parts = locale.split('-');
|
|
772
|
+
if (parts.length === 0)
|
|
773
|
+
return null;
|
|
774
|
+
parts[0] = parts[0].toLowerCase();
|
|
775
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
776
|
+
parts[1] = parts[1].toUpperCase();
|
|
777
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
778
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
779
|
+
return parts.join('-');
|
|
780
|
+
}
|
|
781
|
+
function getLocale() {
|
|
782
|
+
var locale = {
|
|
783
|
+
language: null,
|
|
784
|
+
languages: [],
|
|
785
|
+
timezone: null,
|
|
786
|
+
timezoneOffset: 0,
|
|
776
787
|
};
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
781
|
-
if (typeof connection !== 'undefined') {
|
|
782
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
783
|
-
network.effectiveType = connection.effectiveType;
|
|
784
|
-
if (typeof connection.type !== 'undefined')
|
|
785
|
-
network.type = connection.type;
|
|
786
|
-
if (typeof connection.downlink !== 'undefined')
|
|
787
|
-
network.downlink = connection.downlink;
|
|
788
|
-
if (typeof connection.rtt !== 'undefined')
|
|
789
|
-
network.rtt = connection.rtt;
|
|
790
|
-
if (typeof connection.saveData !== 'undefined')
|
|
791
|
-
network.saveData = connection.saveData;
|
|
792
|
-
return network;
|
|
793
|
-
}
|
|
788
|
+
function addLanguages(language) {
|
|
789
|
+
for (var i = 0; i < language.length; i++)
|
|
790
|
+
addLanguage(language[i]);
|
|
794
791
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
var name_1 = networkInterfaceNames[i];
|
|
802
|
-
var networkInterface = networkInterfaces[name_1];
|
|
803
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
804
|
-
var address = networkInterface[j];
|
|
805
|
-
if (!address.internal && address.family === 'IPv4')
|
|
806
|
-
network.isOnline = true;
|
|
807
|
-
}
|
|
808
|
-
if (network.isOnline)
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
catch (_) {
|
|
792
|
+
function addLanguage(language) {
|
|
793
|
+
language = normalizeLocale(language);
|
|
794
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
795
|
+
if (locale.language === null)
|
|
796
|
+
locale.language = language;
|
|
797
|
+
locale.languages.push(language);
|
|
813
798
|
}
|
|
799
|
+
}
|
|
800
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
814
801
|
try {
|
|
815
|
-
var
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
if (
|
|
828
|
-
|
|
829
|
-
}
|
|
830
|
-
catch (_) {
|
|
802
|
+
var reactNative = require('react-native');
|
|
803
|
+
var nativeModules = reactNative.NativeModules;
|
|
804
|
+
if (typeof nativeModules.SettingsManager !== 'undefined') {
|
|
805
|
+
var settingManager = nativeModules.SettingsManager;
|
|
806
|
+
if (typeof settingManager !== 'undefined') {
|
|
807
|
+
var constant = typeof settingManager.getConstants === 'function'
|
|
808
|
+
? settingManager.getConstants()
|
|
809
|
+
: settingManager;
|
|
810
|
+
if (typeof constant !== 'undefined' && typeof constant.settings !== 'undefined') {
|
|
811
|
+
var settings = constant.settings;
|
|
812
|
+
if (typeof settings.AppleLocale === 'string')
|
|
813
|
+
addLanguage(settings.AppleLocale);
|
|
814
|
+
if (Array.isArray(settings.AppleLanguages) && settings.AppleLanguages.length > 0)
|
|
815
|
+
addLanguages(settings.AppleLanguages);
|
|
831
816
|
}
|
|
832
817
|
}
|
|
833
|
-
if (network.type === null)
|
|
834
|
-
network.type = 'other';
|
|
835
818
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
var
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
else
|
|
845
|
-
network.type = 'other';
|
|
846
|
-
}
|
|
847
|
-
catch (_) {
|
|
848
|
-
network.type = 'other';
|
|
819
|
+
if (typeof nativeModules.I18nManager !== 'undefined') {
|
|
820
|
+
var i18nManager = nativeModules.I18nManager;
|
|
821
|
+
if (typeof i18nManager !== 'undefined') {
|
|
822
|
+
var constant = typeof i18nManager.getConstants === 'function'
|
|
823
|
+
? i18nManager.getConstants()
|
|
824
|
+
: i18nManager;
|
|
825
|
+
if (typeof constant !== 'undefined' && typeof constant.localeIdentifier !== 'undefined')
|
|
826
|
+
addLanguage(constant.localeIdentifier);
|
|
849
827
|
}
|
|
850
828
|
}
|
|
851
829
|
}
|
|
852
830
|
catch (_) {
|
|
853
831
|
}
|
|
854
832
|
}
|
|
855
|
-
|
|
856
|
-
}
|
|
857
|
-
function getDimension() {
|
|
858
|
-
var dimension = {
|
|
859
|
-
innerWidth: -1,
|
|
860
|
-
innerHeight: -1,
|
|
861
|
-
outerWidth: -1,
|
|
862
|
-
outerHeight: -1,
|
|
863
|
-
scale: 1,
|
|
864
|
-
};
|
|
865
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
866
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
867
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
868
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
869
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
870
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
871
|
-
return dimension;
|
|
872
|
-
}
|
|
873
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
833
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
874
834
|
try {
|
|
875
|
-
var
|
|
876
|
-
var
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
dimension.outerHeight = windowDimensions.height;
|
|
884
|
-
dimension.scale = pixelRatio.get();
|
|
885
|
-
return dimension;
|
|
835
|
+
var electron = require('electron');
|
|
836
|
+
var app = electron.app;
|
|
837
|
+
if (typeof app.getLocale !== 'undefined')
|
|
838
|
+
addLanguage(app.getLocale());
|
|
839
|
+
if (typeof app.getSystemLocale !== 'undefined')
|
|
840
|
+
addLanguage(app.getSystemLocale());
|
|
841
|
+
if (typeof app.getPreferredSystemLanguages !== 'undefined')
|
|
842
|
+
addLanguages(app.getPreferredSystemLanguages());
|
|
886
843
|
}
|
|
887
844
|
catch (_) {
|
|
888
845
|
}
|
|
889
846
|
}
|
|
890
|
-
if (
|
|
847
|
+
if (typeof Intl !== 'undefined') {
|
|
891
848
|
try {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
var size = focusedWindow.getSize();
|
|
899
|
-
dimension.innerWidth = contentSize[0];
|
|
900
|
-
dimension.innerHeight = contentSize[1];
|
|
901
|
-
dimension.outerWidth = size[0];
|
|
902
|
-
dimension.outerHeight = size[1];
|
|
903
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
904
|
-
}
|
|
905
|
-
return dimension;
|
|
849
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
850
|
+
}
|
|
851
|
+
catch (_) {
|
|
852
|
+
}
|
|
853
|
+
try {
|
|
854
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
906
855
|
}
|
|
907
856
|
catch (_) {
|
|
908
857
|
}
|
|
909
858
|
}
|
|
910
|
-
|
|
859
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
860
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
861
|
+
addLanguages(globalThis.navigator.languages);
|
|
862
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
863
|
+
addLanguage(globalThis.navigator.language);
|
|
864
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
865
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
866
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
867
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
868
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
869
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
870
|
+
}
|
|
871
|
+
try {
|
|
872
|
+
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
873
|
+
}
|
|
874
|
+
catch (_) {
|
|
875
|
+
}
|
|
876
|
+
return locale;
|
|
911
877
|
}
|
|
912
878
|
function init() {
|
|
913
|
-
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)))
|
|
914
880
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
915
881
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
916
882
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -1106,8 +1072,7 @@
|
|
|
1106
1072
|
finally {
|
|
1107
1073
|
decrementPendingTasks();
|
|
1108
1074
|
}
|
|
1109
|
-
})
|
|
1110
|
-
.catch(decrementPendingTasks);
|
|
1075
|
+
});
|
|
1111
1076
|
}
|
|
1112
1077
|
checkReady();
|
|
1113
1078
|
}
|
|
@@ -1130,15 +1095,15 @@
|
|
|
1130
1095
|
if (xhr.status === 200) {
|
|
1131
1096
|
try {
|
|
1132
1097
|
var response = JSON.parse(xhr.response);
|
|
1133
|
-
if (response.results === undefined)
|
|
1098
|
+
if (typeof response.results === 'undefined')
|
|
1134
1099
|
return undefined;
|
|
1135
1100
|
var results = response.results;
|
|
1136
|
-
if (
|
|
1101
|
+
if (results.length === 0)
|
|
1137
1102
|
return undefined;
|
|
1138
1103
|
var result = results[0];
|
|
1139
|
-
if (result === undefined)
|
|
1104
|
+
if (typeof result === 'undefined')
|
|
1140
1105
|
return undefined;
|
|
1141
|
-
return result.trackId;
|
|
1106
|
+
return "" + result.trackId;
|
|
1142
1107
|
}
|
|
1143
1108
|
catch (_) {
|
|
1144
1109
|
return undefined;
|
|
@@ -1155,17 +1120,17 @@
|
|
|
1155
1120
|
var prefix = split[0];
|
|
1156
1121
|
var suffix = split[1];
|
|
1157
1122
|
var intent = 'intent://';
|
|
1158
|
-
if (suffix !== undefined)
|
|
1123
|
+
if (typeof suffix !== 'undefined')
|
|
1159
1124
|
intent = intent + suffix;
|
|
1160
1125
|
intent = intent + '#Intent;'
|
|
1161
1126
|
+ 'scheme=' + prefix + ';'
|
|
1162
1127
|
+ 'action=android.intent.action.VIEW;'
|
|
1163
1128
|
+ 'category=android.intent.category.BROWSABLE;';
|
|
1164
|
-
if (packageName !== undefined)
|
|
1129
|
+
if (typeof packageName !== 'undefined')
|
|
1165
1130
|
intent = intent + 'package=' + packageName + ';';
|
|
1166
|
-
if (fallback !== undefined && typeof fallback === 'string')
|
|
1131
|
+
if (typeof fallback !== 'undefined' && typeof fallback === 'string')
|
|
1167
1132
|
intent = intent + 'S.browser_fallback_url=' + fallback + ';';
|
|
1168
|
-
else if (packageName !== undefined)
|
|
1133
|
+
else if (typeof packageName !== 'undefined')
|
|
1169
1134
|
intent = intent + 'S.browser_fallback_url=' + createAppStoreURL(packageName, OS.Android) + ';';
|
|
1170
1135
|
return intent + 'end';
|
|
1171
1136
|
}
|
|
@@ -1183,16 +1148,16 @@
|
|
|
1183
1148
|
if (index !== -1)
|
|
1184
1149
|
extras[part.substring(0, index)] = part.substring(index + 1);
|
|
1185
1150
|
}
|
|
1186
|
-
if (extras['scheme'] !== undefined)
|
|
1151
|
+
if (typeof extras['scheme'] !== 'undefined')
|
|
1187
1152
|
parsed.scheme = (extras['scheme'] + '://' + host);
|
|
1188
|
-
if (extras['package'] !== undefined)
|
|
1153
|
+
if (typeof extras['package'] !== 'undefined')
|
|
1189
1154
|
parsed.packageName = extras['package'];
|
|
1190
|
-
if (extras['S.browser_fallback_url'] !== undefined)
|
|
1155
|
+
if (typeof extras['S.browser_fallback_url'] !== 'undefined')
|
|
1191
1156
|
parsed.fallback = extras['S.browser_fallback_url'];
|
|
1192
1157
|
return parsed;
|
|
1193
1158
|
}
|
|
1194
1159
|
function createAppStoreURL(packageName, os) {
|
|
1195
|
-
if (packageName === undefined)
|
|
1160
|
+
if (typeof packageName === 'undefined')
|
|
1196
1161
|
return undefined;
|
|
1197
1162
|
switch (os) {
|
|
1198
1163
|
case OS.Android:
|
|
@@ -1208,7 +1173,7 @@
|
|
|
1208
1173
|
}
|
|
1209
1174
|
}
|
|
1210
1175
|
function createWebStoreURL(packageName, os) {
|
|
1211
|
-
if (packageName === undefined)
|
|
1176
|
+
if (typeof packageName === 'undefined')
|
|
1212
1177
|
return undefined;
|
|
1213
1178
|
switch (os) {
|
|
1214
1179
|
case OS.Android:
|
|
@@ -1273,7 +1238,7 @@
|
|
|
1273
1238
|
return;
|
|
1274
1239
|
}
|
|
1275
1240
|
a = createHiddenElement('a');
|
|
1276
|
-
if (a === undefined)
|
|
1241
|
+
if (typeof a === 'undefined')
|
|
1277
1242
|
return;
|
|
1278
1243
|
a.href = url;
|
|
1279
1244
|
topDocument.body.appendChild(a);
|
|
@@ -1283,7 +1248,7 @@
|
|
|
1283
1248
|
catch (_) {
|
|
1284
1249
|
}
|
|
1285
1250
|
finally {
|
|
1286
|
-
if (a !== undefined) {
|
|
1251
|
+
if (typeof a !== 'undefined') {
|
|
1287
1252
|
try {
|
|
1288
1253
|
topDocument.body.removeChild(a);
|
|
1289
1254
|
}
|
|
@@ -1298,12 +1263,12 @@
|
|
|
1298
1263
|
var iframe = undefined;
|
|
1299
1264
|
try {
|
|
1300
1265
|
iframe = createHiddenElement('iframe');
|
|
1301
|
-
if (iframe === undefined)
|
|
1266
|
+
if (typeof iframe === 'undefined')
|
|
1302
1267
|
return;
|
|
1303
1268
|
iframe.src = url;
|
|
1304
1269
|
topDocument.body.appendChild(iframe);
|
|
1305
1270
|
globalThis.setTimeout(function () {
|
|
1306
|
-
if (iframe !== undefined) {
|
|
1271
|
+
if (typeof iframe !== 'undefined') {
|
|
1307
1272
|
try {
|
|
1308
1273
|
topDocument.body.removeChild(iframe);
|
|
1309
1274
|
}
|
|
@@ -1327,13 +1292,13 @@
|
|
|
1327
1292
|
return true;
|
|
1328
1293
|
if (topDocument.msVisibilityState === 'hidden')
|
|
1329
1294
|
return true;
|
|
1330
|
-
if (topDocument.hidden !== undefined)
|
|
1295
|
+
if (typeof topDocument.hidden !== 'undefined')
|
|
1331
1296
|
return topDocument.hidden;
|
|
1332
|
-
if (topDocument.webkitHidden !== undefined)
|
|
1297
|
+
if (typeof topDocument.webkitHidden !== 'undefined')
|
|
1333
1298
|
return topDocument.webkitHidden;
|
|
1334
|
-
if (topDocument.mozHidden !== undefined)
|
|
1299
|
+
if (typeof topDocument.mozHidden !== 'undefined')
|
|
1335
1300
|
return topDocument.mozHidden;
|
|
1336
|
-
if (topDocument.msHidden !== undefined)
|
|
1301
|
+
if (typeof topDocument.msHidden !== 'undefined')
|
|
1337
1302
|
return topDocument.msHidden;
|
|
1338
1303
|
if (typeof topDocument.hasFocus === 'function')
|
|
1339
1304
|
return !topDocument.hasFocus();
|
|
@@ -1370,7 +1335,7 @@
|
|
|
1370
1335
|
var input = undefined;
|
|
1371
1336
|
try {
|
|
1372
1337
|
input = createHiddenElement('input');
|
|
1373
|
-
if (input === undefined)
|
|
1338
|
+
if (typeof input === 'undefined')
|
|
1374
1339
|
return false;
|
|
1375
1340
|
input.type = 'text';
|
|
1376
1341
|
input.readOnly = true;
|
|
@@ -1387,7 +1352,7 @@
|
|
|
1387
1352
|
catch (_) {
|
|
1388
1353
|
}
|
|
1389
1354
|
finally {
|
|
1390
|
-
if (input !== undefined) {
|
|
1355
|
+
if (typeof input !== 'undefined') {
|
|
1391
1356
|
try {
|
|
1392
1357
|
input.blur();
|
|
1393
1358
|
}
|
|
@@ -1477,7 +1442,7 @@
|
|
|
1477
1442
|
var timeoutId;
|
|
1478
1443
|
var resolved = false;
|
|
1479
1444
|
function cleanup() {
|
|
1480
|
-
if (timeoutId !== undefined) {
|
|
1445
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1481
1446
|
clearTimeout(timeoutId);
|
|
1482
1447
|
timeoutId = undefined;
|
|
1483
1448
|
}
|
|
@@ -1488,14 +1453,14 @@
|
|
|
1488
1453
|
}
|
|
1489
1454
|
catch (_) {
|
|
1490
1455
|
}
|
|
1491
|
-
if (a !== undefined) {
|
|
1456
|
+
if (typeof a !== 'undefined') {
|
|
1492
1457
|
try {
|
|
1493
1458
|
topDocument.body.removeChild(a);
|
|
1494
1459
|
}
|
|
1495
1460
|
catch (_) {
|
|
1496
1461
|
}
|
|
1497
1462
|
}
|
|
1498
|
-
if (iframe !== undefined) {
|
|
1463
|
+
if (typeof iframe !== 'undefined') {
|
|
1499
1464
|
try {
|
|
1500
1465
|
topDocument.body.removeChild(iframe);
|
|
1501
1466
|
}
|
|
@@ -1519,7 +1484,7 @@
|
|
|
1519
1484
|
}
|
|
1520
1485
|
}
|
|
1521
1486
|
function onBlur() {
|
|
1522
|
-
if (timeoutId !== undefined) {
|
|
1487
|
+
if (typeof timeoutId !== 'undefined') {
|
|
1523
1488
|
clearTimeout(timeoutId);
|
|
1524
1489
|
timeoutId = undefined;
|
|
1525
1490
|
}
|
|
@@ -1562,7 +1527,7 @@
|
|
|
1562
1527
|
var timeout;
|
|
1563
1528
|
if (Platform.os.name === OS.Android) {
|
|
1564
1529
|
var option = options[OS.Android] || options['android'];
|
|
1565
|
-
if (option === undefined)
|
|
1530
|
+
if (typeof option === 'undefined')
|
|
1566
1531
|
return Promise.reject(getURLOpenError(tried));
|
|
1567
1532
|
timeout = option.timeout;
|
|
1568
1533
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1573,21 +1538,21 @@
|
|
|
1573
1538
|
infos.webStore = createWebStoreURL(infos.packageName, OS.Android);
|
|
1574
1539
|
infos.allowAppStore = option.allowAppStore;
|
|
1575
1540
|
infos.allowWebStore = option.allowWebStore;
|
|
1576
|
-
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')) {
|
|
1577
1542
|
var parsed = parseIntentURL(infos.intent);
|
|
1578
|
-
if (parsed.scheme !== undefined && infos.scheme === undefined)
|
|
1543
|
+
if (typeof parsed.scheme !== 'undefined' && typeof infos.scheme === 'undefined')
|
|
1579
1544
|
infos.scheme = parsed.scheme;
|
|
1580
|
-
if (parsed.packageName !== undefined && infos.packageName === undefined)
|
|
1545
|
+
if (typeof parsed.packageName !== 'undefined' && typeof infos.packageName === 'undefined')
|
|
1581
1546
|
infos.packageName = parsed.packageName;
|
|
1582
|
-
if (parsed.fallback !== undefined && infos.fallback === undefined)
|
|
1547
|
+
if (typeof parsed.fallback !== 'undefined' && typeof infos.fallback === 'undefined')
|
|
1583
1548
|
infos.fallback = parsed.fallback;
|
|
1584
1549
|
}
|
|
1585
|
-
if (infos.scheme !== undefined && infos.intent === undefined)
|
|
1550
|
+
if (typeof infos.scheme !== 'undefined' && typeof infos.intent === 'undefined')
|
|
1586
1551
|
infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
|
|
1587
1552
|
}
|
|
1588
1553
|
else if (Platform.os.name === OS.iOS) {
|
|
1589
1554
|
var option = options[OS.iOS] || options['ios'];
|
|
1590
|
-
if (option === undefined)
|
|
1555
|
+
if (typeof option === 'undefined')
|
|
1591
1556
|
return Promise.reject(getURLOpenError(tried));
|
|
1592
1557
|
timeout = option.timeout;
|
|
1593
1558
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1599,12 +1564,12 @@
|
|
|
1599
1564
|
infos.webStore = createWebStoreURL(infos.trackId, OS.iOS);
|
|
1600
1565
|
infos.allowAppStore = option.allowAppStore;
|
|
1601
1566
|
infos.allowWebStore = option.allowWebStore;
|
|
1602
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1567
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1603
1568
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1604
1569
|
}
|
|
1605
1570
|
else if (Platform.os.name === OS.Windows) {
|
|
1606
1571
|
var option = options[OS.Windows] || options['windows'];
|
|
1607
|
-
if (option === undefined)
|
|
1572
|
+
if (typeof option === 'undefined')
|
|
1608
1573
|
return Promise.reject(getURLOpenError(tried));
|
|
1609
1574
|
timeout = option.timeout;
|
|
1610
1575
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1617,7 +1582,7 @@
|
|
|
1617
1582
|
}
|
|
1618
1583
|
else if (Platform.os.name === OS.MacOS) {
|
|
1619
1584
|
var option = options[OS.MacOS] || options['mac'];
|
|
1620
|
-
if (option === undefined)
|
|
1585
|
+
if (typeof option === 'undefined')
|
|
1621
1586
|
return Promise.reject(getURLOpenError(tried));
|
|
1622
1587
|
timeout = option.timeout;
|
|
1623
1588
|
infos.scheme = urlToString(option.scheme);
|
|
@@ -1628,7 +1593,7 @@
|
|
|
1628
1593
|
infos.webStore = createWebStoreURL(infos.trackId, OS.MacOS);
|
|
1629
1594
|
infos.allowAppStore = option.allowAppStore;
|
|
1630
1595
|
infos.allowWebStore = option.allowWebStore;
|
|
1631
|
-
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1596
|
+
if (typeof infos.bundleId !== 'undefined' && typeof infos.trackId === 'undefined')
|
|
1632
1597
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1633
1598
|
}
|
|
1634
1599
|
pushURL(urls, infos.intent, AppOpenState.Intent, canOpenIntentURL());
|
|
@@ -1637,7 +1602,7 @@
|
|
|
1637
1602
|
pushURL(urls, infos.fallback, AppOpenState.Fallback);
|
|
1638
1603
|
pushURL(urls, infos.appStore, AppOpenState.Store, infos.allowAppStore);
|
|
1639
1604
|
pushURL(urls, infos.webStore, AppOpenState.Store, infos.allowWebStore);
|
|
1640
|
-
if (timeout === undefined)
|
|
1605
|
+
if (typeof timeout === 'undefined')
|
|
1641
1606
|
timeout = getDefaultTimeoutByOS(os);
|
|
1642
1607
|
return new Promise(function (resolve, reject) {
|
|
1643
1608
|
function openURLSequential(index) {
|
|
@@ -1778,15 +1743,15 @@
|
|
|
1778
1743
|
var key = keys[i];
|
|
1779
1744
|
result[key] = stringifiableToString(value[key]);
|
|
1780
1745
|
}
|
|
1781
|
-
if (result.to === undefined)
|
|
1746
|
+
if (typeof result.to === 'undefined')
|
|
1782
1747
|
result.to = '';
|
|
1783
|
-
if (result.cc === undefined)
|
|
1748
|
+
if (typeof result.cc === 'undefined')
|
|
1784
1749
|
result.cc = '';
|
|
1785
|
-
if (result.bcc === undefined)
|
|
1750
|
+
if (typeof result.bcc === 'undefined')
|
|
1786
1751
|
result.bcc = '';
|
|
1787
|
-
if (result.subject === undefined)
|
|
1752
|
+
if (typeof result.subject === 'undefined')
|
|
1788
1753
|
result.subject = '';
|
|
1789
|
-
if (result.body === undefined)
|
|
1754
|
+
if (typeof result.body === 'undefined')
|
|
1790
1755
|
result.body = '';
|
|
1791
1756
|
return result;
|
|
1792
1757
|
}
|