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, and more.

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.

Check out the video below from Google I/O 2017 to learn more about how to use and contribute to Lighthouse.

Get started

Choose the Lighthouse workflow that suits you best:

  • Easily audit pages that require authentication, and read your reports in a user-friendly format.
  • Automate your Lighthouse runs via shell scripts.
  • Integrate Lighthouse into your continuous integration systems.
  • Run Lighthouse and link to reports without installing a thing.

Run Lighthouse in Chrome DevTools

Lighthouse now powers the Audits panel of Chrome DevTools. To run a report:

  1. Download Google Chrome for Desktop.
  2. In Google Chrome, go to the URL you want to audit. You can audit any URL on the web.
  3. Open Chrome DevTools.
  4. Click the Audits tab.Figure 1. To the left is the viewport of the page that will be audited. To the right is the Audits panel of Chrome DevTools, which is now powered by Lighthouse
  5. Click Perform an audit. DevTools shows you a list of audit categories. Leave them all enabled.
  6. Click Run audit. After 60 to 90 seconds, Lighthouse gives you a report on the page.

Figure 2. A Lighthouse report in Chrome DevTools

Install and run the Node command line tool

To install the Node module:

  1. Download Google Chrome for Desktop.
  2. Install the current Long-Term Support version of Node.
  3. Install Lighthouse. The -g flag installs it as a global module.
 npm install -g lighthouse 

To run an audit:

 lighthouse 

To see audit options:

 lighthouse --help

Run the Node module programmatically

See Using programmatically for an example of running Lighthouse programmatically, as a Node module.

Run Lighthouse as a Chrome Extension

To install the extension:

  1. Download Google Chrome for Desktop.
  2. Install the Lighthouse Chrome Extension from the Chrome Webstore.

To run an audit:

  1. In Chrome, go to the page you want to audit.
  2. Click Lighthouse . It should be next to the Chrome address bar. If not, open Chrome’s main menu and access it at the top of the menu. After clicking, the Lighthouse menu expands.

                                                           Figure 3. The Lighthouse menu

3.Click Generate report. Lighthouse runs its audits against the currently-focused page, then opens up a new tab with a report of the results.

Continuous on https://developers.google.com/web/tools/lighthouse/#programmatic


Leave a Reply

Your email address will not be published. Required fields are marked *