Chrome dev tools sizing incorrectly

Viewed 5111

I'm making a Cordova app and I've recently started experimenting with testing it in Chrome dev tools. I'm emulating touch events, and that's working fine. But when emulating the device screen resolution, things started to get weird. I'm working with an iPhone 5 screen right now, and the device size I use for that is 320x568. In Chrome dev tools, I set the device resolution to 320x568. When running the app in Chrome, everything is twice as small as it should be. So I ran width and height operations on the window, document, and screen objects.

$(window).width() returned 640

$(window).height() returned 1135

$(document).width() returned 1280

$(document).height() returned 1136

screen.width returned 320

screen.height returned 568

screen.width and screen.height are correct. The window width and height are ~double, and the document dimensions are just weird. I'm not sure what's wrong with them or what's causing this. It's my understanding that everything should be 320x568. What can I do to make sure of this?

0 Answers
Related