Skip to content

People detect Lighthouse to cheat its performance score #15829

Open

Description

@krzksz

Summary

Hey! I work as a performance technical architect at Shopify. Lighthouse (PSI) has always been one of the go-to tools for our merchants when it comes to checking the performance of their stores. Unfortunately this ended up as an opportunity for some bad 3rd party actors to offer "speed optimisation services" that heavily strip down the page content when the Lighthouse test is detected. This generates a false image of the actual experience real users are getting, preventing store owners from even learning it's worth to improve.

Most popular techniques
Here are the most popular techniques that I found during the investigation:

  1. Checking for the Lighthouse string in the user agent.
  2. Checking for the Linux x86_64 value of navigator.platform.
  3. Checking for the moto g power string in the user agent.

After Lighthouse is detected, there are usually scripts in place that do a mix of the following:

  • Append an LCP hack.
  • Prevent all/3rd party JavaScript from loading.
  • Prevent all/lazyloaded images from loading.
  • Prevent all/lazyloaded iframes from loading.
  • Stop parsing of the HTML using document.close().

Proposed solution
While we're working internally to address this issue, we probably won't be able to find and fix all of the affected pages. The malicious JavaScript is usually heavily obfuscated so it's not always as simple as looking for one of the strings mentioned above. That's why I thought it would be good to fix the problem at its root instead.

When it comes to the UA, I can see it was already removed by @paulirish in this PR. That said, it seems like PSI still appends the Chrome-Lighthouse string. The information still leaks through the Sec-Ch-Ua header as well through:

{brand: 'Lighthouse', version: lighthouseVersion},

My first proposal would be to remain consistent and remove those completely.

I think that the navigator.platform issue can be addressed by adding the following logic somewhere inside the emulate function:

await session.sendCommand('Page.addScriptToEvaluateOnNewDocument', {
      source: `Object.defineProperty(
        navigator,
        'platform',
        { value: '${formFactor === 'mobile' ? 'Android' : 'MacIntel'}' }
      );`,
    });

This should keep its value consistent with the rest of the user agent.

For the moto g power I don't think there are any elegant ways to address it. If someone wants to risk breaking the page for the actual users of this device then so be it.

Let me know what you think. I'm happy to prepare a PR with the changes mentioned above so we can make sure it's not so easy to cheat people with those shady practices in the future.

Activity

  1. self-assigned this
    on Feb 22, 2024
  2. connorjclark commented on Mar 4, 2024

    @connorjclark
    Collaborator

    I will take care of making our client hints not signal Lighthouse, and changing the PSI UA header.

  3. connorjclark commented on Mar 6, 2024

    @connorjclark
    Collaborator

    Next Lighthouse release will address the brand client hint, and next PSI release (~a day) will address its UA.

    Checking for the Linux x86_64 value of navigator.platform.

    I'm not convinced we should do this for purposes of evading detection. This is the same value that an actual Linux user would have. Are you seeing this used to detect Lighthouse? It'd be a pretty big false signal..

    but, maybe worth doing to match the fake UA we set for mobile/desktop. @paulirish wdyt

  4. benschwarz commented on Mar 7, 2024

    @benschwarz
    Contributor

    I am generally not a fan of removing the ability to identify LH traffic. It is important to able to identify Lighthouse traffic in monitoring and firewall contexts.

    As we know, cheating Lighthouse doesn't improve Core web vitals for visitors.

    Yes, there are bad actors selling webperf plugins that intentionally mislead site owners.

    My take: Abuse reports should be delivered to the platforms who host problematic plugins. Services like Wordpress and Shopify must maintain quality within their own marketplace.

    Identification of traffic is important to software teams, agencies, consultants and all the folks who are focused on making positive webperf outcomes.

  5. krzksz commented on Mar 12, 2024

    @krzksz
    Author

    Checking for the Linux x86_64 value of navigator.platform.

    I'm not convinced we should do this for purposes of evading detection. This is the same value that an actual Linux user would have. Are you seeing this used to detect Lighthouse? It'd be a pretty big false signal..

    but, maybe worth doing to match the fake UA we set for mobile/desktop. @paulirish wdyt

    I figured it may be more appropriate for DevTools to handle it as a part of the device emulation. I created a bug against Chromium: https://issues.chromium.org/issues/326791407

    @benschwarz In principle I agree with your statement. This is yet another case of "this is why we can't have nice things". We spent months to uncover as many cases as possible and I believe there are still more that we didn't identify. In reality, most platforms don't have enough resources to address this at all.

    At the same time, there are real non-technical people paying $ to "performance experts" taking advantage of this.

  6. benschwarz commented on May 14, 2024

    @benschwarz
    Contributor

    @krzksz I'm not sure I agree this is a case of "this is why we can't have nice things".

    From my perspective it's a case of "Shopifys job is difficult because they have a large addressable market." or "Shopify must protect customers who use their marketplace".

  7. felipedeboni commented on Dec 11, 2024

    @felipedeboni

    I agree with @benschwarz. While tools like PageSpeed and Lighthouse provide simulated metrics, GSC Core Vitals relies on real user data.

    If Shopify encounters issues with these tools, they should consider auditing their own marketplace or guiding their customers to prioritize Vitals Reports (GSC) over simulated metrics. Restricting legitimate use cases of a developer tool, however, doesn’t seem appropriate.

    Worth mentioning SEO rankings are influenced by real user data rather than lab-based metrics from Lighthouse or PageSpeed Insights. Technically making any "cheat" useless.

    Examples of Legitimate Use Cases:

    • GTM inherently adds overhead to the main thread (we all know that). We tried partytown however it does not work properly on some stacks. Having to comment/uncomment code while working on Vitals, GTM events and etc is error prone and a waste of time.
    • Force high contrast mode (toggle switch) to avoid accessibility issues already taken care of from being listed and list only the missing ones. (https://www.w3.org/WAI/WCAG21/Techniques/general/G174.html).

    Lighthouse is designed for developers to gain actionable insights, enabling them to enhance the overall user experience based on these findings, why make it harder for us to report only what we need?

    See #14917 for uses cases and workarounds, however I feel the need to say that developers having to do workarounds or change their workflow because people are "cheating" on tools that has no real effect anywhere is just insane.

  8. krzksz commented on Dec 11, 2024

    @krzksz
    Author

    I want to make it 100% clear that it's not the case of me looking for a quick and easy solution to the problem.

    It's definitely our job to maintain the quality of our marketplace, which we do. We also spend a lot of effort to educate our users about the issue and performance in general. I documented both those efforts here. We also switched our performance metrics in the admin from Lighthouse to RUM data.

    At the same time, there's still a huge market on sites like Upwork and Fiverr that not only target big platforms like Wordpress and Shopify, but all websites in general.

    For a lot of people, PageSpeed Insights and Lighthouse are the very first step in their performance journey. Yes, they want their metrics to be green, but they don't often understand that it's the CWV assessment that matters. Even if they do, some may not have enough traffic on their website to even be in CrUX. Some will also focus on the performance score hoping that it's going to reflect on the real user measurements as well. This is where they will start to look for those services.

    In my point of view, we should never favour developer experience over users. Especially the most vulnerable ones that are only starting with their own place on the internet.

    I'm not against making it possible to detect Lighthouse in general. That said, it shouldn't be as easy as navigator.userAgent.includes('Lighthouse'). Adding a separate, server-only header would be an option, but it wouldn't solve the issue for Wordpress for example.

  9. felipedeboni commented on Dec 11, 2024

    @felipedeboni

    @krzksz I understand all you said, however it is still a tool made for developers available on Chrome DevTools, and those developers are the ones going provide (or not) a good experience to the end users.

    PSI and LightHouse are different things that sort of share the same goal, audit websites. If you ask me a solution to this, I would say remove the UA from PSI and keep it on LH.

    That most likely is going to prevent users that are clueless from being lied to and developers to keep with their usual workflow when using LH.

  10. deleted a comment from tktechseo on Dec 11, 2025
  11. akggalaxy commented on Dec 24, 2025

    @akggalaxy

    Yes, This is right. I am also a web speed performance and core web vitals expert and worked with many website owners. Mostly were were victims of fake spoofed speed and core web vitals optimization of their websites. I have saved all and so far....

    Shopify also clearly mentioned about fake spoofed speed performance and core web vitals optimization here:
    https://performance.shopify.com/blogs/blog/don-t-get-scammed-by-fake-performance-experts-and-apps
    Shopify also mentioned that many Persons, Plugins, Apps, Modules, Extensions and Agencies including in this scam.

    There are many freelance market sites Upwork.com, Fiverr.com, PeoplePerhour.com, Guru.com have full of fraudulent person those providing fake spoofed speed and core web vitals optimization. They are easily target for all types of platforms for example Shopify, Wordpress, PrestaShop, WIX, SquareSpace, Opencart, BigCommerce and mostly all types of websites for fake spoofed speed and core web vitals optimization.

    I believe Website Speed and Core Web Vitals optimization is not a day simple task. it is complex task that need more time and cost. Hope clients will understand about it.

  12. akggalaxy commented on Jan 9, 2026

    @akggalaxy

    Ok, we know that peoples, apps, plugins etc cheating Google PageSpeed Insights/Lighthouse performance and Core web vitals score.
    But the I am curious about one real question?

    Is Google or other search engine or AI/LLM search engines really give preferences this these types website which cheating speed & core web vitals score as compared other website?

    Are Google, Bing, AI/AU/LLM search engines fooled by this cheating score and Core Web Vitals code?
    Can they provide the answer?

  13. benschwarz commented on Jan 10, 2026

    @benschwarz
    Contributor

    @akggalaxy

    Is Google or other search engine or AI/LLM search engines really give preferences this these types website which cheating speed & core web vitals score as compared other website?

    No, this has been widely established. Google does not use PageSpeed / Lighthouse results to rank websites. Core Web Vitals are measured/collected from real user Chrome sessions, but that measures real world experience, not people hacking around lighthouse's user agent.

    Are Google, Bing, AI/AU/LLM search engines fooled by this cheating score and Core Web Vitals code?

    No.

  14. akggalaxy commented on Jan 24, 2026

    @akggalaxy

    @akggalaxy

    Is Google or other search engine or AI/LLM search engines really give preferences this these types website which cheating speed & core web vitals score as compared other website?

    No, this has been widely established. Google does not use PageSpeed / Lighthouse results to rank websites. Core Web Vitals are measured/collected from real user Chrome sessions, but that measures real world experience, not people hacking around lighthouse's user agent.

    Are Google, Bing, AI/AU/LLM search engines fooled by this cheating score and Core Web Vitals code?

    No.

    But why Google is not taking any action and ignoring this critical and serious issue?
    This is the world's number #1 SCAM and damage every web/internet business industry.
    Many more persons, agencies, apps, plugins and modules are involved in this scam.

  15. benschwarz commented on Jan 24, 2026

    @benschwarz
    Contributor

    @akggalaxy if you’re going to bother to engage real contributors, at least have the decency to read and understand what’s being said you you.

    There is no scam, other than your replies.

  16. machal commented on Aug 27, 2026

    @machal

    Btw we have found another plugin which is tricking Lighthouse score. Website Speedy.

    I also cover, why "delay all JS" is more hack then optimisations.

    https://pagespeed.one/en/blog/lighthouse-score-hacking

    Please, inform people that Lighthouse score is not their site speed.

  17. akggalaxy commented on Sep 21, 2026

    @akggalaxy

    Btw we have found another plugin which is tricking Lighthouse score. Website Speedy.

    I also cover, why "delay all JS" is more hack then optimisations.

    https://pagespeed.one/en/blog/lighthouse-score-hacking

    Please, inform people that Lighthouse score is not their site speed.

    Yes, there are too many.
    But see this person benschwarz https://github.com/benschwarz
    He said "There is no scam, other than your replies.".

    I think he is the real scammer of website speed optimization scam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions