1

I want JavaScript code to get real screen resolution(not browser) in Firefox & IE which is not effected with browser zoom or resize. I have search through stackoverflow, but could't get working solution from here & here. I have added jsFiddel which can get real screen size with chrome. Could anyone provide the better solution to get real screen size in FireFox & IE.

https://jsfiddle.net/k6jsp43f/3/

my screen resolution : <p id="demo"></p>

function getScreenSize(){
document.getElementById("demo").innerHTML =  screen.width + " : " +   screen.height;
}

getScreenSize();

try the get real screen resolution of the screen even browser zoom in, zoom out & by resizing the window.

I need plain javascript solution. Thank you.

Community
  • 1
  • 1
Prasad Gayan
  • 1,424
  • 17
  • 26
  • 1
    It's not accurate depending on how you want to look at it in Chrome either, I'm on a HDPI screen and it's only reporting half the pixels. It's tell me `2560 : 1440` but it's *technically* double (5K monitor) – Jorg Jan 30 '17 at 07:26
  • Yes jorg , but the above value will not change on browser zoom in chrome. But in firefox it will change with browser zoom. thanks for let me that also. – Prasad Gayan Jan 30 '17 at 07:29
  • 1
    I suppose you can try and get the zoom level too, and calculate from there: http://stackoverflow.com/questions/1713771/how-to-detect-page-zoom-level-in-all-modern-browsers. I know it's old, but it might be useful. – Jorg Jan 30 '17 at 07:37
  • thanks jorg. cant get 100% good solution form that. still looking some function. – Prasad Gayan Jan 30 '17 at 12:18

0 Answers0