hi,
i have a page that goes full screen when loaded. i want it to stay that way - until the esc key is pressed.
the thing is - some of the keys are still working: F!, F5, F11, F12 and the windows key.
i also want - if that’s possible - do disable the right mouse button
<body onclick="myFunction()" onkeydown="myFunction()">
<script>
var news=0; // to check if new page load -> to go to full screen
function myFunction() {
// GO TO FULL SCREEN ON PAGE LOAD (OR REFRESH)
if (news==0) {
var elem = document.documentElement;
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
news = 1;
}
// give the body a new random color
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.floor(Math.random() * 16)];
}
document.body.style.backgroundColor = color;
}
</script>
</body>