0
I’m making a page that when opening sends the F11 command by the javascript function Sendkey but need that this function only run once someone knows how to do it, 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 full screen but the page needs to update several times with my code every time it updates it sends the F11 would have some way to send only the first time
Edit your question and put your code in the code tag. For your question I suggest you use local Storage and implement its logic. Reference: https://www.w3schools.com/html/html5_webstorage.asp
– Netinho Santos
One more thing for you to read about what you want to do. https://stackoverflow.com/a/29282049/4312593
– Netinho Santos
can already do thank you
– teste1234