Lighthouse is an open-source, automated tool for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, SEO, and more. Show
You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it. You can also use Lighthouse CI to prevent regressions on your sites. Check out the video below from Google I/O to learn more about how to use and contribute to Lighthouse. Get startedChoose the Lighthouse workflow that suits you best:
The CLI and Node workflows require you to have an instance of Google Chrome installed on your machine. Run Lighthouse in Chrome DevToolsLighthouse has its own panel in Chrome DevTools. To run a report:
Install and run the Node command line toolTo install the Node module:
To run an audit:
To see all the options:
Run the Node module programmaticallySee for an example of running Lighthouse programmatically, as a Node module. Run PageSpeed InsightsTo run Lighthouse on PageSpeed Insights:
Run Lighthouse as a Chrome ExtensionCaution Unless you have a specific reason, you should use the rather than this Chrome Extension workflow. The DevTools workflow allows for testing local sites and authenticated pages, while the extension does not. To install the extension:
To run an audit:
Share and view reports onlineUse the Lighthouse Viewer to view and share reports online. The Lighthouse ViewerShare reports as JSONThe Lighthouse Viewer needs the JSON output of a Lighthouse report. The list below explains how to get the JSON output, depending on what Lighthouse workflow you're using:
To view the report data:
Share reports as GitHub GistsIf you don't want to manually pass around JSON files, you can also share your reports as secret GitHub gists. One benefit of gists is free version control. To export a report as a gist from the report:
To export a report as a gist from the CLI version of Lighthouse, manually create a gist and copy-paste the report's JSON output into the gist. The gist filename containing the JSON output must end in To view a report that's been saved as a gist:
Lighthouse extensibilityLighthouse aims to provide guidance that is relevant and actionable for all web developers. To this end, there are two features available that allow you to tailor Lighthouse to your specific needs. Stack PacksDevelopers use many different technologies (backend/CMS/JavaScript frameworks) to build their web pages. Instead of only surfacing general recommendations, Lighthouse is now able to provide more relevant and actionable advice depending on the tools used. "Stack Packs" allow Lighthouse to detect what platform your site is built on and display specific stack-based recommendations. These recommendations are defined and curated by experts from the community. To contribute a Stack Pack, review the Contributing Guidelines. Lighthouse PluginsLighthouse Plugins allow domain experts to extend the functionality of Lighthouse for their community's specific needs. You are now able to leverage the data that Lighthouse collects to create new audits. At its core, a Lighthouse plugin is a node module that implements a set of checks that will be run by Lighthouse and added to the report as a new category. For more information about how to create your own plugin, check out our Plugin Handbook in the Lighthouse GitHub repo. Integrate LighthouseIf you are a company or an individual who is integrating Lighthouse as part of the products / services you're offering, first things first - we're so excited you are! We want as many people as possible to use Lighthouse, and this Guidelines and Brand Assets for Integrating Lighthouse is meant to make it straightforward for you to show that Lighthouse is under the hood while protecting our brand. Contribute to LighthouseLighthouse is open source and contributions are welcome! Check out the repository's issue tracker to find bugs that you can fix, or audits that you can create or improve upon. The issues tracker is also a good place to discuss performance metrics, ideas for new audits, or anything else related to Lighthouse. |