New issue
Advanced search Search tips

Issue 813789 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Mobile emulator returns screen width of computer screen

Reported by tobias.k...@dmic.fr, Feb 20 2018

Issue description

UserAgent: 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:
 
Labels: Needs-Bisect Needs-Triage-M64
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
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.

Comment 3 by tobias.k...@dmic.fr, 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!
test.html
182 bytes View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Feb 21 2018

Labels: -Needs-Feedback
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
Labels: Needs-Feedback
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!
813789.PNG
234 KB View Download

Comment 6 by tobias.k...@dmic.fr, 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.
localhost_1920.JPG
90.6 KB View Download
localhost_360.JPG
90.3 KB View Download
Project Member

Comment 7 by sheriffbot@chromium.org, Feb 22 2018

Labels: -Needs-Feedback
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
Labels: Needs-Feedback
@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!

Comment 9 by alph@chromium.org, Mar 2 2018

Owner: dgozman@chromium.org
Status: WontFix (was: Unconfirmed)
Closing as non-reproducible. If you manage to repro it, please reopen.

Sign in to add a comment