Internet Explorer 11 does not enter full-screen mode through the full-screen API

I am trying to use fullscreen api. The API works correctly in all other browsers, but, unfortunately, ie11 is not responding. I am using this code that I copied 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?

+7
javascript internet-explorer fullscreen
source share
1 answer

Make sure you are not using invalid msRequestFullScreen , you need to use the version appropriate for the case, msRequestFullScreen . This is specific to Microsoft, because, as I think, all other manufacturers have made s for the upper case of the word.

+3
source share

All Articles