PennController for IBEX › Forums › Support › Safari Compatibility › Reply To: Safari Compatibility
July 7, 2020 at 12:06 pm
#5758
Ncomeau
Participant
Code that properly exits fullscreen for me (for some reason adding .documentElement breaks it):
newFunction( ()=> {
if (document.exitFullscreen)
document.exitFullscreen();
else if (document.mozCancelFullScreen) /* Firefox */
document.mozCancelFullScreen();
else if (document.webkitExitFullscreen) /* Chrome, Safari and Opera */
document.webkitExitFullscreen();
else if (document.msExitFullscreen) /* IE/Edge */
document.msExitFullscreen();
}).call()