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