lighthouse 10.0.2-dev.20230322 → 10.1.0-dev.20230323

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/cli/run.js CHANGED
@@ -241,7 +241,7 @@ async function runLighthouse(url, flags, config) {
241
241
  if (flags.legacyNavigation) {
242
242
  log.warn('CLI', 'Legacy navigation CLI is deprecated');
243
243
  flags.channel = 'legacy-navigation-cli';
244
- } else {
244
+ } else if (!flags.channel) {
245
245
  flags.channel = 'cli';
246
246
  }
247
247
 
@@ -84,6 +84,7 @@ function getHTMLImages(allElements) {
84
84
  isPicture,
85
85
  loading: element.loading,
86
86
  isInShadowDOM: element.getRootNode() instanceof ShadowRoot,
87
+ fetchPriority: element.fetchPriority,
87
88
  // @ts-expect-error - getNodeDetails put into scope via stringification
88
89
  node: getNodeDetails(element),
89
90
  };
@@ -70,6 +70,7 @@ function getLinkElementsInDOM() {
70
70
  crossOrigin: link.crossOrigin,
71
71
  hrefRaw,
72
72
  source,
73
+ fetchPriority: link.fetchPriority,
73
74
  // @ts-expect-error - put into scope via stringification
74
75
  node: getNodeDetails(link),
75
76
  });
@@ -134,6 +135,7 @@ class LinkElements extends FRGatherer {
134
135
  as: link.as || '',
135
136
  crossOrigin: getCrossoriginFromHeader(link.crossorigin),
136
137
  source: 'headers',
138
+ fetchPriority: link.fetchpriority,
137
139
  node: null,
138
140
  });
139
141
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "10.0.2-dev.20230322",
4
+ "version": "10.1.0-dev.20230323",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {
@@ -308,6 +308,8 @@ declare module Artifacts {
308
308
  /** Where the link was found, either in the DOM or in the headers of the main document */
309
309
  source: 'head'|'body'|'headers'
310
310
  node: NodeDetails | null
311
+ /** The fetch priority hint for preload links. */
312
+ fetchPriority?: string;
311
313
  }
312
314
 
313
315
  interface Script extends Omit<Crdp.Debugger.ScriptParsedEvent, 'url'|'embedderName'> {
@@ -534,6 +536,8 @@ declare module Artifacts {
534
536
  node: NodeDetails;
535
537
  /** The loading attribute of the image. */
536
538
  loading?: string;
539
+ /** The fetch priority hint for HTMLImageElements. */
540
+ fetchPriority?: string;
537
541
  }
538
542
 
539
543
  interface OptimizedImage {
@@ -35,9 +35,22 @@ declare global {
35
35
 
36
36
  /** Injected into the page when the `--debug` flag is used. */
37
37
  continueLighthouseRun(): void;
38
+ }
38
39
 
39
- // Not defined in tsc yet: https://github.com/microsoft/TypeScript/issues/40807
40
- requestIdleCallback(callback: (deadline: {didTimeout: boolean, timeRemaining: () => DOMHighResTimeStamp}) => void, options?: {timeout: number}): number;
40
+ // `fetchPriority` not defined in tsc as of 4.9.4.
41
+ interface HTMLImageElement {
42
+ /**
43
+ * Sets the priority for fetches initiated by the element.
44
+ * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-fetchpriority
45
+ */
46
+ fetchPriority: string;
47
+ }
48
+ interface HTMLLinkElement {
49
+ /**
50
+ * Sets the priority for fetches initiated by the element.
51
+ * @see https://html.spec.whatwg.org/multipage/semantics.html#dom-link-fetchpriority
52
+ */
53
+ fetchPriority: string;
41
54
  }
42
55
  }
43
56