I'm doing a page that when open sends the command F11 by the javascript function SendKey however I need this function only execute once someone knows how to do this, follow the code below:
function requestFullScreen() {
var el = document.body;
//alert(el);
// Supports most browsers and their versions.
var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;
//alert(requestMethod);
if(requestMethod) {
alert("TESTE1");
// Native full screen.
requestMethod.call(el);
}else if (typeof window.ActiveXObject == "undefined"){
//alert("TESTE2");
// Older IE.
var wscript = new ActiveXObject("WScript.Shell");
if(wscript !== null) {
$("#body").one('onload', function() {
wscript.SendKeys("{F11}");
});
}
}
}
html
<body onload="getDados();enviarDados();requestFullScreen();" id="body">
My idea is to leave the screen full however the page needs to update several times with my code every time it updates it sends the F11 would have some way to send it only the first time