GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.26k stars 9.35k forks source link

Incorrect user agent on pagespeed.web.dev #15971

Closed thomaswelton closed 4 months ago

thomaswelton commented 5 months ago

FAQ

URL

https://pagespeed.web.dev/analysis

What happened?

Running a lighthouse test via https://pagespeed.web.dev/analysis/ I can see from the UI that the user agent of the browser running the lighthouse test should be

User agent (network): "Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36"

However, when I take a look at my server logs I can see the the user agent is reported as

userAgent: "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Mobile Safari/537.36 Chrome-Lighthouse"

What did you expect?

I can see from this issue https://github.com/GoogleChrome/lighthouse/issues/14917 that the words Chrome Lighthouse were removed here https://github.com/GoogleChrome/lighthouse/pull/14384 but from my server logs I can see that it is still present in the user agent.

Also instead of the expected Chrome/119.0.0.0 I'm seeing Chrome/94.0.4590.2

What have you tried?

No response

How were you running Lighthouse?

PageSpeed Insights

Lighthouse Version

11.5.0

Chrome Version

No response

Node Version

No response

OS

No response

Relevant log output

No response

dwsmart commented 5 months ago

The older version of Chrome reported does seem to trip some sites up, like this one that came to the Google Search Central forums. Presumably they are blocking older browser versions, which given isn't a great idea, but would be good to see this have a more up-to-date user-agent string.

adamraine commented 4 months ago

I think this is already goal of https://github.com/GoogleChrome/lighthouse/issues/15829