Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer 11 doesn't enter fullscreen via Fullscreen API

I am trying to use fullscreen api. API works correctly all other browsers, but unfortunately ie11 doesn't response. I am using this code which has copied from here:

var element = $doc.documentElement;
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;

    if (requestMethod) 
    { // Native full screen.
        console.log(requestMethod);
        requestMethod.call(element);
    } 
    else if (requestMethod !== "undefined") 
    { // Older IE.
        console.log("window.ActiveXObject !== undefined");
        var wscript = new ActiveXObject("Wscript.shell");
        wscript.SendKeys("{F11}"); 
    }

Any suggestions?

like image 397
TarikGuren Avatar asked Dec 25 '14 13:12

TarikGuren


1 Answers

Ensure you're not using the invalid msRequestFullScreen, you need to be using the case-correct version, msRequestFullscreen. This is Microsoft specific as I think all of the other vendors made the s for the word screen uppercase.

like image 80
John Avatar answered Sep 27 '22 23:09

John