lighthouse 9.3.1-dev.20220215 → 9.4.0-dev.20220218

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/changelog.md CHANGED
@@ -1,3 +1,48 @@
1
+ <a name="9.4.0"></a>
2
+ # 9.4.0 (2022-02-16)
3
+ [Full Changelog](https://github.com/compare/v9.3.1...v9.4.0)
4
+
5
+ We expect this release to ship in the DevTools of [Chrome 100](https://chromiumdash.appspot.com/schedule), and to PageSpeed Insights within 2 weeks.
6
+
7
+ ## Notable Changes
8
+
9
+ * Allow auditing of navigations triggered by user interactions in user flows. See our [user flow docs](https://github.com/GoogleChrome/lighthouse/blob/master/docs/user-flows.md) for more info. ([#13496](https://github.com/GoogleChrome/lighthouse/pull/13496))
10
+
11
+ ## Core
12
+
13
+ * a11y: change link in category description to web.dev ([#13638](https://github.com/GoogleChrome/lighthouse/pull/13638))
14
+ * full-page-screenshot: wait for doubleraf, network quiet ([#13663](https://github.com/GoogleChrome/lighthouse/pull/13663))
15
+ * hreflang: remove eval, import axe valid-langs.js directly ([#13385](https://github.com/GoogleChrome/lighthouse/pull/13385))
16
+ * inputs: refactor form-elements gatherer ([#13662](https://github.com/GoogleChrome/lighthouse/pull/13662), [#13671](https://github.com/GoogleChrome/lighthouse/pull/13671))
17
+ * page-functions: set style in getOuterHTMLSnippet without violating CSP ([#13636](https://github.com/GoogleChrome/lighthouse/pull/13636))
18
+ * runner: independent gather and audit functions ([#13569](https://github.com/GoogleChrome/lighthouse/pull/13569))
19
+ * uses-long-cache-ttl: ignore `stale-while-revalidate` ([#13612](https://github.com/GoogleChrome/lighthouse/pull/13612))
20
+
21
+ ## Report
22
+
23
+ * add options onPrintOverride and onSaveFileOverride ([#13529](https://github.com/GoogleChrome/lighthouse/pull/13529))
24
+ * add options disableFireworks and disableDarkMode ([#13649](https://github.com/GoogleChrome/lighthouse/pull/13649))
25
+ * add onViewTrace to renderer options ([#13528](https://github.com/GoogleChrome/lighthouse/pull/13528))
26
+ * remove pausing fireworks on click ([#13650](https://github.com/GoogleChrome/lighthouse/pull/13650))
27
+ * fix fireworks ([#13635](https://github.com/GoogleChrome/lighthouse/pull/13635))
28
+
29
+ ## Deps
30
+
31
+ * sentry: move from raven to @sentry/node ([#9325](https://github.com/GoogleChrome/lighthouse/pull/9325))
32
+ * snyk: update snyk snapshot ([#13669](https://github.com/GoogleChrome/lighthouse/pull/13669), [#13644](https://github.com/GoogleChrome/lighthouse/pull/13644), [#13616](https://github.com/GoogleChrome/lighthouse/pull/13616))
33
+
34
+ ## Tests
35
+
36
+ * use simpler assertion in report-renderer-axe-test.js ([#13658](https://github.com/GoogleChrome/lighthouse/pull/13658))
37
+ * fix single node a11y tests ([#13626](https://github.com/GoogleChrome/lighthouse/pull/13626))
38
+ * devtools: sync ([#13656](https://github.com/GoogleChrome/lighthouse/pull/13656))
39
+ * devtools: update report resource names ([#13615](https://github.com/GoogleChrome/lighthouse/pull/13615))
40
+ * smoke: test array `_includes` and `lhr.timing` ([#13619](https://github.com/GoogleChrome/lighthouse/pull/13619))
41
+
42
+ ## Misc
43
+
44
+ * temporarily remove brendan from triage rotation ([#13618](https://github.com/GoogleChrome/lighthouse/pull/13618))
45
+
1
46
  <a name="9.3.1"></a>
2
47
  # 9.3.1 (2022-01-31)
3
48
  [Full Changelog](https://github.com/compare/v9.3.0...v9.3.1)
@@ -1776,10 +1776,8 @@ class DOM {
1776
1776
  * @param {string} filename
1777
1777
  */
1778
1778
  saveFile(blob, filename) {
1779
- const ext = blob.type.match('json') ? '.json' : '.html';
1780
-
1781
1779
  const a = this.createElement('a');
1782
- a.download = `${filename}${ext}`;
1780
+ a.download = filename;
1783
1781
  this.safelySetBlobHref(a, blob);
1784
1782
  this._document.body.appendChild(a); // Firefox requires anchor to be in the DOM.
1785
1783
  a.click();
@@ -5501,7 +5499,11 @@ class TopbarFeatures {
5501
5499
  }
5502
5500
 
5503
5501
  _print() {
5504
- self.print();
5502
+ if (this._reportUIFeatures._opts.onPrintOverride) {
5503
+ this._reportUIFeatures._opts.onPrintOverride(this._dom.rootEl);
5504
+ } else {
5505
+ self.print();
5506
+ }
5505
5507
  }
5506
5508
 
5507
5509
  /**
@@ -5729,12 +5731,13 @@ class ReportUIFeatures {
5729
5731
  this._setupThirdPartyFilter();
5730
5732
  this._setupElementScreenshotOverlay(this._dom.rootEl);
5731
5733
 
5732
- let turnOffTheLights = false;
5733
5734
  // Do not query the system preferences for DevTools - DevTools should only apply dark theme
5734
5735
  // if dark is selected in the settings panel.
5735
- const disableDarkMode = this._dom.isDevTools() || this._opts.disableAutoDarkModeAndFireworks;
5736
+ // TODO: set `disableDarkMode` in devtools and delete this special case.
5737
+ const disableDarkMode = this._dom.isDevTools() ||
5738
+ this._opts.disableDarkMode || this._opts.disableAutoDarkModeAndFireworks;
5736
5739
  if (!disableDarkMode && window.matchMedia('(prefers-color-scheme: dark)').matches) {
5737
- turnOffTheLights = true;
5740
+ toggleDarkTheme(this._dom, true);
5738
5741
  }
5739
5742
 
5740
5743
  // Fireworks!
@@ -5744,13 +5747,12 @@ class ReportUIFeatures {
5744
5747
  const cat = lhr.categories[id];
5745
5748
  return cat && cat.score === 1;
5746
5749
  });
5747
- if (scoresAll100 && !this._opts.disableAutoDarkModeAndFireworks) {
5748
- turnOffTheLights = true;
5750
+ const disableFireworks =
5751
+ this._opts.disableFireworks || this._opts.disableAutoDarkModeAndFireworks;
5752
+ if (scoresAll100 && !disableFireworks) {
5749
5753
  this._enableFireworks();
5750
- }
5751
-
5752
- if (turnOffTheLights) {
5753
- toggleDarkTheme(this._dom, true);
5754
+ // If dark mode is allowed, force it on because it looks so much better.
5755
+ if (!disableDarkMode) toggleDarkTheme(this._dom, true);
5754
5756
  }
5755
5757
 
5756
5758
  // Show the metric descriptions by default when there is an error.
@@ -6004,14 +6006,16 @@ class ReportUIFeatures {
6004
6006
  }
6005
6007
 
6006
6008
  /**
6007
- * DevTools uses its own file manager to download files, so it redefines this function.
6008
- * Wrapper is necessary so DevTools can still override this function.
6009
- *
6010
6009
  * @param {Blob|File} blob
6011
6010
  */
6012
6011
  _saveFile(blob) {
6013
- const filename = fileNamer.getLhrFilenamePrefix(this.json);
6014
- this._dom.saveFile(blob, filename);
6012
+ const ext = blob.type.match('json') ? '.json' : '.html';
6013
+ const filename = fileNamer.getLhrFilenamePrefix(this.json) + ext;
6014
+ if (this._opts.onSaveFileOverride) {
6015
+ this._opts.onSaveFileOverride(blob, filename);
6016
+ } else {
6017
+ this._dom.saveFile(blob, filename);
6018
+ }
6015
6019
  }
6016
6020
  }
6017
6021