Skip to content

Commit dac6d8f

Browse files
committed
remove call/reference to cancelFullScreen
1 parent fd68297 commit dac6d8f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/melonjs/src/system/device.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,6 @@ export const hasFullscreenSupport =
189189
(prefixed("fullscreenEnabled", globalThis.document) ||
190190
globalThis.document.mozFullScreenEnabled);
191191

192-
if (hasFullscreenSupport === true) {
193-
globalThis.document.exitFullscreen =
194-
prefixed("cancelFullScreen", globalThis.document) ||
195-
prefixed("exitFullscreen", globalThis.document);
196-
}
197-
198192
/**
199193
* Device WebAudio Support
200194
* @memberof device
@@ -514,6 +508,10 @@ export function requestFullscreen(element) {
514508
*/
515509
export function exitFullscreen() {
516510
if (hasFullscreenSupport && isFullscreen()) {
511+
globalThis.document.exitFullscreen = prefixed(
512+
"exitFullscreen",
513+
globalThis.document,
514+
);
517515
globalThis.document.exitFullscreen();
518516
}
519517
}

0 commit comments

Comments
 (0)