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.

JavaScript Useragent doesn't include "Lighthouse" reference on PSI tool

See original GitHub issue

I’m not 100% sure if this bug is specific to PSI, or something that comes from the developers tools emulation it uses, but here’s the situation:

Provide the steps to reproduce

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fpeixotorms.github.io%2Ftests%2FPSI%2Fjs.html&tab=desktop

Check the screenshot on the Desktop tab for the useragent that is detected with javascript. PHP will correctly detect the intended useragent.

Compare with https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://peixotorms.github.io/tests/PSI/js.html

What is the current behavior?

When we use the PSI tool via https://developers.google.com/speed/pagespeed/insights/ to test a website… PHP will detect the correct useragent, which includes a reference to Lighthouse.

However, if we use javascript to detect the useragent, it reports the networkUserAgent instead of the same useragent that PHP detects.

What is the expected behavior?

The useragent that is detected by javascript, should match the one that PHP detects. Could be a javascript engine bug on chrome, or something is not set right on the PSI tool.

Environment Information

https://developers.google.com/speed/pagespeed/insights/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
exterkampcommented, May 8, 2019

This has now been released! All users agents in PSI should have Chrome-Lighthouse in them. Feel free to re-open if this isn’t the case, but this should be g2g.

0reactions
joeyvandijkcommented, Mar 11, 2019

@paulirish I see that #7297 is merged into master and a new release has the Chrome-Lighthouse useragent 👍, but when can we expect that it is deployed to Pagespeed Insights? Is that connected to the Github repository or needs a manual ✅approval?

I ask this because I am whitelisting Chrome-Lighthouse useragent, but still see a cookiewall being popped up and want to know what to expect with a release on this repository. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the name of the Google PageSpeed User Agent?
@Jake1986 Right now PageSpeed says it sends a user-agent with "Chrome-Lighthouse", but in reality it doesn't do this at all. I echoed the...
Read more >
How to See Your Website From PageSpeed Insights ...
In this article, you'll learn how to see your website through the “eyes” of Google's PageSpeed Insights (PSI).
Read more >
Lighthouse overview - Chrome Developers
Lighthouse is an open-source, automated tool for improving the quality of web pages. You can run it against any web page, ...
Read more >
SEO Spider Configuration - Screaming Frog
Please note, this can include images, CSS, JS, hreflang attributes and ... filter out the 'Screaming Frog SEO Spider' user-agent similar to excluding...
Read more >
Get Started with the PageSpeed Insights API
The API key is safe for embedding in URLs; it doesn't need any encoding. ... [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ ...
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