question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lighthouse passes inconsistent User Agent on Redirect

See original GitHub issue

FAQ

URL

https://www.etsy.com/listing/1041475753

What happened?

Lighthouse passes a different UA than chrome dev tools, causing subtle odd bugs with device detection.

Lighthouse: 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

Chrome: Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36

What did you expect?

We see the same user agent exactly for easier debugging.

What have you tried?

I checked the Etsy server logs to validate that the user agents differ.

How were you running Lighthouse?

Chrome DevTools

Lighthouse Version

8.4.0

Chrome Version

95

Node Version

No response

OS

Mac

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
broguinncommented, Nov 9, 2021

@paulirish That’s a fair estimation of what’s going on - DeviceAtlas’ return value for any Moto G4 user agent I’ve tested seems to be a mobile device, but not a mobile phone. And accordingly, we’re having to change our internal device identification logic to check either field.

To be clear, I don’t think the issue of slight variations between Chrome device emulation’s Moto G4 user agent and the one sent by Lighthouse are an issue for our use case. For pure debugging purposes, I was surprised that they weren’t identical. If it’s relatively simple to sync the android and chrome versions here, that would be a satisfying level of internal consistency.

Thanks a bunch!

0reactions
jav666commented, Nov 16, 2021

its the same here. my UA (emulated):

Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36

after redirect:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redirect in chrome responsive simulator changing user agent
When I do a request to a page that returns a 302 redirect in the chrome responsive simulator I see a new request...
Read more >
SEO Spider Tabs - Screaming Frog
Please note, redirects are counted as a level currently in our page depth ... So inconsistent use of links that are follow and...
Read more >
Untitled
Bonvarlet arnaud, Redirect if user not logged in mvc, De liemers helpt, Montant du rmi. How to focus the oculory xbox 360, Exo...
Read more >
When indexing goes wrong: how Google Search recovered ...
Index coverage report for indexed pages, which shows an example of the data annotations that we can include to notify users of specific...
Read more >
The Website Migration Guide: SEO Strategy, Process ... - Moz
Despite some of Google's claims that 302 redirects pass PageRank, ... websites alter the HTML for mobile user agents and the vary HTTP ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found