lighthouse 13.5.0-dev.20261020 → 13.5.0-dev.20261021

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme.md CHANGED
@@ -106,6 +106,9 @@ Configuration:
106
106
  --only-categories Only run the specified categories. Available categories: accessibility, best-practices, performance, seo [array]
107
107
  --skip-audits Run everything except these audits [array]
108
108
  --disable-full-page-screenshot Disables collection of the full page screenshot, which can be quite large [boolean]
109
+ --ignore-status-code Disables failing on all error status codes, and instead issues a warning. [boolean]
110
+ --url-file The path to a file containing newline-delimited URLs to audit. [string]
111
+ --fail-fast Stop auditing remaining URLs immediately if a run fails. [boolean]
109
112
 
110
113
  Output:
111
114
  --output Reporter for the results, supports multiple values. choices: "json", "html", "csv" [array] [default: ["html"]]
@@ -177,6 +180,12 @@ lighthouse --output-path=~/mydir/foo.out --save-assets
177
180
 
178
181
  lighthouse --output-path=./report.json --output json
179
182
  # saves `./report.json`
183
+
184
+ lighthouse https://example.com https://example.org
185
+ # audits multiple URLs sequentially and saves `./<HOST>_<DATE>.report.html` for each
186
+
187
+ lighthouse --url-file=./urls.txt --output-path=./reports
188
+ # audits all URLs in `./urls.txt` and saves reports into the existing `./reports` directory
180
189
  ```
181
190
 
182
191
  ##### Lifecycle Examples
@@ -394,32 +403,17 @@ This section details services that have integrated Lighthouse data. If you're wo
394
403
  Other awesome open source projects that use Lighthouse.
395
404
 
396
405
  * **[auto-lighthouse](https://github.com/TGiles/auto-lighthouse)** - a CLI for crawling a domain and generating mobile and desktop reports for each page.
397
- * **[Exthouse](https://github.com/treosh/exthouse)** - Analyze the impact of a browser extension on web performance.
398
- * **[Gimbal](https://labs.moduscreate.com/gimbal-web-performance-audit-budgeting)** - An [open source (MIT licensed)](https://github.com/ModusCreateOrg/gimbal) tool used to measure, analyze, and budget aspects of a web application. Gimbal also integrates reports with GitHub pull requests.
399
- * **[Gradle Lighthouse Plugin](https://github.com/Cognifide/gradle-lighthouse-plugin)** - An open source Gradle plugin that runs Lighthouse tests on multiple URLs and asserts category score thresholds (useful in continuous integration).
400
406
  * **[lighthouse-badges](https://github.com/emazzotta/lighthouse-badges)** - Generate gh-badges (shields.io) based on Lighthouse performance.
401
- * **[lighthouse-batch](https://github.com/mikestead/lighthouse-batch)** - Run Lighthouse over a number of sites and generate a summary of their metrics/scores.
402
- * **[lighthouse-batch-parallel](https://github.com/Carr1005/lighthouse-batch-parallel)** - Run multiple Lighthouse runs in parallel to accelerate the data collecting process, get the result stream (csv, json, js object) in your own process (warning: performance results may be volatile).
403
407
  * **[lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action)** - A GitHub Action to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
404
408
  * **[lighthouse-check-orb](https://circleci.com/orbs/registry/orb/foo-software/lighthouse-check)** - A CircleCI Orb to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
405
- * **[andreasonny83/lighthouse-ci](https://github.com/andreasonny83/lighthouse-ci)** - Run Lighthouse and assert scores satisfy your custom thresholds.
406
409
  * **[GoogleChrome/lighthouse-ci](https://github.com/GoogleChrome/lighthouse-ci)** - (**official**) Automate running Lighthouse for every commit, viewing the changes, and preventing regressions.
407
410
  * **[lighthouse-ci-action](https://github.com/treosh/lighthouse-ci-action)** - A GitHub Action that makes it easy to run Lighthouse in CI and keep your pages small using performance budgets.
408
- * **[lighthouse-gh-reporter](https://github.com/carlesnunez/lighthouse-gh-reporter)** - Run Lighthouse in CI and report back in a comment on your pull requests
409
- * **[lighthouse-jest-example](https://github.com/justinribeiro/lighthouse-jest-example)** - Gather performance metrics via Lighthouse and assert results with Jest; uses Puppeteer to start Chrome with network emulation settings defined by WebPageTest.
410
- * **[lighthouse-lambda](https://github.com/Otterseer/lighthouse-lambda)** - Run Lighthouse on AWS Lambda with prebuilt stable desktop Headless Chrome.
411
411
  * **[lighthouse-matchers](https://github.com/ackama/lighthouse-matchers)** - Provides RSpec matchers for executing and evaluating Google Chrome Lighthouse audit scores.
412
- * **[lighthouse-mocha-example](https://github.com/rishichawda/lighthouse-mocha-example)** - Run Lighthouse performance tests with Mocha and chrome-launcher.
413
- * **[lighthouse-monitor](https://github.com/verivox/lighthouse-monitor)** - Run Lighthouse against all your URLs. Send metrics to any backend you want, save all reports with automatic data retention, and compare any two results in a web UI.
414
412
  * **[lighthouse-persist](https://github.com/foo-software/lighthouse-persist)** - Run Lighthouse and upload HTML reports to an AWS S3 bucket.
415
413
  * **[lighthouse-viewer](https://github.com/dvelasquez/lighthouse-viewer/tree/main/packages/lighthouse-viewer)** - Render the Lighthouse JSON into a report, using the Lighthouse Report Renderer repackaged as UMD and ESM. Also available with React, Svelte and Vue wrappers.
416
- * **[lighthouse4u](https://github.com/godaddy/lighthouse4u)** - LH4U provides Google Lighthouse as a service, surfaced by both a friendly UI+API, and backed by Elastic Search for easy querying and visualization.
417
- * **[react-lighthouse-viewer](https://www.npmjs.com/package/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
414
+ * **[react-lighthouse-viewer](https://github.com/blencorp/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
418
415
  * **[site-audit-seo](https://github.com/viasite/site-audit-seo)** - CLI tool for SEO site audit, crawl site, lighthouse each page. Output to console and tables in csv, xlsx, json, web or Google Drive.
419
- * **[webpack-lighthouse-plugin](https://github.com/addyosmani/webpack-lighthouse-plugin)** - Run Lighthouse from a Webpack build.
420
- * **[cypress-audit](https://github.com/mfrachet/cypress-audit)** - Run Lighthouse and Pa11y audits directly in your E2E test suites.
421
- * **[laravel-lighthouse](https://github.com/adityadees/laravel-lighthouse)** - Google Lighthouse wrapper for laravel framework to run Google Lighthouse CLI with custom option and can automatically save result in your server directory.
422
- * **[Neodymium](https://github.com/Xceptance/neodymium/wiki/Accessibility)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
416
+ * **[Neodymium](https://docs.xceptance.com/neodymium/features/accessibility/)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
423
417
 
424
418
  ## FAQ
425
419
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generate a filenamePrefix of hostname_YYYY-MM-DD_HH-MM-SS.
2
+ * Generate a filenamePrefix of hostname-pathname_YYYY-MM-DD_HH-MM-SS.
3
3
  * @param {{finalDisplayedUrl: string, fetchTime: string}} lhr
4
4
  * @return {string}
5
5
  */
@@ -34,13 +34,14 @@ function getFilenamePrefix(name, fetchTime) {
34
34
  }
35
35
 
36
36
  /**
37
- * Generate a filenamePrefix of hostname_YYYY-MM-DD_HH-MM-SS.
37
+ * Generate a filenamePrefix of hostname-pathname_YYYY-MM-DD_HH-MM-SS.
38
38
  * @param {{finalDisplayedUrl: string, fetchTime: string}} lhr
39
39
  * @return {string}
40
40
  */
41
41
  function getLhrFilenamePrefix(lhr) {
42
- const hostname = new URL(lhr.finalDisplayedUrl).hostname;
43
- return getFilenamePrefix(hostname, lhr.fetchTime);
42
+ const {hostname, pathname} = new URL(lhr.finalDisplayedUrl);
43
+ const name = hostname + pathname.replace(/\/$/, '');
44
+ return getFilenamePrefix(name, lhr.fetchTime);
44
45
  }
45
46
 
46
47
  /**
@@ -226,7 +226,8 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
226
226
  * @return {Element|null}
227
227
  */
228
228
  renderFilterableSection(category, groups, groupNames, metricAudits) {
229
- if (groupNames.some(groupName => !groups[groupName])) return null;
229
+ groupNames = groupNames.filter(groupName => Boolean(groups[groupName]));
230
+ if (!groupNames.length) return null;
230
231
 
231
232
  const element = this.dom.createElement('div');
232
233
 
@@ -36,7 +36,7 @@ async function toBase64(string, options) {
36
36
  } else {
37
37
  /** @type {typeof import('pako')=} */
38
38
  const pako = window.pako;
39
- bytes = /** @type {any} */ (pako.gzip(string));
39
+ bytes = pako.gzip(string);
40
40
  }
41
41
  }
42
42
 
@@ -62,7 +62,7 @@ function fromBase64(encoded, options) {
62
62
  if (options.gzip) {
63
63
  /** @type {typeof import('pako')=} */
64
64
  const pako = window.pako;
65
- return pako.ungzip(bytes, {to: 'string'});
65
+ return pako.ungzip(bytes, {toText: true});
66
66
  } else {
67
67
  return new TextDecoder().decode(bytes);
68
68
  }
@@ -11,3 +11,7 @@
11
11
 
12
12
  // Import to augment querySelector/querySelectorAll with stricter type checking.
13
13
  import '../../types/internal/query-selector';
14
+
15
+ declare global {
16
+ var pako: typeof import('pako');
17
+ }
@@ -57,6 +57,10 @@ export interface CliFlags extends Flags {
57
57
  precomputedLanternDataPath?: string;
58
58
  /** Path to the file where precomputed lantern data should be written to. */
59
59
  lanternDataOutputPath?: string;
60
+ /** Path to a file containing newline-delimited URLs to audit. */
61
+ urlFile?: string[];
62
+ /** Flag to stop auditing remaining URLs immediately if a run fails. */
63
+ failFast?: boolean;
60
64
 
61
65
  // The following are given defaults in cli-flags, so are not optional like in Flags or SharedFlagsSettings.
62
66
  output: OutputMode[];