native-fn 1.0.59 → 1.0.61
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/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/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/clipboard/index.cjs +4 -1
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +4 -1
- package/dist/plugin/clipboard/index.umd.js +4 -1
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- 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/fullscreen/index.cjs +37 -16
- package/dist/plugin/fullscreen/index.d.ts +13 -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 +37 -16
- package/dist/plugin/fullscreen/index.umd.js +37 -16
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- 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/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/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/package.json +1 -1
|
@@ -542,15 +542,31 @@
|
|
|
542
542
|
}
|
|
543
543
|
return null;
|
|
544
544
|
}
|
|
545
|
-
function isIOS() {
|
|
546
|
-
return OS.iOS === Platform.os;
|
|
547
|
-
}
|
|
548
545
|
function createFullscreenUtils() {
|
|
549
546
|
var api = detectApi();
|
|
550
547
|
var lastIOSVideo = null;
|
|
551
548
|
var lastElectronBrowserWindow = null;
|
|
552
549
|
var lastElectronBrowserWindowOptions = null;
|
|
553
550
|
var eventsBridged = false;
|
|
551
|
+
function getDefaultTarget() {
|
|
552
|
+
if (Platform.isElectron) {
|
|
553
|
+
var electron = require('electron');
|
|
554
|
+
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
555
|
+
if (focusedWindow !== null)
|
|
556
|
+
return focusedWindow;
|
|
557
|
+
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
558
|
+
if (allWindows.length === 0)
|
|
559
|
+
throw new Error();
|
|
560
|
+
return allWindows[0];
|
|
561
|
+
}
|
|
562
|
+
if (OS.iOS === Platform.os) {
|
|
563
|
+
var video = globalThis.document.querySelector('video');
|
|
564
|
+
if (video === null)
|
|
565
|
+
throw new Error();
|
|
566
|
+
return video;
|
|
567
|
+
}
|
|
568
|
+
return globalThis.document.documentElement;
|
|
569
|
+
}
|
|
554
570
|
function restoreElectronBrowserWindowOptions() {
|
|
555
571
|
if (lastElectronBrowserWindowOptions !== null) {
|
|
556
572
|
lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
|
|
@@ -577,6 +593,9 @@
|
|
|
577
593
|
function emitChange() {
|
|
578
594
|
emit('fullscreenchange');
|
|
579
595
|
}
|
|
596
|
+
function emitError() {
|
|
597
|
+
emit('fullscreenerror');
|
|
598
|
+
}
|
|
580
599
|
if (Platform.isElectron) {
|
|
581
600
|
try {
|
|
582
601
|
var electron = require('electron');
|
|
@@ -619,9 +638,9 @@
|
|
|
619
638
|
}
|
|
620
639
|
for (var i = 0; i < errorEvents.length; i++) {
|
|
621
640
|
if (typeof globalThis.document !== 'undefined')
|
|
622
|
-
globalThis.document.addEventListener(errorEvents[i],
|
|
641
|
+
globalThis.document.addEventListener(errorEvents[i], emitError, false);
|
|
623
642
|
}
|
|
624
|
-
if (
|
|
643
|
+
if (OS.iOS === Platform.os) {
|
|
625
644
|
bridgeIOSVideoEvents();
|
|
626
645
|
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
627
646
|
var observer = new MutationObserver(function () {
|
|
@@ -657,7 +676,7 @@
|
|
|
657
676
|
}
|
|
658
677
|
}
|
|
659
678
|
if (api === null) {
|
|
660
|
-
if (
|
|
679
|
+
if (OS.iOS !== Platform.os)
|
|
661
680
|
return false;
|
|
662
681
|
var videos = globalThis.document.querySelectorAll('video');
|
|
663
682
|
for (var i = 0; i < videos.length; i++) {
|
|
@@ -704,19 +723,21 @@
|
|
|
704
723
|
return getElement() !== null;
|
|
705
724
|
}
|
|
706
725
|
function request(target, options) {
|
|
726
|
+
if (target === void 0) { target = getDefaultTarget(); }
|
|
707
727
|
if (Platform.isElectron) {
|
|
728
|
+
var browserWindow_1 = target;
|
|
708
729
|
return new Promise(function (resolve, reject) {
|
|
709
730
|
try {
|
|
710
731
|
if (lastElectronBrowserWindow === null) {
|
|
711
732
|
lastElectronBrowserWindowOptions = {
|
|
712
|
-
fullScreenable:
|
|
713
|
-
autoHideMenuBar:
|
|
733
|
+
fullScreenable: browserWindow_1.fullScreenable,
|
|
734
|
+
autoHideMenuBar: browserWindow_1.autoHideMenuBar,
|
|
714
735
|
};
|
|
715
|
-
|
|
716
|
-
|
|
736
|
+
browserWindow_1.fullScreenable = true;
|
|
737
|
+
browserWindow_1.autoHideMenuBar = true;
|
|
717
738
|
}
|
|
718
|
-
|
|
719
|
-
lastElectronBrowserWindow =
|
|
739
|
+
browserWindow_1.setFullScreen(true);
|
|
740
|
+
lastElectronBrowserWindow = browserWindow_1;
|
|
720
741
|
resolve();
|
|
721
742
|
return;
|
|
722
743
|
}
|
|
@@ -737,7 +758,7 @@
|
|
|
737
758
|
resolve();
|
|
738
759
|
})
|
|
739
760
|
.catch(function () {
|
|
740
|
-
if (
|
|
761
|
+
if (OS.iOS !== Platform.os) {
|
|
741
762
|
reject();
|
|
742
763
|
return;
|
|
743
764
|
}
|
|
@@ -751,7 +772,7 @@
|
|
|
751
772
|
}
|
|
752
773
|
}
|
|
753
774
|
catch (error) {
|
|
754
|
-
if (
|
|
775
|
+
if (OS.iOS !== Platform.os) {
|
|
755
776
|
reject();
|
|
756
777
|
return;
|
|
757
778
|
}
|
|
@@ -759,7 +780,7 @@
|
|
|
759
780
|
}
|
|
760
781
|
}
|
|
761
782
|
function fallbackToIOSVideo() {
|
|
762
|
-
if (
|
|
783
|
+
if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
|
|
763
784
|
var video = target;
|
|
764
785
|
if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
|
|
765
786
|
lastIOSVideo = video;
|
|
@@ -815,7 +836,7 @@
|
|
|
815
836
|
}
|
|
816
837
|
}
|
|
817
838
|
}
|
|
818
|
-
if (
|
|
839
|
+
if (OS.iOS === Platform.os && lastIOSVideo !== null) {
|
|
819
840
|
if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
|
|
820
841
|
lastIOSVideo.webkitExitFullscreen();
|
|
821
842
|
lastIOSVideo = null;
|
|
@@ -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;!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={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/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]],s=[[/\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]];function u(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 c(e){return void 0===e?"":e.replace(/_/g,".")}function d(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 m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(t.osVersion=T[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var T=f(j=""+S.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(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?"4.4W":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}(T,j);break;case"ios":t.os=e.iOS,t.osVersion=j;break;case"windows":t.os=e.Windows,t.osVersion=d(T,j);break;case"macos":t.os=e.MacOS,t.osVersion=j}}catch(e){}if(t.isNodeJS)try{var j,S=(g=require("os")).platform();T=f(j=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(T,j);break;case"darwin":t.os=e.MacOS,t.osVersion=function(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}(T,j);break;case"android":t.os=e.Android,t.osVersion=j;break;case"linux":/android/i.test(j)&&(t.os=e.Android,t.osVersion=j)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={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 x(){return e.iOS===t.os}var y=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){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 u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(e,l){return t.isElectron?new Promise((function(n,r){try{return null===o&&(i={fullScreenable:e.fullScreenable,autoHideMenuBar:e.autoHideMenuBar},e.fullScreenable=!0,e.autoHideMenuBar=!0),e.setFullScreen(!0),o=e,void n()}catch(e){r()}})):new Promise((function(o,i){if(null!==n){var t=e[n.request];if("function"==typeof t)try{var a=t.call(e,l);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){x()?u():i()})):void o()}catch(e){if(!x())return void i()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}u()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(e,o){if(null!==n){var i=globalThis.document[n.exit];if("function"==typeof i){var t=i.call(globalThis.document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var l=globalThis.document.querySelectorAll("video"),a=0;a<l.length;a++){var s=l[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void e()}}u()?o():e()}))}return function(){if(!l){l=!0;var e=!1;if(t.isElectron)try{for(var n=require("electron"),r=n.BrowserWindow.getAllWindows(),i=function(e){var n=r[e];n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))},u=0;u<r.length;u++)i(u);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))}))}catch(e){}var c=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],d=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(u=0;u<c.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(c[u],m,!1);for(u=0;u<d.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[u],m,!1);if(x())if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function m(){var n;n="fullscreenchange",e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:y,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;!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={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/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]],s=[[/\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]];function u(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 c(e){return void 0===e?"":e.replace(/_/g,".")}function d(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 m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(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?"4.4W":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}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(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}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={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"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){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 u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){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(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(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 b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}}}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface Electron {
|
|
2
|
+
BrowserWindow: BrowserWindow;
|
|
3
|
+
}
|
|
4
|
+
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
5
|
+
export declare type IsElectron = typeof process extends {
|
|
6
|
+
versions: {
|
|
7
|
+
electron: string;
|
|
8
|
+
};
|
|
9
|
+
} ? true : false;
|
|
10
|
+
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FullscreenTarget } from "./fullscreen-electron";
|
|
1
2
|
export declare interface FullscreenInstance {
|
|
2
3
|
enabled: boolean;
|
|
3
|
-
element:
|
|
4
|
+
element: FullscreenTarget | null;
|
|
4
5
|
isFullscreen: boolean;
|
|
5
|
-
request(target
|
|
6
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
6
7
|
exit(): Promise<void>;
|
|
7
|
-
toggle(target
|
|
8
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
8
9
|
onChange(handler: (event: Event) => void): () => void;
|
|
9
10
|
onError(handler: (event: Event) => void): () => void;
|
|
10
11
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface Electron {
|
|
2
|
+
BrowserWindow: BrowserWindow;
|
|
3
|
+
}
|
|
4
|
+
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
5
|
+
export declare type IsElectron = typeof process extends {
|
|
6
|
+
versions: {
|
|
7
|
+
electron: string;
|
|
8
|
+
};
|
|
9
|
+
} ? true : false;
|
|
10
|
+
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FullscreenTarget } from "./fullscreen-electron";
|
|
1
2
|
export declare interface FullscreenInstance {
|
|
2
3
|
enabled: boolean;
|
|
3
|
-
element:
|
|
4
|
+
element: FullscreenTarget | null;
|
|
4
5
|
isFullscreen: boolean;
|
|
5
|
-
request(target
|
|
6
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
6
7
|
exit(): Promise<void>;
|
|
7
|
-
toggle(target
|
|
8
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
8
9
|
onChange(handler: (event: Event) => void): () => void;
|
|
9
10
|
onError(handler: (event: Event) => void): () => void;
|
|
10
11
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface Electron {
|
|
2
|
+
BrowserWindow: BrowserWindow;
|
|
3
|
+
}
|
|
4
|
+
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
5
|
+
export declare type IsElectron = typeof process extends {
|
|
6
|
+
versions: {
|
|
7
|
+
electron: string;
|
|
8
|
+
};
|
|
9
|
+
} ? true : false;
|
|
10
|
+
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FullscreenTarget } from "./fullscreen-electron";
|
|
1
2
|
export declare interface FullscreenInstance {
|
|
2
3
|
enabled: boolean;
|
|
3
|
-
element:
|
|
4
|
+
element: FullscreenTarget | null;
|
|
4
5
|
isFullscreen: boolean;
|
|
5
|
-
request(target
|
|
6
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
6
7
|
exit(): Promise<void>;
|
|
7
|
-
toggle(target
|
|
8
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
8
9
|
onChange(handler: (event: Event) => void): () => void;
|
|
9
10
|
onError(handler: (event: Event) => void): () => void;
|
|
10
11
|
}
|