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?
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.