ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

When using mobile emulation, window.screen.height/width doesn't reflect phone's screen resolution #944

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
See this comment for more details:

https://code.google.com/p/chromedriver/issues/detail?id=399#c32

Original issue reported on code.google.com by samu...@chromium.org on 20 Oct 2014 at 9:47

GoogleCodeExporter commented 9 years ago
window.screen gives the screen dimensions of the screen that the browser is 
displayed on. It looks like you're getting your desktop's screen dimensions 
(1920x1080?).

When I set the screen resolution manually in DevTools' mobile emulation mode, 
it actually behaves the same as ChromeDriver. However if I set the device to 
"Google Nexus 5" (for example) then it changes window.screen to match the 
emulated device's screen resolution.

To make this simpler to use, I'm submitting a patch so that Chrome always uses 
the device's resolution for window.screen. This will be released with 
ChromeDriver 2.12.

https://codereview.chromium.org/668783002/

Original comment by samu...@chromium.org on 20 Oct 2014 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 27 Oct 2014 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:25