native-fn 1.0.77 → 1.0.79
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/native.cjs +1 -1
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/native.umd.js +1 -1
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +131 -50
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +131 -50
- package/dist/plugin/app/index.umd.js +131 -50
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/plugin/appearance/index.cjs +131 -50
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +131 -50
- package/dist/plugin/appearance/index.umd.js +131 -50
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/plugin/clipboard/index.cjs +131 -50
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +131 -50
- package/dist/plugin/clipboard/index.umd.js +131 -50
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/plugin/fullscreen/index.cjs +131 -50
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +131 -50
- package/dist/plugin/fullscreen/index.umd.js +131 -50
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/plugin/platform/index.cjs +131 -50
- package/dist/plugin/platform/index.d.ts +11 -1
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +131 -50
- package/dist/plugin/platform/index.umd.js +131 -50
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/plugin/theme/index.cjs +131 -50
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +131 -50
- package/dist/plugin/theme/index.umd.js +131 -50
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +10 -0
- package/dist/src/plugin/platform/types/platform.d.ts +10 -0
- package/package.json +1 -1
|
@@ -69,15 +69,24 @@ var CrossPlatformFramework;
|
|
|
69
69
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
70
70
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
71
71
|
|
|
72
|
+
var readyState = 'loading';
|
|
73
|
+
var readyCallback = [];
|
|
74
|
+
var pendingTasks = 0;
|
|
72
75
|
var Platform = {
|
|
73
76
|
os: { name: OS.Unknown, version: '' },
|
|
74
77
|
engine: { name: Engines.Unknown, version: '' },
|
|
75
78
|
browser: { name: Browsers.Unknown, version: '' },
|
|
76
79
|
crossPlatformFramework: CrossPlatformFramework.Unknown,
|
|
77
80
|
userAgent: USER_AGENT,
|
|
81
|
+
get readyState() {
|
|
82
|
+
return readyState;
|
|
83
|
+
},
|
|
78
84
|
get network() {
|
|
79
85
|
return getNetwork();
|
|
80
86
|
},
|
|
87
|
+
get dimension() {
|
|
88
|
+
return getDimension();
|
|
89
|
+
},
|
|
81
90
|
get device() {
|
|
82
91
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
83
92
|
return Devices.Mobile;
|
|
@@ -107,6 +116,18 @@ var Platform = {
|
|
|
107
116
|
return false;
|
|
108
117
|
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
109
118
|
},
|
|
119
|
+
onready: function (callback) {
|
|
120
|
+
if (this.readyState === 'complete') {
|
|
121
|
+
try {
|
|
122
|
+
callback(this);
|
|
123
|
+
}
|
|
124
|
+
catch (_) {
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
readyCallback.push(callback);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
110
131
|
};
|
|
111
132
|
var OS_RESOLVER_MAP = [
|
|
112
133
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -174,6 +195,26 @@ var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
|
174
195
|
'HeadlessChrome': 'Chrome Headless',
|
|
175
196
|
'OperaMobile': 'Opera Mobi',
|
|
176
197
|
};
|
|
198
|
+
function incrementPendingTasks() {
|
|
199
|
+
pendingTasks++;
|
|
200
|
+
}
|
|
201
|
+
function decrementPendingTasks() {
|
|
202
|
+
pendingTasks--;
|
|
203
|
+
checkReady();
|
|
204
|
+
}
|
|
205
|
+
function checkReady() {
|
|
206
|
+
if (pendingTasks === 0 && readyState === 'loading') {
|
|
207
|
+
readyState = 'complete';
|
|
208
|
+
for (var i = 0; i < readyCallback.length; i++) {
|
|
209
|
+
try {
|
|
210
|
+
readyCallback[i](Platform);
|
|
211
|
+
}
|
|
212
|
+
catch (_) {
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
readyCallback.length = 0;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
177
218
|
function resolveWindowsVersion(string) {
|
|
178
219
|
if (string === undefined)
|
|
179
220
|
return '';
|
|
@@ -374,6 +415,7 @@ function parseOSFromCordova() {
|
|
|
374
415
|
break;
|
|
375
416
|
}
|
|
376
417
|
}
|
|
418
|
+
decrementPendingTasks();
|
|
377
419
|
}
|
|
378
420
|
function getRenderer() {
|
|
379
421
|
if (typeof globalThis.document === 'undefined')
|
|
@@ -483,8 +525,40 @@ function getNetwork() {
|
|
|
483
525
|
}
|
|
484
526
|
return network;
|
|
485
527
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
528
|
+
function getDimension() {
|
|
529
|
+
var dimension = {
|
|
530
|
+
innerWidth: -1,
|
|
531
|
+
innerHeight: -1,
|
|
532
|
+
outerWidth: -1,
|
|
533
|
+
outerHeight: -1,
|
|
534
|
+
scale: 1,
|
|
535
|
+
};
|
|
536
|
+
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
537
|
+
dimension.innerWidth = globalThis.innerWidth;
|
|
538
|
+
dimension.innerHeight = globalThis.innerHeight;
|
|
539
|
+
dimension.outerWidth = globalThis.outerWidth;
|
|
540
|
+
dimension.outerHeight = globalThis.outerHeight;
|
|
541
|
+
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
542
|
+
return dimension;
|
|
543
|
+
}
|
|
544
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
545
|
+
try {
|
|
546
|
+
var reactNative = require('react-native');
|
|
547
|
+
var dimensions = reactNative.Dimensions;
|
|
548
|
+
var pixelRatio = reactNative.PixelRatio;
|
|
549
|
+
var screenDimensions = dimensions.get('screen');
|
|
550
|
+
var windowDimensions = dimensions.get('window');
|
|
551
|
+
dimension.innerWidth = screenDimensions.width;
|
|
552
|
+
dimension.innerHeight = screenDimensions.height;
|
|
553
|
+
dimension.outerWidth = windowDimensions.width;
|
|
554
|
+
dimension.outerHeight = windowDimensions.height;
|
|
555
|
+
dimension.scale = pixelRatio.get();
|
|
556
|
+
return dimension;
|
|
557
|
+
}
|
|
558
|
+
catch (_) {
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
return dimension;
|
|
488
562
|
}
|
|
489
563
|
function init() {
|
|
490
564
|
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
@@ -625,61 +699,68 @@ function init() {
|
|
|
625
699
|
globalThis.document.addEventListener("deviceready", parseOSFromCordova, false);
|
|
626
700
|
}
|
|
627
701
|
}
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
.userAgentData
|
|
632
|
-
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
702
|
+
if (typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgentData !== 'undefined' && typeof globalThis.navigator.userAgentData.getHighEntropyValues !== 'undefined') {
|
|
703
|
+
incrementPendingTasks();
|
|
704
|
+
globalThis.navigator.userAgentData.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
633
705
|
.then(function (result) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
706
|
+
try {
|
|
707
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
708
|
+
var platformVersion = result.platformVersion;
|
|
709
|
+
var platform = result.platform;
|
|
710
|
+
var browserName = Platform.browser.name;
|
|
711
|
+
var prevBrandName = null;
|
|
712
|
+
for (var i = 0; i < brands.length; i++) {
|
|
713
|
+
var brand = normalizeBrand(brands[i]);
|
|
714
|
+
var brandVersion = brand.version;
|
|
715
|
+
var brandName = brand.brand;
|
|
716
|
+
if (/not.a.brand/i.test(brandName))
|
|
717
|
+
continue;
|
|
718
|
+
if (prevBrandName === null || (/Chrom/.test(prevBrandName) && brandName !== 'Chromium') || (prevBrandName === 'Edge' && /WebView2/.test(brandName))) {
|
|
719
|
+
brandName = HIGH_ENTROPY_BRAND_NAME_MAP[brandName] || brandName;
|
|
720
|
+
prevBrandName = browserName;
|
|
721
|
+
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
722
|
+
browserName = brandName;
|
|
723
|
+
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
724
|
+
Platform.browser.name = Browsers.Chrome;
|
|
725
|
+
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
726
|
+
Platform.browser.name = Browsers.Edge;
|
|
727
|
+
else if (browserName === 'Opera Mobi')
|
|
728
|
+
Platform.browser.name = Browsers.Opera;
|
|
729
|
+
Platform.browser.version = brandVersion;
|
|
730
|
+
}
|
|
731
|
+
prevBrandName = brandName;
|
|
657
732
|
}
|
|
658
|
-
|
|
733
|
+
if (brandName === 'Chromium')
|
|
734
|
+
Platform.engine.version = brandVersion;
|
|
735
|
+
}
|
|
736
|
+
if (typeof platformVersion === 'string') {
|
|
737
|
+
if (Platform.os.name === OS.Windows)
|
|
738
|
+
Platform.os.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
739
|
+
else
|
|
740
|
+
Platform.os.version = platformVersion;
|
|
741
|
+
}
|
|
742
|
+
if (typeof platform === 'string') {
|
|
743
|
+
if (/android/i.test(platform))
|
|
744
|
+
Platform.os.name = OS.Android;
|
|
745
|
+
else if (/ios|iphone|ipad/i.test(platform))
|
|
746
|
+
Platform.os.name = OS.iOS;
|
|
747
|
+
else if (/windows|win32/i.test(platform))
|
|
748
|
+
Platform.os.name = OS.Windows;
|
|
749
|
+
else if (/macos|macintel/i.test(platform))
|
|
750
|
+
Platform.os.name = OS.MacOS;
|
|
659
751
|
}
|
|
660
|
-
if (
|
|
661
|
-
Platform.
|
|
752
|
+
if (result.mobile === true)
|
|
753
|
+
Platform.device = Devices.Mobile;
|
|
662
754
|
}
|
|
663
|
-
|
|
664
|
-
if (Platform.os.name === OS.Windows)
|
|
665
|
-
Platform.os.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
666
|
-
else
|
|
667
|
-
Platform.os.version = platformVersion;
|
|
755
|
+
catch (_) {
|
|
668
756
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
Platform.os.name = OS.Android;
|
|
672
|
-
else if (/ios|iphone|ipad/i.test(platform))
|
|
673
|
-
Platform.os.name = OS.iOS;
|
|
674
|
-
else if (/windows|win32/i.test(platform))
|
|
675
|
-
Platform.os.name = OS.Windows;
|
|
676
|
-
else if (/macos|macintel/i.test(platform))
|
|
677
|
-
Platform.os.name = OS.MacOS;
|
|
757
|
+
finally {
|
|
758
|
+
decrementPendingTasks();
|
|
678
759
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
});
|
|
760
|
+
})
|
|
761
|
+
.catch(decrementPendingTasks);
|
|
682
762
|
}
|
|
763
|
+
checkReady();
|
|
683
764
|
}
|
|
684
765
|
init();
|
|
685
766
|
|
|
@@ -75,15 +75,24 @@
|
|
|
75
75
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
76
76
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
77
77
|
|
|
78
|
+
var readyState = 'loading';
|
|
79
|
+
var readyCallback = [];
|
|
80
|
+
var pendingTasks = 0;
|
|
78
81
|
var Platform = {
|
|
79
82
|
os: { name: OS.Unknown, version: '' },
|
|
80
83
|
engine: { name: Engines.Unknown, version: '' },
|
|
81
84
|
browser: { name: Browsers.Unknown, version: '' },
|
|
82
85
|
crossPlatformFramework: CrossPlatformFramework.Unknown,
|
|
83
86
|
userAgent: USER_AGENT,
|
|
87
|
+
get readyState() {
|
|
88
|
+
return readyState;
|
|
89
|
+
},
|
|
84
90
|
get network() {
|
|
85
91
|
return getNetwork();
|
|
86
92
|
},
|
|
93
|
+
get dimension() {
|
|
94
|
+
return getDimension();
|
|
95
|
+
},
|
|
87
96
|
get device() {
|
|
88
97
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
89
98
|
return Devices.Mobile;
|
|
@@ -113,6 +122,18 @@
|
|
|
113
122
|
return false;
|
|
114
123
|
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
115
124
|
},
|
|
125
|
+
onready: function (callback) {
|
|
126
|
+
if (this.readyState === 'complete') {
|
|
127
|
+
try {
|
|
128
|
+
callback(this);
|
|
129
|
+
}
|
|
130
|
+
catch (_) {
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
readyCallback.push(callback);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
116
137
|
};
|
|
117
138
|
var OS_RESOLVER_MAP = [
|
|
118
139
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -180,6 +201,26 @@
|
|
|
180
201
|
'HeadlessChrome': 'Chrome Headless',
|
|
181
202
|
'OperaMobile': 'Opera Mobi',
|
|
182
203
|
};
|
|
204
|
+
function incrementPendingTasks() {
|
|
205
|
+
pendingTasks++;
|
|
206
|
+
}
|
|
207
|
+
function decrementPendingTasks() {
|
|
208
|
+
pendingTasks--;
|
|
209
|
+
checkReady();
|
|
210
|
+
}
|
|
211
|
+
function checkReady() {
|
|
212
|
+
if (pendingTasks === 0 && readyState === 'loading') {
|
|
213
|
+
readyState = 'complete';
|
|
214
|
+
for (var i = 0; i < readyCallback.length; i++) {
|
|
215
|
+
try {
|
|
216
|
+
readyCallback[i](Platform);
|
|
217
|
+
}
|
|
218
|
+
catch (_) {
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
readyCallback.length = 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
183
224
|
function resolveWindowsVersion(string) {
|
|
184
225
|
if (string === undefined)
|
|
185
226
|
return '';
|
|
@@ -380,6 +421,7 @@
|
|
|
380
421
|
break;
|
|
381
422
|
}
|
|
382
423
|
}
|
|
424
|
+
decrementPendingTasks();
|
|
383
425
|
}
|
|
384
426
|
function getRenderer() {
|
|
385
427
|
if (typeof globalThis.document === 'undefined')
|
|
@@ -489,8 +531,40 @@
|
|
|
489
531
|
}
|
|
490
532
|
return network;
|
|
491
533
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
534
|
+
function getDimension() {
|
|
535
|
+
var dimension = {
|
|
536
|
+
innerWidth: -1,
|
|
537
|
+
innerHeight: -1,
|
|
538
|
+
outerWidth: -1,
|
|
539
|
+
outerHeight: -1,
|
|
540
|
+
scale: 1,
|
|
541
|
+
};
|
|
542
|
+
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
543
|
+
dimension.innerWidth = globalThis.innerWidth;
|
|
544
|
+
dimension.innerHeight = globalThis.innerHeight;
|
|
545
|
+
dimension.outerWidth = globalThis.outerWidth;
|
|
546
|
+
dimension.outerHeight = globalThis.outerHeight;
|
|
547
|
+
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
548
|
+
return dimension;
|
|
549
|
+
}
|
|
550
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
551
|
+
try {
|
|
552
|
+
var reactNative = require('react-native');
|
|
553
|
+
var dimensions = reactNative.Dimensions;
|
|
554
|
+
var pixelRatio = reactNative.PixelRatio;
|
|
555
|
+
var screenDimensions = dimensions.get('screen');
|
|
556
|
+
var windowDimensions = dimensions.get('window');
|
|
557
|
+
dimension.innerWidth = screenDimensions.width;
|
|
558
|
+
dimension.innerHeight = screenDimensions.height;
|
|
559
|
+
dimension.outerWidth = windowDimensions.width;
|
|
560
|
+
dimension.outerHeight = windowDimensions.height;
|
|
561
|
+
dimension.scale = pixelRatio.get();
|
|
562
|
+
return dimension;
|
|
563
|
+
}
|
|
564
|
+
catch (_) {
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return dimension;
|
|
494
568
|
}
|
|
495
569
|
function init() {
|
|
496
570
|
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
@@ -631,61 +705,68 @@
|
|
|
631
705
|
globalThis.document.addEventListener("deviceready", parseOSFromCordova, false);
|
|
632
706
|
}
|
|
633
707
|
}
|
|
634
|
-
if (
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
.userAgentData
|
|
638
|
-
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
708
|
+
if (typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgentData !== 'undefined' && typeof globalThis.navigator.userAgentData.getHighEntropyValues !== 'undefined') {
|
|
709
|
+
incrementPendingTasks();
|
|
710
|
+
globalThis.navigator.userAgentData.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
639
711
|
.then(function (result) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
var
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
712
|
+
try {
|
|
713
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
714
|
+
var platformVersion = result.platformVersion;
|
|
715
|
+
var platform = result.platform;
|
|
716
|
+
var browserName = Platform.browser.name;
|
|
717
|
+
var prevBrandName = null;
|
|
718
|
+
for (var i = 0; i < brands.length; i++) {
|
|
719
|
+
var brand = normalizeBrand(brands[i]);
|
|
720
|
+
var brandVersion = brand.version;
|
|
721
|
+
var brandName = brand.brand;
|
|
722
|
+
if (/not.a.brand/i.test(brandName))
|
|
723
|
+
continue;
|
|
724
|
+
if (prevBrandName === null || (/Chrom/.test(prevBrandName) && brandName !== 'Chromium') || (prevBrandName === 'Edge' && /WebView2/.test(brandName))) {
|
|
725
|
+
brandName = HIGH_ENTROPY_BRAND_NAME_MAP[brandName] || brandName;
|
|
726
|
+
prevBrandName = browserName;
|
|
727
|
+
if (prevBrandName === null || /Chrom/.test(prevBrandName) || !/Chrom/.test(brandName)) {
|
|
728
|
+
browserName = brandName;
|
|
729
|
+
if (browserName === 'Chrome' || browserName === 'Chrome WebView' || browserName === 'Chrome Headless')
|
|
730
|
+
Platform.browser.name = Browsers.Chrome;
|
|
731
|
+
else if (browserName === 'Edge' || browserName === 'Edge WebView2')
|
|
732
|
+
Platform.browser.name = Browsers.Edge;
|
|
733
|
+
else if (browserName === 'Opera Mobi')
|
|
734
|
+
Platform.browser.name = Browsers.Opera;
|
|
735
|
+
Platform.browser.version = brandVersion;
|
|
736
|
+
}
|
|
737
|
+
prevBrandName = brandName;
|
|
663
738
|
}
|
|
664
|
-
|
|
739
|
+
if (brandName === 'Chromium')
|
|
740
|
+
Platform.engine.version = brandVersion;
|
|
741
|
+
}
|
|
742
|
+
if (typeof platformVersion === 'string') {
|
|
743
|
+
if (Platform.os.name === OS.Windows)
|
|
744
|
+
Platform.os.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
745
|
+
else
|
|
746
|
+
Platform.os.version = platformVersion;
|
|
747
|
+
}
|
|
748
|
+
if (typeof platform === 'string') {
|
|
749
|
+
if (/android/i.test(platform))
|
|
750
|
+
Platform.os.name = OS.Android;
|
|
751
|
+
else if (/ios|iphone|ipad/i.test(platform))
|
|
752
|
+
Platform.os.name = OS.iOS;
|
|
753
|
+
else if (/windows|win32/i.test(platform))
|
|
754
|
+
Platform.os.name = OS.Windows;
|
|
755
|
+
else if (/macos|macintel/i.test(platform))
|
|
756
|
+
Platform.os.name = OS.MacOS;
|
|
665
757
|
}
|
|
666
|
-
if (
|
|
667
|
-
Platform.
|
|
758
|
+
if (result.mobile === true)
|
|
759
|
+
Platform.device = Devices.Mobile;
|
|
668
760
|
}
|
|
669
|
-
|
|
670
|
-
if (Platform.os.name === OS.Windows)
|
|
671
|
-
Platform.os.version = parseInt(platformVersion.split('.')[0], 10) >= 13 ? '11' : '10';
|
|
672
|
-
else
|
|
673
|
-
Platform.os.version = platformVersion;
|
|
761
|
+
catch (_) {
|
|
674
762
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
Platform.os.name = OS.Android;
|
|
678
|
-
else if (/ios|iphone|ipad/i.test(platform))
|
|
679
|
-
Platform.os.name = OS.iOS;
|
|
680
|
-
else if (/windows|win32/i.test(platform))
|
|
681
|
-
Platform.os.name = OS.Windows;
|
|
682
|
-
else if (/macos|macintel/i.test(platform))
|
|
683
|
-
Platform.os.name = OS.MacOS;
|
|
763
|
+
finally {
|
|
764
|
+
decrementPendingTasks();
|
|
684
765
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
});
|
|
766
|
+
})
|
|
767
|
+
.catch(decrementPendingTasks);
|
|
688
768
|
}
|
|
769
|
+
checkReady();
|
|
689
770
|
}
|
|
690
771
|
init();
|
|
691
772
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,o,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",a={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:o.Unknown,version:""},crossPlatformFramework:i.Unknown,userAgent:t,get network(){return function(){var n={isOnline:null,effectiveType:null,type:null,downlink:null,rtt:null,saveData:null};if(void 0!==globalThis.navigator){void 0!==globalThis.navigator.onLine&&(n.isOnline=globalThis.navigator.onLine);var r=globalThis.navigator.connection||globalThis.navigator.mozConnection||globalThis.navigator.webkitConnection;void 0!==r&&(void 0!==r.effectiveType&&(n.effectiveType=r.effectiveType),void 0!==r.type&&(n.type=r.type),void 0!==r.downlink&&(n.downlink=r.downlink),void 0!==r.rtt&&(n.rtt=r.rtt),void 0!==r.saveData&&(n.saveData=r.saveData))}if(a.isNode){try{for(var o=require("os").networkInterfaces(),i=Object.keys(o),t=0;t<i.length;t++){for(var l=o[i[t]],s=0;s<l.length;s++){var u=l[s];u.internal||"IPv4"!==u.family||(n.isOnline=!0)}if(n.isOnline)break}}catch(e){}try{var c=require("child_process");if(a.os.name===e.Windows){try{(d=c.execSync("netsh wlan show interfaces",{encoding:"utf8",timeout:5e3})).includes("State")&&d.includes("connected")&&(n.type="wifi")}catch(e){}if(null===n.type)try{(d=c.execSync("ipconfig",{encoding:"utf8",timeout:5e3})).includes("Ethernet adapter")&&(n.type="ethernet")}catch(e){}null===n.type&&(n.type="other")}else if(a.os.name===e.MacOS)try{var d=c.execSync("networksetup -listallhardwareports",{encoding:"utf8",timeout:5e3}),m=c.execSync("route -n get default | grep interface",{encoding:"utf8",timeout:5e3});m.includes("en0")&&d.includes("Wi-Fi")?n.type="wifi":m.includes("en")||d.includes("Ethernet")?n.type="ethernet":n.type="other"}catch(e){n.type="other"}}catch(e){}}return n}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?n.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?n.Desktop:n.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isMobile(){return this.device===n.Mobile},get isDesktop(){return this.device===n.Desktop},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches}},l=[[/windows nt (6\.[23]); arm/i,e.Windows,d],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,d],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,d],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,d],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,d],[/windows ce\/?([\d.]*)/i,e.Windows,d],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,m],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,m],[/cfnetwork\/.+darwin/i,e.iOS,m],[/mac os x ?([\w. ]*)/i,e.MacOS,m],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,m],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],s=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],u=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]],c={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"};function d(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function m(e){return void 0===e?"":e.replace(/_/g,".")}function f(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function b(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}function v(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}function w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}function h(){if(a.crossPlatformFramework=i.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":a.os={name:e.Android,version:globalThis.device.version};break;case"iOS":a.os={name:e.iOS,version:globalThis.device.version}}}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(a.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(a.crossPlatformFramework=i.ReactNative);for(var r=0;r<l.length;r++){var d=(E=l[r])[0],m=E[1],p=E[2];if(null!==(S=a.userAgent.match(d))){a.os={name:m,version:w(S[1],p)};break}}var k;for(a.os.name===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var a=void 0,l=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(l=t<o.length?parseInt(o[t],10):0))return 1;if(a<l)return-1}return 0}(a.os.version,"18.6")&&null!==(y=/\) Version\/([\d.]+)/.exec(a.userAgent))&&parseInt(y[1].substring(0,2),10)>=26&&(a.os.version=y[1]),r=0;r<s.length;r++){d=(E=s[r])[0];var T=E[1];p=E[2];if(null!==(S=a.userAgent.match(d))){a.engine={name:T,version:w(S[1],p)};break}}for(r=0;r<u.length;r++){d=(E=u[r])[0];var E,S,F=E[1];p=E[2];if(null!==(S=a.userAgent.match(d))){a.browser={name:F,version:w(S[1],p)};break}}if(a.crossPlatformFramework===i.ReactNative)try{m=(O=require("react-native").Platform).OS;var y=g(j=""+O.Version);switch(m){case"android":a.os={name:e.Android,version:v(y,j)};break;case"ios":a.os={name:e.iOS,version:j};break;case"windows":a.os={name:e.Windows,version:f(y,j)};break;case"macos":a.os={name:e.MacOS,version:j}}}catch(e){}if(a.isNode)try{var j,O=(m=require("os")).platform();y=g(j=m.release());switch(O){case"win32":a.os={name:e.Windows,version:f(y,j)};break;case"darwin":a.os={name:e.MacOS,version:b(y,j)};break;case"android":a.os={name:e.Android,version:j};break;case"linux":/android/i.test(j)&&(a.os={name:e.Android,version:j})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?h():globalThis.document.addEventListener("deviceready",h,!1)),k=globalThis.navigator,void 0!==globalThis.navigator&&void 0!==k.userAgentData&&void 0!==k.userAgentData.getHighEntropyValues&&globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){for(var i,t=r.fullVersionList||r.brands||[],l=r.platformVersion,s=r.platform,u=a.browser.name,d=null,m=0;m<t.length;m++){var f=null==(i=t[m])?{brand:"",version:""}:"string"==typeof i?{brand:i,version:""}:{brand:i.brand,version:i.version},b=f.version,v=f.brand;/not.a.brand/i.test(v)||((null===d||/Chrom/.test(d)&&"Chromium"!==v||"Edge"===d&&/WebView2/.test(v))&&(v=c[v]||v,null!==(d=u)&&!/Chrom/.test(d)&&/Chrom/.test(v)||("Chrome"===(u=v)||"Chrome WebView"===u||"Chrome Headless"===u?a.browser.name=o.Chrome:"Edge"===u||"Edge WebView2"===u?a.browser.name=o.Edge:"Opera Mobi"===u&&(a.browser.name=o.Opera),a.browser.version=b),d=v),"Chromium"===v&&(a.engine.version=b))}"string"==typeof l&&(a.os.name===e.Windows?a.os.version=parseInt(l.split(".")[0],10)>=13?"11":"10":a.os.version=l),"string"==typeof s&&(/android/i.test(s)?a.os.name=e.Android:/ios|iphone|ipad/i.test(s)?a.os.name=e.iOS:/windows|win32/i.test(s)?a.os.name=e.Windows:/macos|macintel/i.test(s)&&(a.os.name=e.MacOS)),!0===r.mobile&&(a.device=n.Mobile)}))}();var p={get enabled(){return function(){if(a.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===F){if(a.os.name!==e.iOS)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[F.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[F.element]}()},get element(){return x()},get isFullscreen(){return M()},request:W,exit:C,toggle:function(e,n){return M()?C():W(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},k=null,T=null,E=null,S=!1,F=function(){if(a.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return y.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],t=y[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var l={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:y.webkit.events};return"webkitRequestFullScreen"in e&&(l.request="webkitRequestFullScreen"),l}return null}(),y={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function j(){null!==E&&(T.fullScreenable=E.fullScreenable,T.autoHideMenuBar=E.autoHideMenuBar,E=null),T=null}function O(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function x(){if(a.crossPlatformFramework===i.Electron){if(null!==T)return T;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||a.os.name===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===F)return k&&k.webkitDisplayingFullscreen?k:null;var t=globalThis.document[F.element];return null!=t?t:null}function M(){return null!==x()}function W(n,r){if(void 0===n&&(n=function(){if(a.crossPlatformFramework===i.Electron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(a.os.name===e.iOS){var t=globalThis.document.querySelector("video");if(null===t)throw new Error;return t}return globalThis.document.documentElement}()),a.crossPlatformFramework===i.Electron){var o=n;return new Promise((function(e,n){try{return null===T&&(E={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),T=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==F){var t=n[F.request];if("function"==typeof t)try{var l=t.call(n,r);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){a.os.name===e.iOS?s():i()})):void o()}catch(n){if(a.os.name!==e.iOS)return void i()}}function s(){if(a.os.name===e.iOS&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return k=r,O(),r.webkitEnterFullscreen(),void o()}i()}s()}))}function C(){return a.crossPlatformFramework===i.Electron?new Promise((function(e,n){try{if(null!==T)T.setFullScreen(!1),j();else{var r=x();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(n,r){if(null!==F){var o=globalThis.document[F.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(a.os.name===e.iOS&&null!==k){if("function"==typeof k.webkitExitFullscreen&&!0===k.webkitDisplayingFullscreen)return k.webkitExitFullscreen(),k=null,void n();for(var t=globalThis.document.querySelectorAll("video"),l=0;l<t.length;l++){var s=t[l];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void n()}}x()?r():n()}))}return function(){if(!S){S=!0;var n=!1;if(a.crossPlatformFramework===i.Electron)try{for(var r=require("electron"),o=r.BrowserWindow.getAllWindows(),t=function(e){var n=o[e];n.on("enter-full-screen",(function(){T=n,d()})),n.on("leave-full-screen",(function(){j(),d()}))},l=0;l<o.length;l++)t(l);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){T=n,d()})),n.on("leave-full-screen",(function(){j(),d()}))}))}catch(e){}var s=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],u=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(l=0;l<s.length;l++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[l],d,!1);for(l=0;l<u.length;l++)void 0!==globalThis.document&&globalThis.document.addEventListener(u[l],m,!1);if(a.os.name===e.iOS)if(O(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){O()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function c(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function d(){c("fullscreenchange")}function m(){c("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:p,Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"use strict";var e,n,r,o,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",a="loading",l=[],s=0,u={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:o.Unknown,version:""},crossPlatformFramework:i.Unknown,userAgent:t,get readyState(){return a},get network(){return function(){var n={isOnline:null,effectiveType:null,type:null,downlink:null,rtt:null,saveData:null};if(void 0!==globalThis.navigator){void 0!==globalThis.navigator.onLine&&(n.isOnline=globalThis.navigator.onLine);var r=globalThis.navigator.connection||globalThis.navigator.mozConnection||globalThis.navigator.webkitConnection;void 0!==r&&(void 0!==r.effectiveType&&(n.effectiveType=r.effectiveType),void 0!==r.type&&(n.type=r.type),void 0!==r.downlink&&(n.downlink=r.downlink),void 0!==r.rtt&&(n.rtt=r.rtt),void 0!==r.saveData&&(n.saveData=r.saveData))}if(u.isNode){try{for(var o=require("os").networkInterfaces(),i=Object.keys(o),t=0;t<i.length;t++){for(var a=o[i[t]],l=0;l<a.length;l++){var s=a[l];s.internal||"IPv4"!==s.family||(n.isOnline=!0)}if(n.isOnline)break}}catch(e){}try{var c=require("child_process");if(u.os.name===e.Windows){try{(d=c.execSync("netsh wlan show interfaces",{encoding:"utf8",timeout:5e3})).includes("State")&&d.includes("connected")&&(n.type="wifi")}catch(e){}if(null===n.type)try{(d=c.execSync("ipconfig",{encoding:"utf8",timeout:5e3})).includes("Ethernet adapter")&&(n.type="ethernet")}catch(e){}null===n.type&&(n.type="other")}else if(u.os.name===e.MacOS)try{var d=c.execSync("networksetup -listallhardwareports",{encoding:"utf8",timeout:5e3}),m=c.execSync("route -n get default | grep interface",{encoding:"utf8",timeout:5e3});m.includes("en0")&&d.includes("Wi-Fi")?n.type="wifi":m.includes("en")||d.includes("Ethernet")?n.type="ethernet":n.type="other"}catch(e){n.type="other"}}catch(e){}}return n}()},get dimension(){return function(){var e={innerWidth:-1,innerHeight:-1,outerWidth:-1,outerHeight:-1,scale:1};if(void 0!==globalThis.innerWidth)return e.innerWidth=globalThis.innerWidth,e.innerHeight=globalThis.innerHeight,e.outerWidth=globalThis.outerWidth,e.outerHeight=globalThis.outerHeight,e.scale=globalThis.devicePixelRatio||1,e;if(u.crossPlatformFramework===i.ReactNative)try{var n=require("react-native"),r=n.Dimensions,o=n.PixelRatio,t=r.get("screen"),a=r.get("window");return e.innerWidth=t.width,e.innerHeight=t.height,e.outerWidth=a.width,e.outerHeight=a.height,e.scale=o.get(),e}catch(e){}return e}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?n.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?n.Desktop:n.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isMobile(){return this.device===n.Mobile},get isDesktop(){return this.device===n.Desktop},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches},onready:function(e){if("complete"===this.readyState)try{e(this)}catch(e){}else l.push(e)}},c=[[/windows nt (6\.[23]); arm/i,e.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,h],[/windows ce\/?([\d.]*)/i,e.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,v],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,v],[/cfnetwork\/.+darwin/i,e.iOS,v],[/mac os x ?([\w. ]*)/i,e.MacOS,v],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,v],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],d=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],m=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]],f={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"};function b(){s--,g()}function g(){if(0===s&&"loading"===a){a="complete";for(var e=0;e<l.length;e++)try{l[e](u)}catch(e){}l.length=0}}function h(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function v(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function p(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}function k(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}function T(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function E(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}function S(){if(u.crossPlatformFramework=i.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":u.os={name:e.Android,version:globalThis.device.version};break;case"iOS":u.os={name:e.iOS,version:globalThis.device.version}}b()}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(u.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(u.crossPlatformFramework=i.ReactNative);for(var r=0;r<c.length;r++){var a=(y=c[r])[0],l=y[1],h=y[2];if(null!==(F=u.userAgent.match(a))){u.os={name:l,version:T(F[1],h)};break}}for(u.os.name===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var a=void 0,l=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(l=t<o.length?parseInt(o[t],10):0))return 1;if(a<l)return-1}return 0}(u.os.version,"18.6")&&null!==(x=/\) Version\/([\d.]+)/.exec(u.userAgent))&&parseInt(x[1].substring(0,2),10)>=26&&(u.os.version=x[1]),r=0;r<d.length;r++){a=(y=d[r])[0];var v=y[1];h=y[2];if(null!==(F=u.userAgent.match(a))){u.engine={name:v,version:T(F[1],h)};break}}for(r=0;r<m.length;r++){a=(y=m[r])[0];var y,F,j=y[1];h=y[2];if(null!==(F=u.userAgent.match(a))){u.browser={name:j,version:T(F[1],h)};break}}if(u.crossPlatformFramework===i.ReactNative)try{l=(W=require("react-native").Platform).OS;var x=E(O=""+W.Version);switch(l){case"android":u.os={name:e.Android,version:k(x,O)};break;case"ios":u.os={name:e.iOS,version:O};break;case"windows":u.os={name:e.Windows,version:w(x,O)};break;case"macos":u.os={name:e.MacOS,version:O}}}catch(e){}if(u.isNode)try{var O,W=(l=require("os")).platform();x=E(O=l.release());switch(W){case"win32":u.os={name:e.Windows,version:w(x,O)};break;case"darwin":u.os={name:e.MacOS,version:p(x,O)};break;case"android":u.os={name:e.Android,version:O};break;case"linux":/android/i.test(O)&&(u.os={name:e.Android,version:O})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?S():globalThis.document.addEventListener("deviceready",S,!1)),void 0!==globalThis.navigator&&void 0!==globalThis.navigator.userAgentData&&void 0!==globalThis.navigator.userAgentData.getHighEntropyValues&&(s++,globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){try{for(var i=r.fullVersionList||r.brands||[],t=r.platformVersion,a=r.platform,l=u.browser.name,s=null,c=0;c<i.length;c++){var d=null==(h=i[c])?{brand:"",version:""}:"string"==typeof h?{brand:h,version:""}:{brand:h.brand,version:h.version},m=d.version,g=d.brand;/not.a.brand/i.test(g)||((null===s||/Chrom/.test(s)&&"Chromium"!==g||"Edge"===s&&/WebView2/.test(g))&&(g=f[g]||g,null!==(s=l)&&!/Chrom/.test(s)&&/Chrom/.test(g)||("Chrome"===(l=g)||"Chrome WebView"===l||"Chrome Headless"===l?u.browser.name=o.Chrome:"Edge"===l||"Edge WebView2"===l?u.browser.name=o.Edge:"Opera Mobi"===l&&(u.browser.name=o.Opera),u.browser.version=m),s=g),"Chromium"===g&&(u.engine.version=m))}"string"==typeof t&&(u.os.name===e.Windows?u.os.version=parseInt(t.split(".")[0],10)>=13?"11":"10":u.os.version=t),"string"==typeof a&&(/android/i.test(a)?u.os.name=e.Android:/ios|iphone|ipad/i.test(a)?u.os.name=e.iOS:/windows|win32/i.test(a)?u.os.name=e.Windows:/macos|macintel/i.test(a)&&(u.os.name=e.MacOS)),!0===r.mobile&&(u.device=n.Mobile)}catch(e){}finally{b()}var h})).catch(b)),g()}();var y={get enabled(){return function(){if(u.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===W){if(u.os.name!==e.iOS)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[W.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[W.element]}()},get element(){return P()},get isFullscreen(){return q()},request:N,exit:R,toggle:function(e,n){return q()?R():N(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},F=null,j=null,x=null,O=!1,W=function(){if(u.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return M.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],t=M[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var a={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:M.webkit.events};return"webkitRequestFullScreen"in e&&(a.request="webkitRequestFullScreen"),a}return null}(),M={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function C(){null!==x&&(j.fullScreenable=x.fullScreenable,j.autoHideMenuBar=x.autoHideMenuBar,x=null),j=null}function A(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function P(){if(u.crossPlatformFramework===i.Electron){if(null!==j)return j;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||u.os.name===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===W)return F&&F.webkitDisplayingFullscreen?F:null;var t=globalThis.document[W.element];return null!=t?t:null}function q(){return null!==P()}function N(n,r){if(void 0===n&&(n=function(){if(u.crossPlatformFramework===i.Electron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(u.os.name===e.iOS){var t=globalThis.document.querySelector("video");if(null===t)throw new Error;return t}return globalThis.document.documentElement}()),u.crossPlatformFramework===i.Electron){var o=n;return new Promise((function(e,n){try{return null===j&&(x={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),j=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==W){var t=n[W.request];if("function"==typeof t)try{var a=t.call(n,r);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){u.os.name===e.iOS?l():i()})):void o()}catch(n){if(u.os.name!==e.iOS)return void i()}}function l(){if(u.os.name===e.iOS&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return F=r,A(),r.webkitEnterFullscreen(),void o()}i()}l()}))}function R(){return u.crossPlatformFramework===i.Electron?new Promise((function(e,n){try{if(null!==j)j.setFullScreen(!1),C();else{var r=P();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(n,r){if(null!==W){var o=globalThis.document[W.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(u.os.name===e.iOS&&null!==F){if("function"==typeof F.webkitExitFullscreen&&!0===F.webkitDisplayingFullscreen)return F.webkitExitFullscreen(),F=null,void n();for(var t=globalThis.document.querySelectorAll("video"),a=0;a<t.length;a++){var l=t[a];if("function"==typeof l.webkitExitFullscreen&&!0===l.webkitDisplayingFullscreen)return l.webkitExitFullscreen(),void n()}}P()?r():n()}))}return function(){if(!O){O=!0;var n=!1;if(u.crossPlatformFramework===i.Electron)try{for(var r=require("electron"),o=r.BrowserWindow.getAllWindows(),t=function(e){var n=o[e];n.on("enter-full-screen",(function(){j=n,d()})),n.on("leave-full-screen",(function(){C(),d()}))},a=0;a<o.length;a++)t(a);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){j=n,d()})),n.on("leave-full-screen",(function(){C(),d()}))}))}catch(e){}var l=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(a=0;a<l.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(l[a],d,!1);for(a=0;a<s.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[a],m,!1);if(u.os.name===e.iOS)if(A(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){A()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function c(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function d(){c("fullscreenchange")}function m(){c("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}}}));
|
|
@@ -6,13 +6,16 @@ export declare interface PlatformInstance {
|
|
|
6
6
|
device: Devices;
|
|
7
7
|
crossPlatformFramework: CrossPlatformFramework;
|
|
8
8
|
network: Network;
|
|
9
|
+
dimension: Dimension;
|
|
9
10
|
renderer: string;
|
|
10
11
|
userAgent: string;
|
|
12
|
+
readyState: 'loading' | 'complete';
|
|
11
13
|
isNode: boolean;
|
|
12
14
|
isStandalone: boolean;
|
|
13
15
|
isMobile: boolean;
|
|
14
16
|
isDesktop: boolean;
|
|
15
17
|
isWebview: boolean;
|
|
18
|
+
onready(callback: (platform: PlatformInstance) => void): void;
|
|
16
19
|
}
|
|
17
20
|
export declare interface NameVersionPair<T> {
|
|
18
21
|
name: T;
|
|
@@ -26,3 +29,10 @@ export declare interface Network {
|
|
|
26
29
|
rtt: number | null;
|
|
27
30
|
saveData: boolean | null;
|
|
28
31
|
}
|
|
32
|
+
export declare interface Dimension {
|
|
33
|
+
outerWidth: number;
|
|
34
|
+
outerHeight: number;
|
|
35
|
+
innerWidth: number;
|
|
36
|
+
innerHeight: number;
|
|
37
|
+
scale: number;
|
|
38
|
+
}
|