native-fn 1.0.60 → 1.0.62
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 +198 -0
- package/dist/native.cjs +32 -7
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +32 -7
- package/dist/native.umd.js +32 -7
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +134 -89
- package/dist/plugin/app/index.d.ts +59 -7
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +134 -89
- package/dist/plugin/app/index.umd.js +134 -89
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/constants/platform.d.ts +10 -0
- package/dist/plugin/app/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/app/src/types/native.d.ts +8 -0
- package/dist/plugin/app/src/types/platform.d.ts +0 -3
- package/dist/plugin/camera/index.cjs +19 -6
- package/dist/plugin/camera/index.d.ts +150 -0
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +19 -6
- package/dist/plugin/camera/index.umd.js +19 -6
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/constants/platform.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/camera/src/types/native.d.ts +8 -0
- package/dist/plugin/camera/src/types/platform.d.ts +0 -3
- package/dist/plugin/clipboard/index.cjs +225 -212
- package/dist/plugin/clipboard/index.d.ts +135 -0
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +225 -212
- package/dist/plugin/clipboard/index.umd.js +225 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/constants/platform.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/clipboard/src/types/native.d.ts +8 -0
- package/dist/plugin/clipboard/src/types/platform.d.ts +0 -3
- package/dist/plugin/fullscreen/index.cjs +62 -28
- package/dist/plugin/fullscreen/index.d.ts +132 -3
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +62 -28
- package/dist/plugin/fullscreen/index.umd.js +62 -28
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/constants/platform.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/fullscreen/src/types/native.d.ts +8 -0
- package/dist/plugin/fullscreen/src/types/platform.d.ts +0 -3
- package/dist/plugin/theme/index.cjs +24 -11
- package/dist/plugin/theme/index.d.ts +150 -0
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +24 -11
- package/dist/plugin/theme/index.umd.js +24 -11
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/constants/platform.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/theme/src/types/native.d.ts +8 -0
- package/dist/plugin/theme/src/types/platform.d.ts +0 -3
- package/dist/src/constants/platform.d.ts +10 -0
- package/dist/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/src/types/native.d.ts +8 -0
- package/dist/src/types/platform.d.ts +0 -3
- package/package.json +1 -1
|
@@ -75,7 +75,11 @@ var Browsers;
|
|
|
75
75
|
Browsers["IE"] = "IE";
|
|
76
76
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
77
77
|
})(Browsers || (Browsers = {}));
|
|
78
|
-
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
78
|
+
var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
79
|
+
var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
80
|
+
var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
|
|
81
|
+
var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
|
|
82
|
+
var IS_CORDOVA = typeof globalThis.cordova !== 'undefined';
|
|
79
83
|
var Platform = {
|
|
80
84
|
device: Devices.Unknown,
|
|
81
85
|
os: OS.Unknown,
|
|
@@ -90,9 +94,6 @@ var Platform = {
|
|
|
90
94
|
isDesktop: false,
|
|
91
95
|
isStandalone: false,
|
|
92
96
|
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
93
|
-
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
94
|
-
isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
|
|
95
|
-
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
96
97
|
};
|
|
97
98
|
var OS_RESOLVER_MAP = [
|
|
98
99
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -402,7 +403,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
402
403
|
break;
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
|
-
if (
|
|
406
|
+
if (IS_REACT_NATIVE) {
|
|
406
407
|
try {
|
|
407
408
|
var reactNative = require('react-native');
|
|
408
409
|
var platform = reactNative.Platform;
|
|
@@ -431,7 +432,7 @@ if (Platform.isReactNative) {
|
|
|
431
432
|
catch (_) {
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
|
-
if (
|
|
435
|
+
if (IS_NODE_JS) {
|
|
435
436
|
try {
|
|
436
437
|
var os = require('os');
|
|
437
438
|
var platform = os.platform();
|
|
@@ -461,6 +462,20 @@ if (Platform.isNodeJS) {
|
|
|
461
462
|
catch (_) {
|
|
462
463
|
}
|
|
463
464
|
}
|
|
465
|
+
document.addEventListener("deviceready", function () {
|
|
466
|
+
IS_CORDOVA = true;
|
|
467
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
468
|
+
switch (globalThis.device.platform) {
|
|
469
|
+
case 'Android':
|
|
470
|
+
Platform.os = OS.Android;
|
|
471
|
+
break;
|
|
472
|
+
case 'iOS':
|
|
473
|
+
Platform.os = OS.iOS;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
Platform.osVersion = globalThis.device.version;
|
|
477
|
+
}
|
|
478
|
+
}, false);
|
|
464
479
|
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
465
480
|
navigator
|
|
466
481
|
.userAgentData
|
|
@@ -490,7 +505,7 @@ Platform.isMobile = Platform.device === Devices.Mobile;
|
|
|
490
505
|
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
491
506
|
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
492
507
|
|
|
493
|
-
function capitalize(
|
|
508
|
+
function capitalize(_) {
|
|
494
509
|
var groups = [];
|
|
495
510
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
496
511
|
groups[_i - 1] = arguments[_i];
|
|
@@ -612,7 +627,9 @@ var EventListenerUtils = {
|
|
|
612
627
|
withVender: function (target, type) {
|
|
613
628
|
if (type === undefined)
|
|
614
629
|
return '';
|
|
615
|
-
if (
|
|
630
|
+
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
631
|
+
return type;
|
|
632
|
+
if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
616
633
|
return type;
|
|
617
634
|
var types;
|
|
618
635
|
if (type in LEGACY_TYPE_MAP)
|
|
@@ -717,7 +734,7 @@ function createHiddenElement(tagName, focusable) {
|
|
|
717
734
|
|
|
718
735
|
function openURLViaHref(url, index) {
|
|
719
736
|
var top = getTopmostWindow();
|
|
720
|
-
var
|
|
737
|
+
var topDocument = top.document;
|
|
721
738
|
var a = undefined;
|
|
722
739
|
try {
|
|
723
740
|
if (index === 0) {
|
|
@@ -728,15 +745,16 @@ function openURLViaHref(url, index) {
|
|
|
728
745
|
if (a === undefined)
|
|
729
746
|
return;
|
|
730
747
|
a.href = url;
|
|
731
|
-
|
|
748
|
+
topDocument.body.appendChild(a);
|
|
732
749
|
dispatchClickEvent(a, top);
|
|
750
|
+
return a;
|
|
733
751
|
}
|
|
734
752
|
catch (_) {
|
|
735
753
|
}
|
|
736
754
|
finally {
|
|
737
755
|
if (a !== undefined) {
|
|
738
756
|
try {
|
|
739
|
-
|
|
757
|
+
topDocument.body.removeChild(a);
|
|
740
758
|
}
|
|
741
759
|
catch (_) {
|
|
742
760
|
}
|
|
@@ -745,17 +763,18 @@ function openURLViaHref(url, index) {
|
|
|
745
763
|
}
|
|
746
764
|
function openURLViaIframe(url) {
|
|
747
765
|
var top = getTopmostWindow();
|
|
766
|
+
var topDocument = top.document;
|
|
748
767
|
var iframe = undefined;
|
|
749
768
|
try {
|
|
750
769
|
iframe = createHiddenElement('iframe');
|
|
751
770
|
if (iframe === undefined)
|
|
752
771
|
return;
|
|
753
772
|
iframe.src = url;
|
|
754
|
-
|
|
773
|
+
topDocument.body.appendChild(iframe);
|
|
755
774
|
globalThis.setTimeout(function () {
|
|
756
775
|
if (iframe !== undefined) {
|
|
757
776
|
try {
|
|
758
|
-
|
|
777
|
+
topDocument.body.removeChild(iframe);
|
|
759
778
|
}
|
|
760
779
|
catch (_) {
|
|
761
780
|
}
|
|
@@ -764,27 +783,29 @@ function openURLViaIframe(url) {
|
|
|
764
783
|
}
|
|
765
784
|
catch (_) {
|
|
766
785
|
}
|
|
786
|
+
return iframe;
|
|
767
787
|
}
|
|
768
788
|
function isDocumentHidden() {
|
|
769
|
-
var
|
|
770
|
-
|
|
789
|
+
var top = getTopmostWindow();
|
|
790
|
+
var topDocument = top.document;
|
|
791
|
+
if (topDocument.visibilityState === 'hidden')
|
|
771
792
|
return true;
|
|
772
|
-
if (
|
|
793
|
+
if (topDocument.webkitVisibilityState === 'hidden')
|
|
773
794
|
return true;
|
|
774
|
-
if (
|
|
795
|
+
if (topDocument.mozVisibilityState === 'hidden')
|
|
775
796
|
return true;
|
|
776
|
-
if (
|
|
797
|
+
if (topDocument.msVisibilityState === 'hidden')
|
|
777
798
|
return true;
|
|
778
|
-
if (
|
|
779
|
-
return
|
|
780
|
-
if (
|
|
781
|
-
return
|
|
782
|
-
if (
|
|
783
|
-
return
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
786
|
-
if (typeof
|
|
787
|
-
return !
|
|
799
|
+
if (topDocument.hidden !== undefined)
|
|
800
|
+
return topDocument.hidden;
|
|
801
|
+
if (topDocument.webkitHidden !== undefined)
|
|
802
|
+
return topDocument.webkitHidden;
|
|
803
|
+
if (topDocument.mozHidden !== undefined)
|
|
804
|
+
return topDocument.mozHidden;
|
|
805
|
+
if (topDocument.msHidden !== undefined)
|
|
806
|
+
return topDocument.msHidden;
|
|
807
|
+
if (typeof topDocument.hasFocus === 'function')
|
|
808
|
+
return !topDocument.hasFocus();
|
|
788
809
|
return true;
|
|
789
810
|
}
|
|
790
811
|
function hasFocus(document) {
|
|
@@ -806,15 +827,14 @@ function focus(target) {
|
|
|
806
827
|
}
|
|
807
828
|
function restoreFocus() {
|
|
808
829
|
var top = getTopmostWindow();
|
|
809
|
-
var
|
|
830
|
+
var topDocument = top.document;
|
|
810
831
|
focus(top);
|
|
811
|
-
if (hasFocus(
|
|
832
|
+
if (hasFocus(topDocument))
|
|
812
833
|
return true;
|
|
813
|
-
if (
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
if (hasFocus(document))
|
|
834
|
+
if (topDocument.body.tabIndex < 0)
|
|
835
|
+
topDocument.body.tabIndex = -1;
|
|
836
|
+
focus(topDocument.body);
|
|
837
|
+
if (hasFocus(topDocument))
|
|
818
838
|
return true;
|
|
819
839
|
var input = undefined;
|
|
820
840
|
try {
|
|
@@ -823,14 +843,14 @@ function restoreFocus() {
|
|
|
823
843
|
return false;
|
|
824
844
|
input.type = 'text';
|
|
825
845
|
input.readOnly = true;
|
|
826
|
-
|
|
846
|
+
topDocument.body.appendChild(input);
|
|
827
847
|
focus(input);
|
|
828
848
|
try {
|
|
829
849
|
input.select();
|
|
830
850
|
}
|
|
831
851
|
catch (_) {
|
|
832
852
|
}
|
|
833
|
-
if (hasFocus(
|
|
853
|
+
if (hasFocus(topDocument))
|
|
834
854
|
return true;
|
|
835
855
|
}
|
|
836
856
|
catch (_) {
|
|
@@ -843,58 +863,69 @@ function restoreFocus() {
|
|
|
843
863
|
catch (_) {
|
|
844
864
|
}
|
|
845
865
|
try {
|
|
846
|
-
|
|
866
|
+
topDocument.body.removeChild(input);
|
|
847
867
|
}
|
|
848
868
|
catch (_) {
|
|
849
869
|
}
|
|
850
870
|
}
|
|
851
871
|
}
|
|
852
|
-
return hasFocus(
|
|
872
|
+
return hasFocus(topDocument);
|
|
853
873
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
.
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
.
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}
|
|
876
|
-
function tryOpenURLElectron(url) {
|
|
877
|
-
try {
|
|
878
|
-
var electron_1 = require('electron');
|
|
879
|
-
return new Promise(function (resolve, reject) {
|
|
880
|
-
electron_1.shell
|
|
881
|
-
.openExternal(url)
|
|
882
|
-
.then(resolve)
|
|
883
|
-
.catch(reject);
|
|
884
|
-
});
|
|
874
|
+
function tryOpenURL(url, index, timeout) {
|
|
875
|
+
if (IS_REACT_NATIVE) {
|
|
876
|
+
try {
|
|
877
|
+
var reactNative_1 = require('react-native');
|
|
878
|
+
return new Promise(function (resolve, reject) {
|
|
879
|
+
reactNative_1.Linking.canOpenURL(url)
|
|
880
|
+
.then(function (canOpen) {
|
|
881
|
+
if (canOpen) {
|
|
882
|
+
reactNative_1.Linking.openURL(url)
|
|
883
|
+
.then(resolve)
|
|
884
|
+
.catch(reject);
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
reject();
|
|
888
|
+
}
|
|
889
|
+
})
|
|
890
|
+
.catch(reject);
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
catch (_) {
|
|
894
|
+
return Promise.reject();
|
|
895
|
+
}
|
|
885
896
|
}
|
|
886
|
-
|
|
887
|
-
|
|
897
|
+
if (IS_ELECTRON) {
|
|
898
|
+
try {
|
|
899
|
+
var shell_1;
|
|
900
|
+
if (typeof globalThis.electronBridge !== 'undefined') {
|
|
901
|
+
shell_1 = globalThis.electronBridge;
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
var electron = require('electron');
|
|
905
|
+
shell_1 = electron.shell;
|
|
906
|
+
}
|
|
907
|
+
return new Promise(function (resolve, reject) {
|
|
908
|
+
shell_1
|
|
909
|
+
.openExternal(url)
|
|
910
|
+
.then(resolve)
|
|
911
|
+
.catch(reject);
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
catch (_) {
|
|
915
|
+
return Promise.reject();
|
|
916
|
+
}
|
|
888
917
|
}
|
|
889
|
-
}
|
|
890
|
-
function tryOpenURLBrowser(url, index, timeout) {
|
|
891
918
|
var top = getTopmostWindow();
|
|
892
|
-
var
|
|
919
|
+
var topDocument = top.document;
|
|
893
920
|
var eventType = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
894
921
|
var eventTarget = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
895
|
-
if (
|
|
922
|
+
if (IS_CORDOVA) {
|
|
923
|
+
eventTarget = { focus: topDocument, blur: topDocument };
|
|
924
|
+
eventType = { focus: 'resume', blur: 'pause' };
|
|
925
|
+
}
|
|
926
|
+
else if (Platform.os === OS.iOS) {
|
|
896
927
|
if (compareVersion(Platform.osVersion, '8.0') >= 0) {
|
|
897
|
-
eventTarget = { visibilitychange:
|
|
928
|
+
eventTarget = { visibilitychange: topDocument };
|
|
898
929
|
eventType = { visibilitychange: 'visibilitychange' };
|
|
899
930
|
}
|
|
900
931
|
else {
|
|
@@ -904,14 +935,16 @@ function tryOpenURLBrowser(url, index, timeout) {
|
|
|
904
935
|
}
|
|
905
936
|
else {
|
|
906
937
|
if (EventListenerUtils.useStd) {
|
|
907
|
-
eventTarget = { focus: top, blur: top, visibilitychange:
|
|
938
|
+
eventTarget = { focus: top, blur: top, visibilitychange: topDocument };
|
|
908
939
|
eventType = { focus: 'focus', blur: 'blur', visibilitychange: 'visibilitychange' };
|
|
909
940
|
}
|
|
910
941
|
else {
|
|
911
|
-
eventTarget = { focus:
|
|
942
|
+
eventTarget = { focus: topDocument, blur: topDocument, visibilitychange: topDocument };
|
|
912
943
|
eventType = { focus: 'focus', blur: 'blur', visibilitychange: 'visibilitychange' };
|
|
913
944
|
}
|
|
914
945
|
}
|
|
946
|
+
var a = undefined;
|
|
947
|
+
var iframe = undefined;
|
|
915
948
|
return new Promise(function (resolve, reject) {
|
|
916
949
|
var timeoutId;
|
|
917
950
|
var resolved = false;
|
|
@@ -927,6 +960,20 @@ function tryOpenURLBrowser(url, index, timeout) {
|
|
|
927
960
|
}
|
|
928
961
|
catch (_) {
|
|
929
962
|
}
|
|
963
|
+
if (a !== undefined) {
|
|
964
|
+
try {
|
|
965
|
+
topDocument.body.removeChild(a);
|
|
966
|
+
}
|
|
967
|
+
catch (_) {
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
if (iframe !== undefined) {
|
|
971
|
+
try {
|
|
972
|
+
topDocument.body.removeChild(iframe);
|
|
973
|
+
}
|
|
974
|
+
catch (_) {
|
|
975
|
+
}
|
|
976
|
+
}
|
|
930
977
|
}
|
|
931
978
|
function done(success) {
|
|
932
979
|
if (resolved)
|
|
@@ -963,24 +1010,22 @@ function tryOpenURLBrowser(url, index, timeout) {
|
|
|
963
1010
|
}, timeout);
|
|
964
1011
|
EventListenerUtils.add(eventTarget.blur, { type: eventType.blur, callback: onBlur });
|
|
965
1012
|
EventListenerUtils.add(eventTarget.visibilitychange, { type: eventType.visibilitychange, callback: onVisibilityChange });
|
|
966
|
-
if (!hasFocus(
|
|
1013
|
+
if (!hasFocus(topDocument))
|
|
967
1014
|
restoreFocus();
|
|
968
1015
|
try {
|
|
969
|
-
|
|
970
|
-
|
|
1016
|
+
if (IS_CORDOVA) {
|
|
1017
|
+
globalThis.open(url, '_system');
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
a = openURLViaHref(url, index);
|
|
1021
|
+
iframe = openURLViaIframe(url);
|
|
1022
|
+
}
|
|
971
1023
|
}
|
|
972
1024
|
catch (_) {
|
|
973
1025
|
done(false);
|
|
974
1026
|
}
|
|
975
1027
|
});
|
|
976
1028
|
}
|
|
977
|
-
function tryOpenURL(url, index, timeout) {
|
|
978
|
-
if (Platform.isReactNative)
|
|
979
|
-
return tryOpenURLReactNative(url);
|
|
980
|
-
if (Platform.isElectron)
|
|
981
|
-
return tryOpenURLElectron(url);
|
|
982
|
-
return tryOpenURLBrowser(url, index, timeout);
|
|
983
|
-
}
|
|
984
1029
|
|
|
985
1030
|
function createCustomError(name, Base) {
|
|
986
1031
|
if (Base === void 0) { Base = Error; }
|