I know this question might be understood as duplicate, but believe me, I have searched almost all the web and could not find an answer that fits the scope of my application. In 90% of the cases, the answer is "no, you can't due to security issues.
My application in specific was designed to be a local application. I need that the client workstation trusts my system and lets it manipulate F11 key.
I'm using ASP, jQuery, CSS3, HTML5, MySQL.
Is there any way to do that? I'm thinking of something like a Java applet.
I'm using this JavaScript code:
function toggleFullScreen() {
if ((document.fullScreenElement && document.fullScreenElement !== null) ||
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
};
Which works well, but if ESC key is pressed or any modal event occurs, it restores the viewport to its previous size.