Click here to Skip to main content
14,775,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to open my web application in full screen mode please help me to solve this. i tries with the below code

What I have tried:

function cancelFullScreen(el) {
            var requestMethod = el.cancelFullScreen||el.webkitCancelFullScreen||el.mozCancelFullScreen||el.exitFullscreen;
            if (requestMethod) { // cancel full screen.
                requestMethod.call(el);
            } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
                var wscript = new ActiveXObject("WScript.Shell");
                if (wscript !== null) {
                    wscript.SendKeys("{F11}");
                }
            }
        }
Posted
Updated 14-Mar-20 4:06am
Comments
Dave Kreskowiak 14-Mar-20 11:11am
   
You can't. See that little mention of "ActiveXObject"? That's not supported by any modern browsers any more because of the security risks associated with using it.

You have no way of telling the browser to "fullscreen" at all.
[no name] 14-Mar-20 13:14pm
   
I tested it with same chrome version you mentioned. Anyway I deleted my answer to avoid giving wrong information.

1 solution

You can't. You have no control over the users browser window.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900