How to send an F11 on an open page on IE8.0

Asked

Viewed 36 times

0

I’m having a problem, the company I work with uses browser version IE 8.0 in windows XP, i have a code that sends a command F11 in javascript works on any browser but in this specific does not run you have any suggestion so I can do to work the code below in IE 8.0

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) {
            x = window.innerWidth
            y = window.innerHeight;
            alert(x+' - '+y);
            if(y == 916){
                wscript.SendKeys("{F11}");
            }else if(y == 1005){
                wscript.SendKeys("{F11}");
            }else{

            }


        }
    }
}
  • in IE8 + XP was not another shortcut? alt + [something]

  • So the problem I’m having in the code is that it doesn’t show me the screen dimensions width and height in the Alert that is in the code in the variable x y

  • alt + enter (still works on Edge too)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.