Lighthouse: [BUG] viewport size when console is opened

Created on 26 Jun 2018  Â·  15Comments  Â·  Source: GoogleChrome/lighthouse

Bug report

Provide the steps to reproduce

  1. Run LH on any webpage (for example on youtube.com).

What is the current behavior?

screenshot_185

(console is count to that)

What is the expected behavior?

No error, viewport is correctly if set dock side of console at bottom or as external window.

Environment Information

  • Affected Channels:
    *Chrome: 67.0.3396.99
    a337fbf3c2ab8ebc6b64b0bfdce73a20e2e2252b-refs/branch-heads/3396@{#790}
  • Operating System: Windows 10

V8 6.7.288.46
Related issues

DevTools P1.5 bug

Most helpful comment

Update - there is a bug in 77 where the content-width (and thus PWA) will always fail. If there is another stable release for 77 (this is out of our hands, as it's not a critical security issue, but I expect there should be one), then there will be an update that disables this audit. For 78+, the root cause was fixed and the PWA category will work fully as expected.

All 15 comments

For others trying to reproduce, this requires that mobile emulation be disabled and you run in DevTools.

More broadly, I think this audit is 100% useless when mobile emulation is disabled anyhow since it's only catching cases where the content isn't sized the same as the viewport on a phone. Perhaps we should mark not applicable when mobile emulation is off?

Have we confirmed this is fixed?

I think, it's fixed in Chrome 71.0.3578.98,...

Chrome 72.0.3626.119 again that bug

@Mlocik97-issues the fix for this is not in v3.2.0 which is what is currently in stable Chrome. The fix should be in the next major version of Chrome in Lighthouse v4.0.0-alpha and higher.

So while it's true that Chrome 72.0.3626.119 never had the fix to begin with and is expected to fail, even in with versions of Lighthouse that have the fix, Chrome will still fail.

The workaround in LH uses emulatedFormFactor but Chrome DevTools is still using the deprecated disableDeviceEmulation https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/audits2/Audits2Controller.js?type=cs&q=disableDeviceEmulation+-f:out+f:audits&sq=package:chromium&g=0&l=242

IMO, we should fix this Chrome-side.

The problem seems to be more than just an attached dev tools, it seems to also be applicable when the dev tools are detached.. (if this is already known ignore the following ;-))

(Chrome 73.0.3683.75)

Test via minimal html at https://wn2v4zmv58.codesandbox.io/
Open devtools, detach and then audit...

e.g.
lighthouse The viewport size is 1454px, whereas window size is 1462px The viewport size is 1981px, whereas window size is 1989px
The difference (when detached) is always 8px? could it in this case be the scrollbar?

The audit pass description of

The audit passes if window.innerWidth === window.outerWidth.

Seems to not be the actual test/audit?

@exterkamp Still a bug for me docking our PWA score when it's actually fine. Running Chrome Version 77.0.3865.75 (Official Build) (64-bit)

Screen Shot 2019-09-17 at 10 23 21 AM
Screen Shot 2019-09-17 at 10 23 50 AM

For all intents and purposes, it should pass: https://developers.google.com/web/tools/lighthouse/audits/content-sized-correctly-for-viewport?utm_source=lighthouse&utm_medium=devtools

@jflayhart please provide a URL. I only see a grey circle for that audit in 77 (which is wrong too ...)

@paulirish the connection hand off bug is in 77 (doc you made for reference). The multi-client change fixed that, landed 78.

EDIT: I'm not sure if the original bug here has been fixed, hard to reason about since there's 3-4 bugs dealing with device emulation in DevTools.

seems it's fixed in Chrome 77.

Update - there is a bug in 77 where the content-width (and thus PWA) will always fail. If there is another stable release for 77 (this is out of our hands, as it's not a critical security issue, but I expect there should be one), then there will be an update that disables this audit. For 78+, the root cause was fixed and the PWA category will work fully as expected.

It's still reproducible for me in Chrome 77, although I can't reproduce it with latest Canary 79 so let's hope it's already resolved and will land to stable soon

This is still an issue in Version 78.0.3904.108

running window.innerWidth === window.outerWidth when dev tools is docked to the side results in false. As an external window or docked to bottom, it returns true but "Content is sized correctly for the viewport" still fails.

Although, it is grey so I'd assume it's not actually counting towards the PWA score..?

it is grey so I'd assume it's not actually counting towards the PWA score

If it is grey it is not applicable and not affecting your score. Is there a reason you say you're seeing it as an issue @davidwieler?

I'm not able to reproduce any behavior other than notApplicable when run as desktop in Canary 81.0.4041.3, the original root issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbparvezme picture mbparvezme  Â·  3Comments

devrsi0n picture devrsi0n  Â·  3Comments

dkajtoch picture dkajtoch  Â·  3Comments

sanprieto picture sanprieto  Â·  3Comments

Simply007 picture Simply007  Â·  3Comments