• Stars
    star
    2,318
  • Rank 19,035 (Top 0.4 %)
  • Language
    CSS
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated 12 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Chrome extension to measure essential metrics for a healthy site

Web Vitals Chrome Extension

A Chrome extension to measure metrics for a healthy site Install now

This extension measures the three Core Web Vitals metrics in a way that matches how they're measured by Chrome and reported to other Google tools (e.g. Chrome User Experience Report, Page Speed Insights, Search Console).

It supports all of the Core Web Vitals and leverages the web-vitals library under the hood to capture:

It also supports the newer INP metric:

Installation Instructions

The Web Vitals Chrome Extenstion can be installed from the Chrome Web Store.

If you are looking for a more bleeding-edge build, you can also install the version of the extension from master.

Install from master

Google Chrome

  1. Download this repo as a ZIP file from GitHub.
  2. Unzip the file and you should have a folder named web-vitals-extension-master.
  3. In Chrome go to the extensions page (chrome://extensions).
  4. Enable Developer Mode.
  5. Drag the web-vitals-extension-master folder anywhere on the page to import it (do not delete the folder afterwards).

Usage

Ambient badge

The Ambient Badge helps check if a page passing the Core Web Vitals thresholds.

Once installed, the extension will display a disabled state badge icon until you navigate to a URL. At this point it will update the badge to green or red depending on whether the URL passes the Core Web Vitals metrics thresholds.

The badge has a number of states:

  • Disabled - gray
  • Passing - green
  • One or more metrics failing - red

If one or more metrics are failing, the badge will animate the values of these metrics.

Detailed drill-down

Clicking the Ambient badge icon will allow you to drill in to the individual metric values. In this mode, the extension will also say if a metric value might change or requires a user action.

For example, First Input Delay requires a real interaction (e.g click/tap) with the page and will be in a waiting for input state until this is the case. We recommend consulting the web.dev documentation for LCP, CLS and FID to get an understanding of when metric values settle.

As of version 1.0.0, the popup combines your local Core Web Vitals experiences with real-user data from the field via the Chrome UX Report (CrUX) API. This integration gives you contextual insights to help you understand how similar your individual experiences are to other desktop users on the same page. We've also added a new option to "Compare local experiences to phone field data" instead, if needed. Note that CrUX data may not be available for some pages, in which case we try to load field data for the origin as a whole.

Overlay

The overlay displays a Heads up display (HUD) which overlays your page. It is useful if you need a persistent view of your Core Web Vitals metrics during development. To enable the overlay:

  • Right-click on the Ambient badge and go to Options.
  • Check Display HUD overlay and click 'Save'
  • Reload the tab for the URL you wish to test. The overlay should now be present.

Console logs

The console logging feature of the Web Vitals extension provides a diagnostic view of all supported metrics. To enable console logs:

  • Right-click on the Ambient badge and go to Options.
  • Check Console logging and click 'Save'
  • Open the Console panel in DevTools and filter for Web Vitals

To filter out unneeded metrics, prepend a minus sign to the metric name. For example, set the filter to Web Vitals Extension -CLS -FID to filter out CLS and FID diagnostic info.

Diagnostic info for each metric is logged as a console group prepended by the extension name, [Web Vitals Extension], meaning that you will need to click this line in order to toggle the group open and closed.

The kinds of diagnostic info varies per metric. For example, the LCP info includes:

Contributing

Contributions to this project are welcome in the form of pull requests or issues. See CONTRIBUTING.md for further details.

If your feedback is related to how we measure metrics, please file an issue against web-vitals directly.

How is the extension code structured?

  • src/browser_action/vitals.js: Script that leverages WebVitals.js to collect metrics and broadcast metric changes for badging and the HUD. Provides an overall score of the metrics that can be used for badging.
  • src/bg/background.js: Performs badge icon updates using data provided by vitals.js. Passes along data to popup.js in order to display the more detailed local metrics summary.
  • src/browser_action/popup.js: Content Script that handles rendering detailed metrics reports in the pop-up window displayed when clicking the badge icon.
  • src/options/options.js: Options UI (saved configuration) for advanced features like the HUD Overlay

FAQ

Who is the primary audience for this extension?

The primary audience for this extension is developers who would like instant feedback on how their pages are doing on the Core Web Vitals metrics during development on a desktop machine.

How should I interpret the metrics numbers reported by this tool?

This extension reports metrics for your desktop or laptop machine. In many cases this hardware will be significantly faster than that of the median mobile phone your users may have. For this reason, it is strongly recommended that you test using tools like Lighthouse and on real mobile hardware (e.g via WebPageTest) to ensure all your users there have a positive experience.

What actions can I take to improve my Core Web Vitals?

We are making available a set of guides for optimizing each of the Core Web Vitals metrics if you find your page is not passing a particular threshold:

Lighthouse also includes additional actionability audits for these metrics. They will answer questions like:

  • What element was identified as the Largest Contentful Paint?
  • What elements experienced a shift and contributed to Cumulative Layout Shift?

We envision users will use the extension for instant feedback on metrics (for their desktop machine) but will then go and do a Lighthouse audit for (1) a diagnostic view of how these metrics look on a median mobile device and (2) specifically what you can do to improve.

License

Apache 2.0

More Repositories

1

lighthouse

Automated auditing, performance metrics, and best practices for the web.
JavaScript
27,804
star
2

chrome-extensions-samples

Chrome Extensions Samples
JavaScript
13,907
star
3

workbox

📦 Workbox: JavaScript libraries for Progressive Web Apps
JavaScript
12,091
star
4

web-vitals

Essential metrics for a healthy site.
JavaScript
7,111
star
5

lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
JavaScript
6,210
star
6

rendertron

A Headless Chrome rendering solution
TypeScript
5,926
star
7

samples

A repo containing samples tied to new functionality in each release of Google Chrome.
HTML
5,709
star
8

web.dev

The frontend, backend, and content source code for web.dev
Nunjucks
3,544
star
9

dialog-polyfill

Polyfill for the HTML dialog element
JavaScript
2,425
star
10

accessibility-developer-tools

This is a library of accessibility-related testing and utility code.
JavaScript
2,274
star
11

developer.chrome.com

The frontend, backend, and content source code for developer.chrome.com
HTML
1,660
star
12

custom-tabs-client

Chrome custom tabs examples
Java
1,399
star
13

chrome-launcher

Launch Google Chrome with ease from node.
TypeScript
1,166
star
14

proxy-polyfill

Proxy object polyfill
JavaScript
1,127
star
15

omnitone

Spatial Audio Rendering on the web.
JavaScript
840
star
16

devtools-docs

The legacy documentation for Chrome DevTools.
HTML
686
star
17

android-browser-helper

The Android Browser Helper library helps developers use Custom Tabs and Trusted Web Activities on top of the AndroidX browser support library.
Java
655
star
18

chromium-dashboard

Chrome Status Dashboard
Python
624
star
19

OriginTrials

Enabling safe experimentation with web APIs
Bikeshed
520
star
20

audion

Audion is a Chrome extension that adds a Web Audio panel to Developer Tools. This panel visualizes the web audio graph in real-time.
TypeScript
357
star
21

related-website-sets

Python
282
star
22

chrome-app-codelab

The goal of this tutorial is to get you building Chrome apps fast. Once you've completed the tutorial, you will have a simple Todo app. We've done our best to capture some of the trickier parts to the development process keeping the sample simple and straightforward.
JavaScript
214
star
23

lighthouse-stack-packs

Lighthouse Stack Packs
JavaScript
207
star
24

CrUX

The place to share queries, ideas, or issues related to the Chrome UX Report
Jupyter Notebook
201
star
25

inert-polyfill

Polyfill for the HTML inert attribute
JavaScript
188
star
26

chrome-types

Code to parse Chrome's internal extension type definitions—published on NPM as chrome-types
JavaScript
157
star
27

devtools-samples

Samples for demonstrating DevTools features.
HTML
149
star
28

ip-protection

147
star
29

CertificateTransparency

HTML
139
star
30

browser-bug-search

Search across all major browser vendor issue trackers
JavaScript
113
star
31

multi-device

Chrome multi-device (mobile) docs
HTML
102
star
32

kino

A sample offline streaming video PWA built for web.dev/media
JavaScript
92
star
33

jank-busters

Resources for jank busting on the web.
JavaScript
64
star
34

webstore-docs

Developer docs for Chrome Web Store:
HTML
64
star
35

budget.json

37
star
36

private-tokens

37
star
37

webdev-infra

JavaScript
36
star
38

.github

10
star
39

.allstar

7
star
40

CertificateTransparency-todelete

HTML
7
star
41

lighthouse-plugin-example

JavaScript
1
star