2
votes

I used this JavaScript code to full screen the page:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <div style="border:1px solid red;height:100px;width:100px;background-color:red;" onclick="requestFullScreen(document.body)"></div>
    <div style="border:1px solid red;height:100px;width:100px;background-color:blue;" onclick="exitFullScreen(document.body)"></div>

    <script>
        function requestFullScreen(element) {
            // Supports most browsers and their versions.
            var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;

            if (requestMethod) { // Native full screen.
                requestMethod.call(element);
            } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
                var wscript = new ActiveXObject("WScript.Shell");
                if (wscript !== null) {
                    wscript.SendKeys("{F11}");
                }
            }
        }

    </script>

    <script>
        function exitFullScreen() {
            if (document.exitFullscreen) {
                document.exitFullscreen();
            }
            else if (document.msExitFullscreen) {
                document.msExitFullscreen();
            }
            else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            }
            else if (document.webkitCancelFullScreen) {
                document.webkitCancelFullScreen();
            }
        }

    </script>
</body>
</html> 

but it show "press esc to exit full screen" in full screen mode. How to remove "press esc to exit full screen" in firefox and chrome?

2
You can't. It's a security feature designed to not let malicious sites mislead or trap a user - it's not something you can remove.Dan Smith

2 Answers

0
votes

You can't. It's a security feature designed to not let malicious sites mislead or trap a user - it's not something you can remove.

0
votes

it is supereasy - in firefox

  1. in the url bar write "about:config"
  2. agree with security risks
  3. search for "escape", it should find the entry "browser.fullscreen.exit_on_escape"
  4. doulbe click on "true", it should go to "false"

you´re done - enjoy :-)