diff --git a/README.md b/README.md index 83c26a7..73b5cde 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ Otherwise, it will install the latest version in a temporary folder. You can also specify **audit score assertions** that can make the pipeline fail based on the audit scores. -For example, the Google Lighthouse audit `no-vulnerable-libraries` produces a boolean score that will be equal to 1 if there are no known vulnerabilities within client-side JavaScript libraries and frameworks detected on a web site. +For example, the Google Lighthouse audit `is-on-https` produces a boolean score that will be equal to `1` if the site uses HTTPS. This is an example of a score assertion for this audit: ``` -no-vulnerable-libraries = 1 +is-on-https = 1 ``` -Which means that you expect the audit `no-vulnerable-libraries` to have a score equal to `1`. +Which means that you expect the audit `is-on-https` to have a score equal to `1`. **Any audit score generated by Lighthouse is between 0 and 1**. You can also use the `>` (greater than) and the `<` (lower than) operator to evaluate decimal audit scores. Audit score assertions must be written on separate lines. @@ -30,100 +30,104 @@ Audit score assertions must be written on separate lines. Lighthouse for Azure Pipelines can be installed from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=GSoft.lighthouse-vsts). -## Available audits - -The following audits exist in Lighthouse 5.6.0. They may change with new versions. Execute `lighthouse --list-all-audits` to discover the available audits for your desired Lighthouse version. - -| Audit | Type | Description | -| ---------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| is-on-https | binary | Uses HTTPS | -| redirects-http | binary | Redirects HTTP traffic to HTTPS | -| service-worker | binary | Does not register a service worker that controls page and `start_url` | -| works-offline | binary | Current page does not respond with a 200 when offline | -| viewport | binary | Has a `` tag with `width` or `initial-scale` | -| without-javascript | binary | Contains some content when JavaScript is not available | -| first-contentful-paint | numeric | First Contentful Paint | -| first-meaningful-paint | numeric | First Meaningful Paint | -| load-fast-enough-for-pwa | binary | Page load is fast enough on mobile networks | -| speed-index | numeric | Speed Index | -| estimated-input-latency | numeric | Estimated Input Latency | -| total-blocking-time | numeric | Total Blocking Time | -| max-potential-fid | numeric | Max Potential First Input Delay | -| errors-in-console | binary | No browser errors logged to the console | -| time-to-first-byte | binary | Server response times are low (TTFB) | -| first-cpu-idle | numeric | First CPU Idle | -| interactive | numeric | Time to Interactive | -| redirects | numeric | Avoid multiple page redirects | -| installable-manifest | binary | Web app manifest does not meet the installability requirements | -| apple-touch-icon | binary | Does not provide a valid `apple-touch-icon` | -| splash-screen | binary | Is not configured for a custom splash screen | -| themed-omnibox | binary | Does not set a theme color for the address bar. | -| content-width | binary | Content is sized correctly for the viewport | -| image-aspect-ratio | binary | Displays images with correct aspect ratio | -| deprecations | binary | Avoids deprecated APIs | -| mainthread-work-breakdown | numeric | Minimize main-thread work | -| bootup-time | numeric | Reduce JavaScript execution time | -| uses-rel-preload | numeric | Preload key requests | -| uses-rel-preconnect | numeric | Preconnect to required origins | -| font-display | binary | All text remains visible during webfont loads | -| offline-start-url | binary | `start_url` does not respond with a 200 when offline | -| third-party-summary | binary | Reduce the impact of third-party code | -| aria-allowed-attr | binary | `[aria-*]` attributes match their roles | -| aria-required-attr | binary | `[role]`s do not have all required `[aria-*]` attributes | -| aria-required-children | binary | Elements with an ARIA `[role]` that require children to contain a specific `[role]` have all required children. | -| aria-required-parent | binary | `[role]`s are contained by their required parent element | -| aria-roles | binary | `[role]` values are valid | -| aria-valid-attr-value | binary | `[aria-*]` attributes have valid values | -| aria-valid-attr | binary | `[aria-*]` attributes are valid and not misspelled | -| button-name | binary | Buttons have an accessible name | -| bypass | binary | The page does not contain a heading, skip link, or landmark region | -| color-contrast | binary | Background and foreground colors do not have a sufficient contrast ratio. | -| document-title | binary | Document has a `` element | -| duplicate-id | binary | `[id]` attributes on the page are unique | -| html-has-lang | binary | `<html>` element has a `[lang]` attribute | -| html-lang-valid | binary | `<html>` element has a valid value for its `[lang]` attribute | -| image-alt | binary | Image elements have `[alt]` attributes | -| label | binary | Form elements have associated labels | -| link-name | binary | Links do not have a discernible name | -| meta-viewport | binary | `[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5. | -| tabindex | binary | No element has a `[tabindex]` value greater than 0 | -| uses-long-cache-ttl | numeric | Uses efficient cache policy on static assets | -| total-byte-weight | numeric | Avoids enormous network payloads | -| offscreen-images | numeric | Defer offscreen images | -| render-blocking-resources | numeric | Eliminate render-blocking resources | -| unminified-css | numeric | Minify CSS | -| unminified-javascript | numeric | Minify JavaScript | -| unused-css-rules | numeric | Remove unused CSS | -| uses-webp-images | numeric | Serve images in next-gen formats | -| uses-optimized-images | numeric | Efficiently encode images | -| uses-text-compression | numeric | Enable text compression | -| uses-responsive-images | numeric | Properly size images | -| efficient-animated-content | numeric | Use video formats for animated content | -| appcache-manifest | binary | Avoids Application Cache | -| doctype | binary | Page has the HTML doctype | -| dom-size | numeric | Avoids an excessive DOM size | -| external-anchors-use-rel-noopener | binary | Links to cross-origin destinations are safe | -| geolocation-on-start | binary | Avoids requesting the geolocation permission on page load | -| no-document-write | binary | Avoids `document.write()` | -| no-vulnerable-libraries | binary | Avoids front-end JavaScript libraries with known security vulnerabilities | -| js-libraries | binary | Detected JavaScript libraries | -| notification-on-start | binary | Avoids requesting the notification permission on page load | -| password-inputs-can-be-pasted-into | binary | Allows users to paste into password fields | -| uses-http2 | binary | Uses HTTP/2 for its own resources | -| uses-passive-event-listeners | binary | Does not use passive listeners to improve scrolling performance | -| meta-description | binary | Document does not have a meta description | -| http-status-code | binary | Page has successful HTTP status code | -| font-size | binary | Document uses legible font sizes | -| link-text | binary | Links have descriptive text | -| is-crawlable | binary | Page isn’t blocked from indexing | -| robots-txt | binary | robots.txt is valid | -| tap-targets | binary | Tap targets are not sized appropriately | -| hreflang | binary | Document has a valid `hreflang` | -| plugins | binary | Document avoids plugins | - -## Compiling - -There are GitHub actions that take care of compiling, packaging and publishing the extension. +## Lighthouse audits that can be used in assertions + +The following audits are available for assertions in **Lighthouse 10.1.0**. +They may change with new versions. +Execute `lighthouse --list-all-audits` to discover the available audits for your desired Lighthouse version. + +| Audit | Type | Description | +|------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------| +| is-on-https | binary | Uses HTTPS | +| service-worker | binary | Does not register a service worker that controls page and `start_url` | +| viewport | binary | Has a `<meta name="viewport">` tag with `width` or `initial-scale` | +| first-contentful-paint | numeric | First Contentful Paint | +| largest-contentful-paint | numeric | Largest Contentful Paint | +| first-meaningful-paint | numeric | First Meaningful Paint | +| speed-index | numeric | Speed Index | +| total-blocking-time | numeric | Total Blocking Time | +| max-potential-fid | numeric | Max Potential First Input Delay | +| cumulative-layout-shift | numeric | Cumulative Layout Shift | +| errors-in-console | binary | No browser errors logged to the console | +| server-response-time | binary | Initial server response time was short | +| interactive | numeric | Time to Interactive | +| redirects | numeric | Avoid multiple page redirects | +| installable-manifest | binary | Web app manifest or service worker do not meet the installability requirements | +| splash-screen | binary | Is not configured for a custom splash screen | +| themed-omnibox | binary | Does not set a theme color for the address bar. | +| maskable-icon | binary | Manifest doesn't have a maskable icon | +| content-width | binary | Content is sized correctly for the viewport | +| image-aspect-ratio | binary | Displays images with correct aspect ratio | +| image-size-responsive | binary | Serves images with appropriate resolution | +| deprecations | binary | Avoids deprecated APIs | +| mainthread-work-breakdown | numeric | Minimizes main-thread work | +| bootup-time | numeric | JavaScript execution time | +| uses-rel-preconnect | numeric | Preconnect to required origins | +| font-display | binary | All text remains visible during webfont loads | +| third-party-summary | binary | Minimize third-party usage | +| no-unload-listeners | binary | Avoids `unload` event listeners | +| unsized-images | binary | Image elements have explicit `width` and `height` | +| valid-source-maps | binary | Page has valid source maps | +| aria-allowed-attr | binary | `[aria-*]` attributes match their roles | +| aria-hidden-body | binary | `[aria-hidden="true"]` is not present on the document `<body>` | +| aria-hidden-focus | binary | `[aria-hidden="true"]` elements contain focusable descendents | +| aria-valid-attr-value | binary | `[aria-*]` attributes have valid values | +| aria-valid-attr | binary | `[aria-*]` attributes are valid and not misspelled | +| button-name | binary | Buttons have an accessible name | +| color-contrast | binary | Background and foreground colors have a sufficient contrast ratio | +| document-title | binary | Document has a `<title>` element | +| duplicate-id-active | binary | `[id]` attributes on active, focusable elements are unique | +| duplicate-id-aria | binary | ARIA IDs are unique | +| heading-order | binary | Heading elements appear in a sequentially-descending order | +| html-has-lang | binary | `<html>` element has a `[lang]` attribute | +| html-lang-valid | binary | `<html>` element has a valid value for its `[lang]` attribute | +| image-alt | binary | Image elements have `[alt]` attributes | +| link-name | binary | Links have a discernible name | +| list | binary | Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`). | +| listitem | binary | List items (`<li>`) are contained within `<ul>`, `<ol>` or `<menu>` parent elements | +| meta-viewport | binary | `[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5. | +| uses-long-cache-ttl | numeric | Uses efficient cache policy on static assets | +| total-byte-weight | numeric | Avoids enormous network payloads | +| offscreen-images | numeric | Defer offscreen images | +| render-blocking-resources | numeric | Eliminate render-blocking resources | +| unminified-css | numeric | Minify CSS | +| unminified-javascript | numeric | Minify JavaScript | +| unused-css-rules | numeric | Reduce unused CSS | +| unused-javascript | numeric | Reduce unused JavaScript | +| modern-image-formats | numeric | Serve images in next-gen formats | +| uses-optimized-images | numeric | Efficiently encode images | +| uses-text-compression | numeric | Enable text compression | +| uses-responsive-images | numeric | Properly size images | +| efficient-animated-content | numeric | Use video formats for animated content | +| duplicated-javascript | numeric | Remove duplicate modules in JavaScript bundles | +| legacy-javascript | numeric | Avoid serving legacy JavaScript to modern browsers | +| doctype | binary | Page has the HTML doctype | +| charset | binary | Properly defines charset | +| dom-size | numeric | Avoids an excessive DOM size | +| geolocation-on-start | binary | Avoids requesting the geolocation permission on page load | +| inspector-issues | binary | No issues in the `Issues` panel in Chrome Devtools | +| no-document-write | binary | Avoids `document.write()` | +| notification-on-start | binary | Avoids requesting the notification permission on page load | +| paste-preventing-inputs | binary | Allows users to paste into input fields | +| uses-http2 | numeric | Use HTTP/2 | +| uses-passive-event-listeners | binary | Uses passive listeners to improve scrolling performance | +| meta-description | binary | Document has a meta description | +| http-status-code | binary | Page has successful HTTP status code | +| font-size | binary | Document uses legible font sizes | +| link-text | binary | Links have descriptive text | +| crawlable-anchors | binary | Links are crawlable | +| is-crawlable | binary | Page isn’t blocked from indexing | +| robots-txt | binary | robots.txt is valid | +| tap-targets | binary | Tap targets are sized appropriately | +| hreflang | binary | Document has a valid `hreflang` | +| plugins | binary | Document avoids plugins | +| canonical | binary | Document has a valid `rel=canonical` | +| bf-cache | binary | Page prevented back/forward cache restoration | + + +## Build and release process + +There are GitHub actions that take care of testing, packaging and publishing the extension. ## License diff --git a/docs/lh-result.png b/docs/lh-result.png index 747a1bd..b949ce7 100644 Binary files a/docs/lh-result.png and b/docs/lh-result.png differ diff --git a/docs/lh-task.png b/docs/lh-task.png index df4fce4..bebefcc 100644 Binary files a/docs/lh-task.png and b/docs/lh-task.png differ diff --git a/static/images/screenshot-1.png b/static/images/screenshot-1.png index 747a1bd..b949ce7 100644 Binary files a/static/images/screenshot-1.png and b/static/images/screenshot-1.png differ diff --git a/static/images/screenshot-2.png b/static/images/screenshot-2.png index df4fce4..bebefcc 100644 Binary files a/static/images/screenshot-2.png and b/static/images/screenshot-2.png differ diff --git a/task/src/task.json b/task/src/task.json index 55b35af..2247438 100644 --- a/task/src/task.json +++ b/task/src/task.json @@ -37,7 +37,7 @@ { "name": "args", "type": "multiLine", - "label": "CLI arguments", + "label": "CLI arguments (one per line)", "defaultValue": "", "required": false, "helpMarkDown": "The [CLI arguments](https://github.com/GoogleChrome/lighthouse#cli-options) to pass to Lighthouse. **One argument per line**.\n\n`--view`, `--output`, `--output-path`, `--chrome-flags` are prohibited and will be either removed or replaced."