My webpage converted to full screen mode using this following code.
var element = document.getElementById(\"b\");
if (element.mozRequestFullScreen)
Any browsers complying to the standards will not (and should not) let you block this. Quite simply because it would be very intrusive and will confuse the users, who expect to always have a clear "panic button" to escape a screen.
Here are the api specifications:
Mozilla Developer Network
W3C
That's impossible from pure js. The API is designed to allow the user to exit the fullscreen mode at any time.
The only thing cou can try is to use the fullscreenchange
event to detect when the fullscreen is disabled, and then enable it again.
But the browser will probably alert the user and he will always be able to disallow your website to use fullscreen.
I don't encourage you to do it. That's really a bad idea. I would probably ragequit (and never return) a website which tries that.