-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lighthouse 5.2.0 mistakes browser window width for device width in mobile audit #9476
Comments
@paulirish this kinda looks like that Chromium test case that was erroring, that we attributed to the content shell test harness ... |
Couldn't repro on my mac. Will have to try again on my Windows machine later today. Or - can you confirm this is not specific to Windows? Could you provide the exact command you use to run LH (if using the CLI) - or are you using DevTools Audits panel? |
I used the DevTools Audits panel and originally discovered it while auditing https://thomasbrodhead.com . I then discovered the same results obtained while auditing https://www.google.com, etc. |
same problem here https://piyasa.paratic.com |
Hello, Same problem with the mobile audit with https://www.koolsol.com/, With the precedent version of lighthouse, it was the opposite ( message on desktop but not with mobile ). By the way, https://www.koolsol.com fits inside the screen size in any case so I do not see why this error should appear. Perhaps because there is a timeout() on the resize event and lighthouse does this detection before the timeout fires. Audit runs on Version 78.0.3872.0 (Build officiel) canary (64 bits) windows10. |
I'm able to repro this on mac @connorjclark. Perhaps something with our new emulation handoff isn't working properly? The screen definitely appears to be mobile but for some reason |
@patrickhulce yeah me too. For some reason my canary wasn't updating to the latest version. Definitely related to the latest changes in the emulation handoff :( |
The innerWidth is correctly set to 412px, but the outerWidth always reverts back to w/e the outerWidth is without any emulation. I thought there might be a race condition b/wn applying emulation and starting the audit, so I added a wait for 10s, but that didn't change anything. DevTools emulation itself is perfectly fine. Emulating Nexus 5x shows the correct values:
|
Using |
The protocol suggests that outerWidth is not covered: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#method-setDeviceMetricsOverride |
|
nvm this DT emulation business needs to be revisited. |
The DT frontend ends up sending i thought all that craziness might be causing our issue, so I circumvented the frontend abstractions and sent |
After digging through some IPCs and printf'ing some stack traces, I've learned that as soon as the audit starts a |
I believe @JoelEinbinder's multi-client changes will fix this issue (all the agents won't get disposed for multi-clients, but in the current impl. "there can only be one" client and agent state is lost during handoff). Notes to self: my hacky way of debugging chromium:
|
The multi-client CL just landed in Chromium. This issue will be resolved in the next canary Chrome. The first stable Chrome to resolve this issue will be Chrome 78, ETA Oct 22. |
In DevTools on the latest Canary (78.0.3894.0) - where this issue is resolved so we can once again test mobile - the Service Worker audit started failing when auditing mobile on www.bhphotovideo.com: "Does not register a service worker that controls page and start_url". @connorjclark Can it be related to this? |
@Joelsz, I see the same in Stable Chrome, so it's not related to this change. but, I did think this change could have been at fault - I am not as confident making big changes in DevTools (as opposed to for the CLI channel) because we don't have tons of test coverage in DevTools. But I am working on that - #9501 is the first step. As a sanity check, I confirmed that ToT chrome still passes all the audts on this site (except the apple thing, @exterkamp rookie numbers man ...) https://100.exterkamp.codes/ |
In stable chrome you're still having the issue where it audits desktop in the place of mobile, though it shouldn't make a difference for the Service Worker since it's shared by domain. Interestingly, I get the SW audit result random when using stable chrome and with "No throttling" it always passes. I'm thinking that it might be related to what delay the service registration might have so lighthouse can't find it early enough. Anyway thanks for your response @connorjclark. |
Ah, of course, I admit I forgot about that. We have a few different things getting fixed in DevTools recently... I did try with the CLI v5.2.0 (this doesn't use anything related to the DT changes made here), and still see that start_url fails.
yeah seems like a too-late detection issue. |
FYI @Joelsz www.bhphotovideo.com start_url specifically should be covered by #9450 and fixed by #9451 to be released in the next version of Lighthouse. |
Yes, I noticed the start_url issue is being resolved in @patrickhulce PR, just wanted to point out the audit under "Installable". Will definitely check out the linked related discussion. Thanks. |
Lighthouse version: 5.2.0
Chrome: Version 78.0.3868.0 (Official Build) canary (64-bit)
OS: Windows 8.1
When performing a mobile audit, Lighthouse measures the mobile agent width against the browser window width and throws an error in the PWA audit:
Provide the steps to reproduce
What is the current behavior?
It incorrectly measures the viewport size against the actual browser window width.
What is the expected behavior?
It should compare the viewport size to the simulated device width.
Environment Information
Affected Channels:
Lighthouse version: 5.2.0
Node.js version:
Operating System: Windows 8.1
Chrome: Version 78.0.3868.0 (Official Build) canary (64-bit)
Related issues
The text was updated successfully, but these errors were encountered: