Issue metadata
Sign in to add a comment
|
Mobile emulator returns screen width of computer screen
Reported by
tobias.k...@dmic.fr,
Feb 20 2018
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0 Steps to reproduce the problem: 1. Run a script.js which calls screen.width in the emulator for mobile devices What is the expected behavior? Emulator should return the screen width value of the selected mobile device What went wrong? Emulator returns the screen width value of the pc screen the dev tools are running on Did this work before? Yes 63 Chrome version: Version 64.0.3282.167 (Build officiel) (64 bits) Channel: stable OS Version: 10.0 Flash Version:
,
Feb 21 2018
Thanks for filing the issue! @Reporter: Could you please share a sample test file/URL which helps us to triage the issue in a better way. Any further inputs from you end may help.
,
Feb 21 2018
It seems to have to do if running on localhost or not. - If I run a simple console.log(screen.width) (see my test.html) on localhost in the emulator (Galaxy S5) the console.log returns the 1920 px of my pc - If I run the same script on the server in the emulator (Galaxy S5) the console.log returns the 360 px of the emulated device, as expected - If I call my localhost via the local ip in our network the behavior is like on the server (360 px) So the problem seems to exist if using the emulator on localhost (as most dev environments). Thanks for looking into it!
,
Feb 21 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 22 2018
Checked the issue on reported chrome version 64.0.3282.167 and on the latest canary 65.0.3350.0 as per the feedback given in comment#3 by reporter with the below mentioned steps. 1. Launched Chrome 2. Opened DevTools->Toggle Device 3. Selected Galaxy S5 4. Given command console.log(screen.width) We observed the screen resolution of the PC initially, then after running the command "console.log(screen.width)" we got the resolution of the device. Attaching the screen shot of the same. @Reporter: Could you please clarify us on, whether getting the information about PC initially is the issue or even after running the given command in console you are getting the PC info instead of Galaxy S5 info ?. Any further inputs from your end may help us, Providing with the screen shot/screen cast would serve us better in understanding it. Thanks!
,
Feb 22 2018
Thanks for testing! I also retested and my assumption that it has to do with localhost seems to be wrong. One time I open my local test file and run additional console.logs which return the screen width of the PC (1920px), another time the same setup returns the screen width of the emulated device (360px). (See my screenshots). I can not reproduce the problem systematically myself, but I regularly see it in development now using the emulator.
,
Feb 22 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 23 2018
@Reporter: From your comment#6 it is understood that the issue is not seen consistently, could you please check the same in a new profile and let us know if the issue is still seen without any apps and extensions i.e., in a fresh profile/new person. Thanks!
,
Mar 2 2018
Closing as non-reproducible. If you manage to repro it, please reopen. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by sindhu.chelamcherla@chromium.org
, Feb 20 2018