lighthouse 10.4.0-dev.20230712 → 10.4.0-dev.20230714

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.
Files changed (174) hide show
  1. package/cli/cli-flags.d.ts +1 -6
  2. package/cli/cli-flags.js +0 -5
  3. package/cli/run.js +3 -10
  4. package/cli/test/smokehouse/lighthouse-runners/bundle.js +3 -1
  5. package/core/config/config-helpers.d.ts +3 -3
  6. package/core/config/config-helpers.js +5 -12
  7. package/core/config/config.js +1 -7
  8. package/core/config/constants.d.ts +0 -2
  9. package/core/config/constants.js +0 -16
  10. package/core/config/filters.js +1 -1
  11. package/core/config/validation.d.ts +5 -10
  12. package/core/config/validation.js +12 -22
  13. package/core/gather/base-artifacts.d.ts +4 -4
  14. package/core/gather/base-artifacts.js +2 -6
  15. package/core/gather/base-gatherer.d.ts +12 -37
  16. package/core/gather/base-gatherer.js +7 -54
  17. package/core/gather/driver/dom.d.ts +4 -4
  18. package/core/gather/driver/dom.js +2 -2
  19. package/core/gather/driver/environment.d.ts +4 -4
  20. package/core/gather/driver/environment.js +2 -2
  21. package/core/gather/driver/execution-context.d.ts +12 -3
  22. package/core/gather/driver/execution-context.js +27 -3
  23. package/core/gather/driver/navigation.d.ts +2 -2
  24. package/core/gather/driver/navigation.js +1 -1
  25. package/core/gather/driver/network-monitor.d.ts +6 -6
  26. package/core/gather/driver/network-monitor.js +3 -3
  27. package/core/gather/driver/network.d.ts +2 -2
  28. package/core/gather/driver/network.js +1 -1
  29. package/core/gather/driver/prepare.d.ts +10 -10
  30. package/core/gather/driver/prepare.js +10 -10
  31. package/core/gather/driver/service-workers.d.ts +4 -4
  32. package/core/gather/driver/service-workers.js +2 -2
  33. package/core/gather/driver/storage.d.ts +6 -6
  34. package/core/gather/driver/storage.js +3 -3
  35. package/core/gather/driver/target-manager.d.ts +6 -5
  36. package/core/gather/driver/target-manager.js +3 -3
  37. package/core/gather/driver/wait-for-condition.d.ts +14 -14
  38. package/core/gather/driver/wait-for-condition.js +8 -8
  39. package/core/gather/driver.d.ts +4 -4
  40. package/core/gather/driver.js +3 -3
  41. package/core/gather/fetcher.d.ts +3 -3
  42. package/core/gather/fetcher.js +1 -1
  43. package/core/gather/gatherers/accessibility.d.ts +4 -4
  44. package/core/gather/gatherers/accessibility.js +3 -3
  45. package/core/gather/gatherers/anchor-elements.d.ts +4 -4
  46. package/core/gather/gatherers/anchor-elements.js +4 -4
  47. package/core/gather/gatherers/bf-cache-failures.d.ts +8 -14
  48. package/core/gather/gatherers/bf-cache-failures.js +5 -14
  49. package/core/gather/gatherers/cache-contents.d.ts +4 -4
  50. package/core/gather/gatherers/cache-contents.js +3 -3
  51. package/core/gather/gatherers/console-messages.d.ts +6 -6
  52. package/core/gather/gatherers/console-messages.js +4 -4
  53. package/core/gather/gatherers/css-usage.d.ts +14 -14
  54. package/core/gather/gatherers/css-usage.js +9 -9
  55. package/core/gather/gatherers/devtools-log-compat.d.ts +5 -5
  56. package/core/gather/gatherers/devtools-log-compat.js +4 -4
  57. package/core/gather/gatherers/devtools-log.d.ts +6 -6
  58. package/core/gather/gatherers/devtools-log.js +4 -4
  59. package/core/gather/gatherers/dobetterweb/doctype.d.ts +4 -4
  60. package/core/gather/gatherers/dobetterweb/doctype.js +3 -3
  61. package/core/gather/gatherers/dobetterweb/domstats.d.ts +4 -4
  62. package/core/gather/gatherers/dobetterweb/domstats.js +3 -3
  63. package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +10 -22
  64. package/core/gather/gatherers/dobetterweb/optimized-images.js +10 -27
  65. package/core/gather/gatherers/dobetterweb/response-compression.d.ts +6 -12
  66. package/core/gather/gatherers/dobetterweb/response-compression.js +6 -15
  67. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +8 -14
  68. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +5 -14
  69. package/core/gather/gatherers/full-page-screenshot.d.ts +10 -10
  70. package/core/gather/gatherers/full-page-screenshot.js +6 -6
  71. package/core/gather/gatherers/global-listeners.d.ts +4 -4
  72. package/core/gather/gatherers/global-listeners.js +3 -3
  73. package/core/gather/gatherers/iframe-elements.d.ts +4 -4
  74. package/core/gather/gatherers/iframe-elements.js +3 -3
  75. package/core/gather/gatherers/image-elements.d.ts +10 -10
  76. package/core/gather/gatherers/image-elements.js +6 -6
  77. package/core/gather/gatherers/inputs.d.ts +4 -4
  78. package/core/gather/gatherers/inputs.js +3 -3
  79. package/core/gather/gatherers/inspector-issues.d.ts +8 -19
  80. package/core/gather/gatherers/inspector-issues.js +9 -26
  81. package/core/gather/gatherers/installability-errors.d.ts +6 -6
  82. package/core/gather/gatherers/installability-errors.js +4 -4
  83. package/core/gather/gatherers/js-usage.d.ts +6 -6
  84. package/core/gather/gatherers/js-usage.js +4 -4
  85. package/core/gather/gatherers/link-elements.d.ts +8 -20
  86. package/core/gather/gatherers/link-elements.js +7 -24
  87. package/core/gather/gatherers/main-document-content.d.ts +4 -16
  88. package/core/gather/gatherers/main-document-content.js +5 -23
  89. package/core/gather/gatherers/meta-elements.d.ts +4 -4
  90. package/core/gather/gatherers/meta-elements.js +3 -3
  91. package/core/gather/gatherers/network-user-agent.d.ts +5 -5
  92. package/core/gather/gatherers/network-user-agent.js +4 -4
  93. package/core/gather/gatherers/script-elements.d.ts +6 -11
  94. package/core/gather/gatherers/script-elements.js +4 -13
  95. package/core/gather/gatherers/scripts.d.ts +6 -6
  96. package/core/gather/gatherers/scripts.js +4 -4
  97. package/core/gather/gatherers/seo/embedded-content.d.ts +4 -4
  98. package/core/gather/gatherers/seo/embedded-content.js +3 -3
  99. package/core/gather/gatherers/seo/font-size.d.ts +6 -6
  100. package/core/gather/gatherers/seo/font-size.js +5 -5
  101. package/core/gather/gatherers/seo/robots-txt.d.ts +4 -4
  102. package/core/gather/gatherers/seo/robots-txt.js +3 -3
  103. package/core/gather/gatherers/seo/tap-targets.d.ts +8 -8
  104. package/core/gather/gatherers/seo/tap-targets.js +5 -5
  105. package/core/gather/gatherers/service-worker.d.ts +4 -10
  106. package/core/gather/gatherers/service-worker.js +3 -15
  107. package/core/gather/gatherers/source-maps.d.ts +12 -12
  108. package/core/gather/gatherers/source-maps.js +7 -7
  109. package/core/gather/gatherers/stacks.d.ts +7 -7
  110. package/core/gather/gatherers/stacks.js +6 -6
  111. package/core/gather/gatherers/trace-compat.d.ts +5 -5
  112. package/core/gather/gatherers/trace-compat.js +4 -4
  113. package/core/gather/gatherers/trace-elements.d.ts +13 -25
  114. package/core/gather/gatherers/trace-elements.js +13 -30
  115. package/core/gather/gatherers/trace.d.ts +8 -8
  116. package/core/gather/gatherers/trace.js +5 -5
  117. package/core/gather/gatherers/viewport-dimensions.d.ts +4 -4
  118. package/core/gather/gatherers/viewport-dimensions.js +3 -3
  119. package/core/gather/gatherers/web-app-manifest.d.ts +8 -8
  120. package/core/gather/gatherers/web-app-manifest.js +5 -5
  121. package/core/gather/navigation-runner.d.ts +9 -9
  122. package/core/gather/navigation-runner.js +6 -6
  123. package/core/gather/runner-helpers.d.ts +3 -3
  124. package/core/gather/runner-helpers.js +12 -4
  125. package/core/gather/session.d.ts +2 -2
  126. package/core/gather/session.js +1 -1
  127. package/core/gather/snapshot-runner.d.ts +2 -2
  128. package/core/gather/snapshot-runner.js +1 -1
  129. package/core/gather/timespan-runner.d.ts +2 -2
  130. package/core/gather/timespan-runner.js +1 -1
  131. package/core/index.cjs +0 -7
  132. package/core/index.d.ts +0 -15
  133. package/core/index.js +2 -40
  134. package/core/lib/asset-saver.js +8 -4
  135. package/core/lib/axe.js +1 -1
  136. package/core/lib/emulation.d.ts +14 -14
  137. package/core/lib/emulation.js +7 -7
  138. package/core/lib/page-functions.d.ts +2 -0
  139. package/core/lib/page-functions.js +10 -0
  140. package/core/lib/sentry.js +9 -2
  141. package/core/runner.d.ts +8 -30
  142. package/core/runner.js +6 -39
  143. package/core/user-flow.d.ts +4 -4
  144. package/core/user-flow.js +2 -2
  145. package/dist/report/bundle.esm.js +2221 -5832
  146. package/dist/report/flow.js +2631 -235
  147. package/dist/report/standalone.js +2586 -234
  148. package/package.json +9 -16
  149. package/third-party/esbuild-plugins-polyfills/LICENSE +3 -0
  150. package/third-party/esbuild-plugins-polyfills/README.md +7 -0
  151. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.d.ts +9 -0
  152. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.js +129 -0
  153. package/tsconfig.json +1 -0
  154. package/types/artifacts.d.ts +12 -45
  155. package/types/config.d.ts +10 -52
  156. package/types/externs.d.ts +0 -2
  157. package/types/gatherer.d.ts +20 -45
  158. package/types/lh.d.ts +0 -2
  159. package/core/gather/gatherers/gatherer.d.ts +0 -46
  160. package/core/gather/gatherers/gatherer.js +0 -58
  161. package/core/legacy/config/config.d.ts +0 -107
  162. package/core/legacy/config/config.js +0 -566
  163. package/core/legacy/config/legacy-default-config.d.ts +0 -4
  164. package/core/legacy/config/legacy-default-config.js +0 -87
  165. package/core/legacy/gather/connections/connection.d.ts +0 -77
  166. package/core/legacy/gather/connections/connection.js +0 -196
  167. package/core/legacy/gather/connections/cri.d.ts +0 -27
  168. package/core/legacy/gather/connections/cri.js +0 -162
  169. package/core/legacy/gather/connections/raw.d.ts +0 -20
  170. package/core/legacy/gather/connections/raw.js +0 -57
  171. package/core/legacy/gather/driver.d.ts +0 -216
  172. package/core/legacy/gather/driver.js +0 -480
  173. package/core/legacy/gather/gather-runner.d.ts +0 -166
  174. package/core/legacy/gather/gather-runner.js +0 -590
@@ -1,35 +1,35 @@
1
1
  export default ImageElements;
2
- declare class ImageElements extends FRGatherer {
2
+ declare class ImageElements extends BaseGatherer {
3
3
  /** @type {Map<string, {naturalWidth: number, naturalHeight: number}>} */
4
4
  _naturalSizeCache: Map<string, {
5
5
  naturalWidth: number;
6
6
  naturalHeight: number;
7
7
  }>;
8
8
  /**
9
- * @param {LH.Gatherer.FRTransitionalDriver} driver
9
+ * @param {LH.Gatherer.Driver} driver
10
10
  * @param {LH.Artifacts.ImageElement} element
11
11
  */
12
- fetchElementWithSizeInformation(driver: LH.Gatherer.FRTransitionalDriver, element: LH.Artifacts.ImageElement): Promise<void>;
12
+ fetchElementWithSizeInformation(driver: LH.Gatherer.Driver, element: LH.Artifacts.ImageElement): Promise<void>;
13
13
  /**
14
14
  * Images might be sized via CSS. In order to compute unsized-images failures, we need to collect
15
15
  * matched CSS rules to see if this is the case.
16
16
  * @url http://go/dwoqq (googlers only)
17
- * @param {LH.Gatherer.FRProtocolSession} session
17
+ * @param {LH.Gatherer.ProtocolSession} session
18
18
  * @param {string} devtoolsNodePath
19
19
  * @param {LH.Artifacts.ImageElement} element
20
20
  */
21
- fetchSourceRules(session: LH.Gatherer.FRProtocolSession, devtoolsNodePath: string, element: LH.Artifacts.ImageElement): Promise<void>;
21
+ fetchSourceRules(session: LH.Gatherer.ProtocolSession, devtoolsNodePath: string, element: LH.Artifacts.ImageElement): Promise<void>;
22
22
  /**
23
23
  *
24
- * @param {LH.Gatherer.FRTransitionalDriver} driver
24
+ * @param {LH.Gatherer.Driver} driver
25
25
  * @param {LH.Artifacts.ImageElement[]} elements
26
26
  */
27
- collectExtraDetails(driver: LH.Gatherer.FRTransitionalDriver, elements: LH.Artifacts.ImageElement[]): Promise<void>;
27
+ collectExtraDetails(driver: LH.Gatherer.Driver, elements: LH.Artifacts.ImageElement[]): Promise<void>;
28
28
  /**
29
- * @param {LH.Gatherer.FRTransitionalContext} context
29
+ * @param {LH.Gatherer.Context} context
30
30
  * @return {Promise<LH.Artifacts['ImageElements']>}
31
31
  */
32
- getArtifact(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['ImageElements']>;
32
+ getArtifact(context: LH.Gatherer.Context): Promise<LH.Artifacts['ImageElements']>;
33
33
  }
34
- import FRGatherer from '../base-gatherer.js';
34
+ import BaseGatherer from '../base-gatherer.js';
35
35
  //# sourceMappingURL=image-elements.d.ts.map
@@ -11,7 +11,7 @@
11
11
 
12
12
  import log from 'lighthouse-logger';
13
13
 
14
- import FRGatherer from '../base-gatherer.js';
14
+ import BaseGatherer from '../base-gatherer.js';
15
15
  import {pageFunctions} from '../../lib/page-functions.js';
16
16
  import * as FontSize from './seo/font-size.js';
17
17
 
@@ -235,7 +235,7 @@ function getPixelArea(element) {
235
235
  return element.displayedHeight * element.displayedWidth;
236
236
  }
237
237
 
238
- class ImageElements extends FRGatherer {
238
+ class ImageElements extends BaseGatherer {
239
239
  /** @type {LH.Gatherer.GathererMeta} */
240
240
  meta = {
241
241
  supportedModes: ['snapshot', 'timespan', 'navigation'],
@@ -248,7 +248,7 @@ class ImageElements extends FRGatherer {
248
248
  }
249
249
 
250
250
  /**
251
- * @param {LH.Gatherer.FRTransitionalDriver} driver
251
+ * @param {LH.Gatherer.Driver} driver
252
252
  * @param {LH.Artifacts.ImageElement} element
253
253
  */
254
254
  async fetchElementWithSizeInformation(driver, element) {
@@ -276,7 +276,7 @@ class ImageElements extends FRGatherer {
276
276
  * Images might be sized via CSS. In order to compute unsized-images failures, we need to collect
277
277
  * matched CSS rules to see if this is the case.
278
278
  * @url http://go/dwoqq (googlers only)
279
- * @param {LH.Gatherer.FRProtocolSession} session
279
+ * @param {LH.Gatherer.ProtocolSession} session
280
280
  * @param {string} devtoolsNodePath
281
281
  * @param {LH.Artifacts.ImageElement} element
282
282
  */
@@ -302,7 +302,7 @@ class ImageElements extends FRGatherer {
302
302
 
303
303
  /**
304
304
  *
305
- * @param {LH.Gatherer.FRTransitionalDriver} driver
305
+ * @param {LH.Gatherer.Driver} driver
306
306
  * @param {LH.Artifacts.ImageElement[]} elements
307
307
  */
308
308
  async collectExtraDetails(driver, elements) {
@@ -334,7 +334,7 @@ class ImageElements extends FRGatherer {
334
334
  }
335
335
 
336
336
  /**
337
- * @param {LH.Gatherer.FRTransitionalContext} context
337
+ * @param {LH.Gatherer.Context} context
338
338
  * @return {Promise<LH.Artifacts['ImageElements']>}
339
339
  */
340
340
  async getArtifact(context) {
@@ -1,10 +1,10 @@
1
1
  export default Inputs;
2
- declare class Inputs extends FRGatherer {
2
+ declare class Inputs extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} passContext
4
+ * @param {LH.Gatherer.Context} passContext
5
5
  * @return {Promise<LH.Artifacts['Inputs']>}
6
6
  */
7
- getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['Inputs']>;
7
+ getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['Inputs']>;
8
8
  }
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  //# sourceMappingURL=inputs.d.ts.map
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* global getNodeDetails */
8
8
 
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  import {pageFunctions} from '../../lib/page-functions.js';
11
11
 
12
12
  /* eslint-env browser, node */
@@ -93,14 +93,14 @@ function collectElements() {
93
93
  }
94
94
  /* c8 ignore stop */
95
95
 
96
- class Inputs extends FRGatherer {
96
+ class Inputs extends BaseGatherer {
97
97
  /** @type {LH.Gatherer.GathererMeta} */
98
98
  meta = {
99
99
  supportedModes: ['snapshot', 'navigation'],
100
100
  };
101
101
 
102
102
  /**
103
- * @param {LH.Gatherer.FRTransitionalContext} passContext
103
+ * @param {LH.Gatherer.Context} passContext
104
104
  * @return {Promise<LH.Artifacts['Inputs']>}
105
105
  */
106
106
  async getArtifact(passContext) {
@@ -1,5 +1,5 @@
1
1
  export default InspectorIssues;
2
- declare class InspectorIssues extends FRGatherer {
2
+ declare class InspectorIssues extends BaseGatherer {
3
3
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
4
4
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
5
5
  /** @type {Array<LH.Crdp.Audits.InspectorIssue>} */
@@ -10,29 +10,18 @@ declare class InspectorIssues extends FRGatherer {
10
10
  */
11
11
  onIssueAdded(entry: LH.Crdp.Audits.IssueAddedEvent): void;
12
12
  /**
13
- * @param {LH.Gatherer.FRTransitionalContext} context
13
+ * @param {LH.Gatherer.Context} context
14
14
  */
15
- startInstrumentation(context: LH.Gatherer.FRTransitionalContext): Promise<void>;
15
+ startInstrumentation(context: LH.Gatherer.Context): Promise<void>;
16
16
  /**
17
- * @param {LH.Gatherer.FRTransitionalContext} context
17
+ * @param {LH.Gatherer.Context} context
18
18
  */
19
- stopInstrumentation(context: LH.Gatherer.FRTransitionalContext): Promise<void>;
19
+ stopInstrumentation(context: LH.Gatherer.Context): Promise<void>;
20
20
  /**
21
- * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
21
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
22
22
  * @return {Promise<LH.Artifacts['InspectorIssues']>}
23
23
  */
24
- _getArtifact(networkRecords: Array<LH.Artifacts.NetworkRequest>): Promise<LH.Artifacts['InspectorIssues']>;
25
- /**
26
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
27
- * @return {Promise<LH.Artifacts['InspectorIssues']>}
28
- */
29
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['InspectorIssues']>;
30
- /**
31
- * @param {LH.Gatherer.PassContext} passContext
32
- * @param {LH.Gatherer.LoadData} loadData
33
- * @return {Promise<LH.Artifacts['InspectorIssues']>}
34
- */
35
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['InspectorIssues']>;
24
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['InspectorIssues']>;
36
25
  }
37
- import FRGatherer from '../base-gatherer.js';
26
+ import BaseGatherer from '../base-gatherer.js';
38
27
  //# sourceMappingURL=inspector-issues.d.ts.map
@@ -9,11 +9,11 @@
9
9
  */
10
10
 
11
11
 
12
- import FRGatherer from '../base-gatherer.js';
12
+ import BaseGatherer from '../base-gatherer.js';
13
13
  import {NetworkRecords} from '../../computed/network-records.js';
14
14
  import DevtoolsLog from './devtools-log.js';
15
15
 
16
- class InspectorIssues extends FRGatherer {
16
+ class InspectorIssues extends BaseGatherer {
17
17
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
18
18
  meta = {
19
19
  supportedModes: ['timespan', 'navigation'],
@@ -35,7 +35,7 @@ class InspectorIssues extends FRGatherer {
35
35
  }
36
36
 
37
37
  /**
38
- * @param {LH.Gatherer.FRTransitionalContext} context
38
+ * @param {LH.Gatherer.Context} context
39
39
  */
40
40
  async startInstrumentation(context) {
41
41
  const session = context.driver.defaultSession;
@@ -44,7 +44,7 @@ class InspectorIssues extends FRGatherer {
44
44
  }
45
45
 
46
46
  /**
47
- * @param {LH.Gatherer.FRTransitionalContext} context
47
+ * @param {LH.Gatherer.Context} context
48
48
  */
49
49
  async stopInstrumentation(context) {
50
50
  const session = context.driver.defaultSession;
@@ -53,10 +53,13 @@ class InspectorIssues extends FRGatherer {
53
53
  }
54
54
 
55
55
  /**
56
- * @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
56
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
57
57
  * @return {Promise<LH.Artifacts['InspectorIssues']>}
58
58
  */
59
- async _getArtifact(networkRecords) {
59
+ async getArtifact(context) {
60
+ const devtoolsLog = context.dependencies.DevtoolsLog;
61
+ const networkRecords = await NetworkRecords.request(devtoolsLog, context);
62
+
60
63
  /** @type {LH.Artifacts.InspectorIssues} */
61
64
  const artifact = {
62
65
  attributionReportingIssue: [],
@@ -103,26 +106,6 @@ class InspectorIssues extends FRGatherer {
103
106
 
104
107
  return artifact;
105
108
  }
106
-
107
- /**
108
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
109
- * @return {Promise<LH.Artifacts['InspectorIssues']>}
110
- */
111
- async getArtifact(context) {
112
- const devtoolsLog = context.dependencies.DevtoolsLog;
113
- const networkRecords = await NetworkRecords.request(devtoolsLog, context);
114
- return this._getArtifact(networkRecords);
115
- }
116
-
117
- /**
118
- * @param {LH.Gatherer.PassContext} passContext
119
- * @param {LH.Gatherer.LoadData} loadData
120
- * @return {Promise<LH.Artifacts['InspectorIssues']>}
121
- */
122
- async afterPass(passContext, loadData) {
123
- await this.stopInstrumentation({...passContext, dependencies: {}});
124
- return this._getArtifact(loadData.networkRecords);
125
- }
126
109
  }
127
110
 
128
111
  export default InspectorIssues;
@@ -1,17 +1,17 @@
1
1
  export default InstallabilityErrors;
2
- declare class InstallabilityErrors extends FRGatherer {
2
+ declare class InstallabilityErrors extends BaseGatherer {
3
3
  /**
4
4
  * Creates an Artifacts.InstallabilityErrors, tranforming data from the protocol
5
5
  * for old versions of Chrome.
6
- * @param {LH.Gatherer.FRProtocolSession} session
6
+ * @param {LH.Gatherer.ProtocolSession} session
7
7
  * @return {Promise<LH.Artifacts['InstallabilityErrors']>}
8
8
  */
9
- static getInstallabilityErrors(session: LH.Gatherer.FRProtocolSession): Promise<LH.Artifacts['InstallabilityErrors']>;
9
+ static getInstallabilityErrors(session: LH.Gatherer.ProtocolSession): Promise<LH.Artifacts['InstallabilityErrors']>;
10
10
  /**
11
- * @param {LH.Gatherer.FRTransitionalContext} context
11
+ * @param {LH.Gatherer.Context} context
12
12
  * @return {Promise<LH.Artifacts['InstallabilityErrors']>}
13
13
  */
14
- getArtifact(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['InstallabilityErrors']>;
14
+ getArtifact(context: LH.Gatherer.Context): Promise<LH.Artifacts['InstallabilityErrors']>;
15
15
  }
16
- import FRGatherer from '../base-gatherer.js';
16
+ import BaseGatherer from '../base-gatherer.js';
17
17
  //# sourceMappingURL=installability-errors.d.ts.map
@@ -6,9 +6,9 @@
6
6
 
7
7
  import log from 'lighthouse-logger';
8
8
 
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
 
11
- class InstallabilityErrors extends FRGatherer {
11
+ class InstallabilityErrors extends BaseGatherer {
12
12
  /** @type {LH.Gatherer.GathererMeta} */
13
13
  meta = {
14
14
  supportedModes: ['snapshot', 'navigation'],
@@ -17,7 +17,7 @@ class InstallabilityErrors extends FRGatherer {
17
17
  /**
18
18
  * Creates an Artifacts.InstallabilityErrors, tranforming data from the protocol
19
19
  * for old versions of Chrome.
20
- * @param {LH.Gatherer.FRProtocolSession} session
20
+ * @param {LH.Gatherer.ProtocolSession} session
21
21
  * @return {Promise<LH.Artifacts['InstallabilityErrors']>}
22
22
  */
23
23
  static async getInstallabilityErrors(session) {
@@ -35,7 +35,7 @@ class InstallabilityErrors extends FRGatherer {
35
35
  }
36
36
 
37
37
  /**
38
- * @param {LH.Gatherer.FRTransitionalContext} context
38
+ * @param {LH.Gatherer.Context} context
39
39
  * @return {Promise<LH.Artifacts['InstallabilityErrors']>}
40
40
  */
41
41
  async getArtifact(context) {
@@ -2,21 +2,21 @@ export default JsUsage;
2
2
  /**
3
3
  * @fileoverview Tracks unused JavaScript
4
4
  */
5
- declare class JsUsage extends FRGatherer {
5
+ declare class JsUsage extends BaseGatherer {
6
6
  /** @type {LH.Crdp.Profiler.ScriptCoverage[]} */
7
7
  _scriptUsages: LH.Crdp.Profiler.ScriptCoverage[];
8
8
  /**
9
- * @param {LH.Gatherer.FRTransitionalContext} context
9
+ * @param {LH.Gatherer.Context} context
10
10
  */
11
- startInstrumentation(context: LH.Gatherer.FRTransitionalContext): Promise<void>;
11
+ startInstrumentation(context: LH.Gatherer.Context): Promise<void>;
12
12
  /**
13
- * @param {LH.Gatherer.FRTransitionalContext} context
13
+ * @param {LH.Gatherer.Context} context
14
14
  */
15
- stopInstrumentation(context: LH.Gatherer.FRTransitionalContext): Promise<void>;
15
+ stopInstrumentation(context: LH.Gatherer.Context): Promise<void>;
16
16
  /**
17
17
  * @return {Promise<LH.Artifacts['JsUsage']>}
18
18
  */
19
19
  getArtifact(): Promise<LH.Artifacts['JsUsage']>;
20
20
  }
21
- import FRGatherer from '../base-gatherer.js';
21
+ import BaseGatherer from '../base-gatherer.js';
22
22
  //# sourceMappingURL=js-usage.d.ts.map
@@ -4,12 +4,12 @@
4
4
  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
5
  */
6
6
 
7
- import FRGatherer from '../base-gatherer.js';
7
+ import BaseGatherer from '../base-gatherer.js';
8
8
 
9
9
  /**
10
10
  * @fileoverview Tracks unused JavaScript
11
11
  */
12
- class JsUsage extends FRGatherer {
12
+ class JsUsage extends BaseGatherer {
13
13
  /** @type {LH.Gatherer.GathererMeta} */
14
14
  meta = {
15
15
  supportedModes: ['snapshot', 'timespan', 'navigation'],
@@ -22,7 +22,7 @@ class JsUsage extends FRGatherer {
22
22
  }
23
23
 
24
24
  /**
25
- * @param {LH.Gatherer.FRTransitionalContext} context
25
+ * @param {LH.Gatherer.Context} context
26
26
  */
27
27
  async startInstrumentation(context) {
28
28
  const session = context.driver.defaultSession;
@@ -31,7 +31,7 @@ class JsUsage extends FRGatherer {
31
31
  }
32
32
 
33
33
  /**
34
- * @param {LH.Gatherer.FRTransitionalContext} context
34
+ * @param {LH.Gatherer.Context} context
35
35
  */
36
36
  async stopInstrumentation(context) {
37
37
  const session = context.driver.defaultSession;
@@ -1,16 +1,16 @@
1
1
  export default LinkElements;
2
- declare class LinkElements extends FRGatherer {
2
+ declare class LinkElements extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} context
4
+ * @param {LH.Gatherer.Context} context
5
5
  * @return {Promise<LH.Artifacts['LinkElements']>}
6
6
  */
7
- static getLinkElementsInDOM(context: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['LinkElements']>;
7
+ static getLinkElementsInDOM(context: LH.Gatherer.Context): Promise<LH.Artifacts['LinkElements']>;
8
8
  /**
9
- * @param {LH.Gatherer.FRTransitionalContext} context
9
+ * @param {LH.Gatherer.Context} context
10
10
  * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
11
11
  * @return {Promise<LH.Artifacts['LinkElements']>}
12
12
  */
13
- static getLinkElementsInHeaders(context: LH.Gatherer.FRTransitionalContext, devtoolsLog: LH.Artifacts['DevtoolsLog']): Promise<LH.Artifacts['LinkElements']>;
13
+ static getLinkElementsInHeaders(context: LH.Gatherer.Context, devtoolsLog: LH.Artifacts['DevtoolsLog']): Promise<LH.Artifacts['LinkElements']>;
14
14
  /**
15
15
  * This needs to be in the constructor.
16
16
  * https://github.com/GoogleChrome/lighthouse/issues/12134
@@ -18,25 +18,13 @@ declare class LinkElements extends FRGatherer {
18
18
  */
19
19
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
20
20
  /**
21
- * @param {LH.Gatherer.FRTransitionalContext} context
22
- * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
23
- * @return {Promise<LH.Artifacts['LinkElements']>}
24
- */
25
- _getArtifact(context: LH.Gatherer.FRTransitionalContext, devtoolsLog: LH.Artifacts['DevtoolsLog']): Promise<LH.Artifacts['LinkElements']>;
26
- /**
27
- * @param {LH.Gatherer.PassContext} context
28
- * @param {LH.Gatherer.LoadData} loadData
29
- * @return {Promise<LH.Artifacts['LinkElements']>}
30
- */
31
- afterPass(context: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['LinkElements']>;
32
- /**
33
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
21
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
34
22
  * @return {Promise<LH.Artifacts['LinkElements']>}
35
23
  */
36
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['LinkElements']>;
24
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['LinkElements']>;
37
25
  }
38
26
  export namespace UIStrings {
39
27
  const headerParseWarning: string;
40
28
  }
41
- import FRGatherer from '../base-gatherer.js';
29
+ import BaseGatherer from '../base-gatherer.js';
42
30
  //# sourceMappingURL=link-elements.d.ts.map
@@ -6,7 +6,7 @@
6
6
 
7
7
  import LinkHeader from 'http-link-header';
8
8
 
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  import {pageFunctions} from '../../lib/page-functions.js';
11
11
  import DevtoolsLog from './devtools-log.js';
12
12
  import {MainResource} from '../../computed/main-resource.js';
@@ -93,7 +93,7 @@ function getLinkElementsInDOM() {
93
93
  }
94
94
  /* c8 ignore stop */
95
95
 
96
- class LinkElements extends FRGatherer {
96
+ class LinkElements extends BaseGatherer {
97
97
  constructor() {
98
98
  super();
99
99
  /**
@@ -108,7 +108,7 @@ class LinkElements extends FRGatherer {
108
108
  }
109
109
 
110
110
  /**
111
- * @param {LH.Gatherer.FRTransitionalContext} context
111
+ * @param {LH.Gatherer.Context} context
112
112
  * @return {Promise<LH.Artifacts['LinkElements']>}
113
113
  */
114
114
  static getLinkElementsInDOM(context) {
@@ -125,7 +125,7 @@ class LinkElements extends FRGatherer {
125
125
  }
126
126
 
127
127
  /**
128
- * @param {LH.Gatherer.FRTransitionalContext} context
128
+ * @param {LH.Gatherer.Context} context
129
129
  * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
130
130
  * @return {Promise<LH.Artifacts['LinkElements']>}
131
131
  */
@@ -172,11 +172,11 @@ class LinkElements extends FRGatherer {
172
172
  }
173
173
 
174
174
  /**
175
- * @param {LH.Gatherer.FRTransitionalContext} context
176
- * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
175
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
177
176
  * @return {Promise<LH.Artifacts['LinkElements']>}
178
177
  */
179
- async _getArtifact(context, devtoolsLog) {
178
+ async getArtifact(context) {
179
+ const devtoolsLog = context.dependencies.DevtoolsLog;
180
180
  const fromDOM = await LinkElements.getLinkElementsInDOM(context);
181
181
  const fromHeaders = await LinkElements.getLinkElementsInHeaders(context, devtoolsLog);
182
182
  const linkElements = fromDOM.concat(fromHeaders);
@@ -188,23 +188,6 @@ class LinkElements extends FRGatherer {
188
188
 
189
189
  return linkElements;
190
190
  }
191
-
192
- /**
193
- * @param {LH.Gatherer.PassContext} context
194
- * @param {LH.Gatherer.LoadData} loadData
195
- * @return {Promise<LH.Artifacts['LinkElements']>}
196
- */
197
- async afterPass(context, loadData) {
198
- return this._getArtifact({...context, dependencies: {}}, loadData.devtoolsLog);
199
- }
200
-
201
- /**
202
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
203
- * @return {Promise<LH.Artifacts['LinkElements']>}
204
- */
205
- async getArtifact(context) {
206
- return this._getArtifact(context, context.dependencies.DevtoolsLog);
207
- }
208
191
  }
209
192
 
210
193
  export default LinkElements;
@@ -2,26 +2,14 @@ export default MainDocumentContent;
2
2
  /**
3
3
  * Collects the content of the main html document.
4
4
  */
5
- declare class MainDocumentContent extends FRGatherer {
5
+ declare class MainDocumentContent extends BaseGatherer {
6
6
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
7
7
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
8
8
  /**
9
- * @param {LH.Gatherer.FRTransitionalContext} context
10
- * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
9
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
11
10
  * @return {Promise<LH.Artifacts['MainDocumentContent']>}
12
11
  */
13
- _getArtifact(context: LH.Gatherer.FRTransitionalContext, devtoolsLog: LH.Artifacts['DevtoolsLog']): Promise<LH.Artifacts['MainDocumentContent']>;
14
- /**
15
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
16
- * @return {Promise<LH.Artifacts['MainDocumentContent']>}
17
- */
18
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['MainDocumentContent']>;
19
- /**
20
- * @param {LH.Gatherer.PassContext} passContext
21
- * @param {LH.Gatherer.LoadData} loadData
22
- * @return {Promise<LH.Artifacts['MainDocumentContent']>}
23
- */
24
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): Promise<LH.Artifacts['MainDocumentContent']>;
12
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['MainDocumentContent']>;
25
13
  }
26
- import FRGatherer from '../base-gatherer.js';
14
+ import BaseGatherer from '../base-gatherer.js';
27
15
  //# sourceMappingURL=main-document-content.d.ts.map
@@ -4,7 +4,7 @@
4
4
  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
5
  */
6
6
 
7
- import FRGatherer from '../base-gatherer.js';
7
+ import BaseGatherer from '../base-gatherer.js';
8
8
  import DevtoolsLog from './devtools-log.js';
9
9
  import {fetchResponseBodyFromCache} from '../driver/network.js';
10
10
  import {MainResource} from '../../computed/main-resource.js';
@@ -12,7 +12,7 @@ import {MainResource} from '../../computed/main-resource.js';
12
12
  /**
13
13
  * Collects the content of the main html document.
14
14
  */
15
- class MainDocumentContent extends FRGatherer {
15
+ class MainDocumentContent extends BaseGatherer {
16
16
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
17
17
  meta = {
18
18
  supportedModes: ['navigation'],
@@ -20,34 +20,16 @@ class MainDocumentContent extends FRGatherer {
20
20
  };
21
21
 
22
22
  /**
23
- * @param {LH.Gatherer.FRTransitionalContext} context
24
- * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
23
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
25
24
  * @return {Promise<LH.Artifacts['MainDocumentContent']>}
26
25
  */
27
- async _getArtifact(context, devtoolsLog) {
26
+ async getArtifact(context) {
27
+ const devtoolsLog = context.dependencies.DevtoolsLog;
28
28
  const mainResource =
29
29
  await MainResource.request({devtoolsLog, URL: context.baseArtifacts.URL}, context);
30
30
  const session = context.driver.defaultSession;
31
31
  return fetchResponseBodyFromCache(session, mainResource.requestId);
32
32
  }
33
-
34
- /**
35
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
36
- * @return {Promise<LH.Artifacts['MainDocumentContent']>}
37
- */
38
- async getArtifact(context) {
39
- const devtoolsLog = context.dependencies.DevtoolsLog;
40
- return this._getArtifact(context, devtoolsLog);
41
- }
42
-
43
- /**
44
- * @param {LH.Gatherer.PassContext} passContext
45
- * @param {LH.Gatherer.LoadData} loadData
46
- * @return {Promise<LH.Artifacts['MainDocumentContent']>}
47
- */
48
- async afterPass(passContext, loadData) {
49
- return this._getArtifact({...passContext, dependencies: {}}, loadData.devtoolsLog);
50
- }
51
33
  }
52
34
 
53
35
  export default MainDocumentContent;
@@ -1,10 +1,10 @@
1
1
  export default MetaElements;
2
- declare class MetaElements extends FRGatherer {
2
+ declare class MetaElements extends BaseGatherer {
3
3
  /**
4
- * @param {LH.Gatherer.FRTransitionalContext} passContext
4
+ * @param {LH.Gatherer.Context} passContext
5
5
  * @return {Promise<LH.Artifacts['MetaElements']>}
6
6
  */
7
- getArtifact(passContext: LH.Gatherer.FRTransitionalContext): Promise<LH.Artifacts['MetaElements']>;
7
+ getArtifact(passContext: LH.Gatherer.Context): Promise<LH.Artifacts['MetaElements']>;
8
8
  }
9
- import FRGatherer from '../base-gatherer.js';
9
+ import BaseGatherer from '../base-gatherer.js';
10
10
  //# sourceMappingURL=meta-elements.d.ts.map
@@ -4,7 +4,7 @@
4
4
  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
5
  */
6
6
 
7
- import FRGatherer from '../base-gatherer.js';
7
+ import BaseGatherer from '../base-gatherer.js';
8
8
  import {pageFunctions} from '../../lib/page-functions.js';
9
9
 
10
10
  /* globals getElementsInDocument getNodeDetails */
@@ -38,14 +38,14 @@ function collectMetaElements() {
38
38
  }
39
39
  /* c8 ignore stop */
40
40
 
41
- class MetaElements extends FRGatherer {
41
+ class MetaElements extends BaseGatherer {
42
42
  /** @type {LH.Gatherer.GathererMeta} */
43
43
  meta = {
44
44
  supportedModes: ['snapshot', 'navigation'],
45
45
  };
46
46
 
47
47
  /**
48
- * @param {LH.Gatherer.FRTransitionalContext} passContext
48
+ * @param {LH.Gatherer.Context} passContext
49
49
  * @return {Promise<LH.Artifacts['MetaElements']>}
50
50
  */
51
51
  getArtifact(passContext) {
@@ -1,6 +1,6 @@
1
1
  export default NetworkUserAgent;
2
- /** @implements {LH.Gatherer.FRGathererInstance<'DevtoolsLog'>} */
3
- declare class NetworkUserAgent extends FRGatherer implements LH.Gatherer.FRGathererInstance<'DevtoolsLog'> {
2
+ /** @implements {LH.Gatherer.GathererInstance<'DevtoolsLog'>} */
3
+ declare class NetworkUserAgent extends BaseGatherer implements LH.Gatherer.GathererInstance<'DevtoolsLog'> {
4
4
  /**
5
5
  * @param {LH.Artifacts['DevtoolsLog']} devtoolsLog
6
6
  * @return {string}
@@ -9,10 +9,10 @@ declare class NetworkUserAgent extends FRGatherer implements LH.Gatherer.FRGathe
9
9
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
10
10
  meta: LH.Gatherer.GathererMeta<'DevtoolsLog'>;
11
11
  /**
12
- * @param {LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>} context
12
+ * @param {LH.Gatherer.Context<'DevtoolsLog'>} context
13
13
  * @return {Promise<LH.Artifacts['NetworkUserAgent']>}
14
14
  */
15
- getArtifact(context: LH.Gatherer.FRTransitionalContext<'DevtoolsLog'>): Promise<LH.Artifacts['NetworkUserAgent']>;
15
+ getArtifact(context: LH.Gatherer.Context<'DevtoolsLog'>): Promise<LH.Artifacts['NetworkUserAgent']>;
16
16
  }
17
- import FRGatherer from '../base-gatherer.js';
17
+ import BaseGatherer from '../base-gatherer.js';
18
18
  //# sourceMappingURL=network-user-agent.d.ts.map