Skip to content Skip to sidebar Skip to footer

Javascript:how To Prevent Default Exitfullscreen Event?

I find I can't understand this mechanism. I use event.preventDefault() but exitFullscreen occurs before this event captured by me. For example, I press F11, the window recover befo

Solution 1:

By design, this should not be possible, since the user always has the ability to exit fullscreen mode at any time.

While the official spec makes no mention of the cancellability of the fullscreenschange event, this behavior is clearly detailed on MDN.

Solution 2:

You can't prevent exiting fullscreen mode. It would be a security issue if a website could prevent a user from closing it.

Post a Comment for "Javascript:how To Prevent Default Exitfullscreen Event?"