File tree 1 file changed +4
-6
lines changed
packages/melonjs/src/system
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -189,12 +189,6 @@ export const hasFullscreenSupport =
189
189
( prefixed ( "fullscreenEnabled" , globalThis . document ) ||
190
190
globalThis . document . mozFullScreenEnabled ) ;
191
191
192
- if ( hasFullscreenSupport === true ) {
193
- globalThis . document . exitFullscreen =
194
- prefixed ( "cancelFullScreen" , globalThis . document ) ||
195
- prefixed ( "exitFullscreen" , globalThis . document ) ;
196
- }
197
-
198
192
/**
199
193
* Device WebAudio Support
200
194
* @memberof device
@@ -514,6 +508,10 @@ export function requestFullscreen(element) {
514
508
*/
515
509
export function exitFullscreen ( ) {
516
510
if ( hasFullscreenSupport && isFullscreen ( ) ) {
511
+ globalThis . document . exitFullscreen = prefixed (
512
+ "exitFullscreen" ,
513
+ globalThis . document ,
514
+ ) ;
517
515
globalThis . document . exitFullscreen ( ) ;
518
516
}
519
517
}
You can’t perform that action at this time.
0 commit comments