Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 javascript screen resolution [duplicate]

I've a strange situation. A simple code like this

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    <script>
        function checkScreen()
        {
            alert(window.screen.width);
            alert(window.screen.height);
        }
        checkScreen();
    </script>
    </head>
    <body>
    </body>
</html>

It works on all browser and it show to me my screen resolution (1920x1080) but, on IE 11 it show 1812x1029. After a search, I've not found nothing that can help me to understand why IE gets these values from js (it isn't even the viewport). If somehone can illuminate me on this situation it will be a great help. Thanks.

like image 552
Andrea V. Abbondanza Avatar asked Nov 26 '22 18:11

Andrea V. Abbondanza


1 Answers

What is the zoom level of IE? According to the MDN,

"Internet Explorer will take into account the zoom setting when reporting the screen height. It will only return the real height of the screen if the zoom is set to 100%."

like image 163
StackExchange What The Heck Avatar answered Dec 19 '22 01:12

StackExchange What The Heck