chrome-devtools-frontend 1.0.942095 → 1.0.942529

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 (125) hide show
  1. package/config/gni/all_devtools_files.gni +0 -44
  2. package/config/gni/devtools_grd_files.gni +42 -2
  3. package/config/gni/devtools_image_files.gni +1 -1
  4. package/front_end/.eslintrc.js +11 -1
  5. package/front_end/Images/src/{feedback_thin_16x16_icon.svg → survey_feedback_icon.svg} +1 -1
  6. package/front_end/core/sdk/DebuggerModel.ts +4 -14
  7. package/front_end/emulated_devices/module.json +1 -3
  8. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -2
  9. package/front_end/entrypoints/shell/shell.json +0 -1
  10. package/front_end/legacy_test_runner/bindings_test_runner/IsolatedFilesystemTestRunner.js +2 -2
  11. package/front_end/legacy_test_runner/test_runner/TestRunner.js +3 -1
  12. package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
  13. package/front_end/panels/application/components/ReportsGrid.ts +1 -1
  14. package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -0
  15. package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
  16. package/front_end/panels/emulation/DeviceModeView.ts +2 -1
  17. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +3 -1
  18. package/front_end/panels/emulation/MediaQueryInspector.ts +3 -1
  19. package/front_end/panels/emulation/emulation-meta.ts +0 -2
  20. package/front_end/panels/lighthouse/LighthousePanel.ts +2 -4
  21. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -4
  22. package/front_end/panels/lighthouse/module.json +1 -4
  23. package/front_end/panels/profiler/module.json +1 -3
  24. package/front_end/panels/screencast/module.json +1 -4
  25. package/front_end/panels/timeline/module.json +0 -1
  26. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1128 -1158
  27. package/front_end/third_party/lighthouse/locales/ar-XB.json +211 -79
  28. package/front_end/third_party/lighthouse/locales/ar.json +213 -81
  29. package/front_end/third_party/lighthouse/locales/bg.json +211 -79
  30. package/front_end/third_party/lighthouse/locales/ca.json +212 -80
  31. package/front_end/third_party/lighthouse/locales/cs.json +211 -79
  32. package/front_end/third_party/lighthouse/locales/da.json +211 -79
  33. package/front_end/third_party/lighthouse/locales/de.json +211 -79
  34. package/front_end/third_party/lighthouse/locales/el.json +213 -81
  35. package/front_end/third_party/lighthouse/locales/en-GB.json +211 -79
  36. package/front_end/third_party/lighthouse/locales/en-US.json +186 -75
  37. package/front_end/third_party/lighthouse/locales/en-XA.json +211 -79
  38. package/front_end/third_party/lighthouse/locales/en-XL.json +186 -75
  39. package/front_end/third_party/lighthouse/locales/es-419.json +211 -79
  40. package/front_end/third_party/lighthouse/locales/es.json +212 -80
  41. package/front_end/third_party/lighthouse/locales/fi.json +211 -79
  42. package/front_end/third_party/lighthouse/locales/fil.json +211 -79
  43. package/front_end/third_party/lighthouse/locales/fr.json +211 -79
  44. package/front_end/third_party/lighthouse/locales/he.json +212 -80
  45. package/front_end/third_party/lighthouse/locales/hi.json +214 -82
  46. package/front_end/third_party/lighthouse/locales/hr.json +211 -79
  47. package/front_end/third_party/lighthouse/locales/hu.json +211 -79
  48. package/front_end/third_party/lighthouse/locales/id.json +211 -79
  49. package/front_end/third_party/lighthouse/locales/it.json +211 -79
  50. package/front_end/third_party/lighthouse/locales/ja.json +211 -79
  51. package/front_end/third_party/lighthouse/locales/ko.json +211 -79
  52. package/front_end/third_party/lighthouse/locales/lt.json +211 -79
  53. package/front_end/third_party/lighthouse/locales/lv.json +214 -82
  54. package/front_end/third_party/lighthouse/locales/nl.json +211 -79
  55. package/front_end/third_party/lighthouse/locales/no.json +211 -79
  56. package/front_end/third_party/lighthouse/locales/pl.json +211 -79
  57. package/front_end/third_party/lighthouse/locales/pt-PT.json +211 -79
  58. package/front_end/third_party/lighthouse/locales/pt.json +211 -79
  59. package/front_end/third_party/lighthouse/locales/ro.json +212 -80
  60. package/front_end/third_party/lighthouse/locales/ru.json +211 -79
  61. package/front_end/third_party/lighthouse/locales/sk.json +211 -79
  62. package/front_end/third_party/lighthouse/locales/sl.json +211 -79
  63. package/front_end/third_party/lighthouse/locales/sr-Latn.json +211 -79
  64. package/front_end/third_party/lighthouse/locales/sr.json +211 -79
  65. package/front_end/third_party/lighthouse/locales/sv.json +211 -79
  66. package/front_end/third_party/lighthouse/locales/ta.json +218 -86
  67. package/front_end/third_party/lighthouse/locales/te.json +251 -119
  68. package/front_end/third_party/lighthouse/locales/th.json +211 -79
  69. package/front_end/third_party/lighthouse/locales/tr.json +211 -79
  70. package/front_end/third_party/lighthouse/locales/uk.json +212 -80
  71. package/front_end/third_party/lighthouse/locales/vi.json +211 -79
  72. package/front_end/third_party/lighthouse/locales/zh-HK.json +211 -79
  73. package/front_end/third_party/lighthouse/locales/zh-TW.json +211 -79
  74. package/front_end/third_party/lighthouse/locales/zh.json +211 -79
  75. package/front_end/third_party/lighthouse/report/bundle.d.ts +72 -34
  76. package/front_end/third_party/lighthouse/report/bundle.js +698 -492
  77. package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -2
  78. package/front_end/third_party/lighthouse/report-assets/report.js +40 -35
  79. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +2 -4
  80. package/front_end/ui/components/docs/icon_button/basic.ts +3 -3
  81. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -14
  82. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
  83. package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
  84. package/front_end/ui/legacy/Dialog.ts +3 -1
  85. package/front_end/ui/legacy/DropTarget.ts +2 -1
  86. package/front_end/ui/legacy/EmptyWidget.ts +2 -1
  87. package/front_end/ui/legacy/FilterBar.ts +2 -1
  88. package/front_end/ui/legacy/GlassPane.ts +4 -2
  89. package/front_end/ui/legacy/Infobar.ts +3 -2
  90. package/front_end/ui/legacy/InspectorView.ts +6 -1
  91. package/front_end/ui/legacy/ListWidget.ts +2 -1
  92. package/front_end/ui/legacy/PopoverHelper.ts +2 -1
  93. package/front_end/ui/legacy/ProgressIndicator.ts +2 -1
  94. package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -1
  95. package/front_end/ui/legacy/ReportView.ts +2 -1
  96. package/front_end/ui/legacy/RootView.ts +2 -1
  97. package/front_end/ui/legacy/SearchableView.ts +2 -1
  98. package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
  99. package/front_end/ui/legacy/SoftDropDown.ts +4 -2
  100. package/front_end/ui/legacy/SplitWidget.ts +2 -1
  101. package/front_end/ui/legacy/SuggestBox.ts +2 -1
  102. package/front_end/ui/legacy/TabbedPane.ts +2 -1
  103. package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -1
  104. package/front_end/ui/legacy/TextPrompt.ts +2 -1
  105. package/front_end/ui/legacy/Toolbar.ts +3 -2
  106. package/front_end/ui/legacy/Treeoutline.ts +3 -2
  107. package/front_end/ui/legacy/UIUtils.ts +16 -13
  108. package/front_end/ui/legacy/ViewManager.ts +2 -1
  109. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +2 -2
  110. package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
  111. package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
  112. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
  113. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -0
  114. package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -0
  115. package/front_end/ui/legacy/components/source_frame/module.json +0 -3
  116. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +2 -0
  117. package/front_end/ui/legacy/components/text_editor/module.json +0 -3
  118. package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -15
  119. package/front_end/ui/legacy/theme_support/theme_support_impl.ts +7 -9
  120. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +2 -2
  121. package/front_end/ui/legacy/utils/inject-core-styles.ts +7 -4
  122. package/package.json +1 -1
  123. package/front_end/panels/emulation/module.json +0 -11
  124. package/front_end/third_party/lighthouse/report-assets/report.css +0 -1774
  125. package/front_end/ui/legacy/module.json +0 -41
@@ -1,13 +1,14 @@
1
1
 
2
- export type ComponentName = '3pFilter' | 'audit' | 'categoryHeader' | 'chevron' | 'clump' | 'crc' | 'crcChain' | 'elementScreenshot' | 'envItem' | 'footer' | 'fraction' | 'gauge' | 'gaugePwa' | 'heading' | 'metric' | 'metricsToggle' | 'opportunity' | 'opportunityHeader' | 'scorescale' | 'scoresWrapper' | 'snippet' | 'snippetContent' | 'snippetHeader' | 'snippetLine' | 'topbar' | 'warningsToplevel';
2
+ export type ComponentName = '3pFilter' | 'audit' | 'categoryHeader' | 'chevron' | 'clump' | 'crc' | 'crcChain' | 'elementScreenshot' | 'footer' | 'fraction' | 'gauge' | 'gaugePwa' | 'heading' | 'metric' | 'opportunity' | 'opportunityHeader' | 'scorescale' | 'scoresWrapper' | 'snippet' | 'snippetContent' | 'snippetHeader' | 'snippetLine' | 'styles' | 'topbar' | 'warningsToplevel';
3
3
  export type I18n<T> = any;
4
+ export type DetailsRenderer = any;
4
5
  export type CRCSegment = {
5
- node: any[string];
6
+ node: any;
6
7
  isLastChild: boolean;
7
8
  hasChildren: boolean;
8
9
  startTime: number;
9
10
  transferSize: number;
10
- treeMarkers: Array<boolean>;
11
+ treeMarkers: boolean[];
11
12
  };
12
13
  export type LineDetails = {
13
14
  content: string;
@@ -35,14 +36,17 @@ export type LineDetails = {
35
36
  export class DOM {
36
37
  /**
37
38
  * @param {Document} document
39
+ * @param {HTMLElement} rootEl
38
40
  */
39
- constructor(document: Document);
41
+ constructor(document: Document, rootEl: HTMLElement);
40
42
  /** @type {Document} */
41
43
  _document: Document;
42
44
  /** @type {string} */
43
45
  _lighthouseChannel: string;
44
46
  /** @type {Map<string, DocumentFragment>} */
45
47
  _componentCache: Map<string, DocumentFragment>;
48
+ /** @type {HTMLElement} */
49
+ rootEl: HTMLElement;
46
50
  /**
47
51
  * @template {string} T
48
52
  * @param {T} name
@@ -61,6 +65,11 @@ export class DOM {
61
65
  * @return {!DocumentFragment}
62
66
  */
63
67
  createFragment(): DocumentFragment;
68
+ /**
69
+ * @param {string} data
70
+ * @return {!Node}
71
+ */
72
+ createTextNode(data: string): Node;
64
73
  /**
65
74
  * @template {string} T
66
75
  * @param {Element} parentElem
@@ -104,6 +113,8 @@ export class DOM {
104
113
  */
105
114
  setLighthouseChannel(lighthouseChannel: string): void;
106
115
  /**
116
+ * ONLY use if `dom.rootEl` isn't sufficient for your needs. `dom.rootEl` is preferred
117
+ * for all scoping, because a document can have multiple reports within it.
107
118
  * @return {Document}
108
119
  */
109
120
  document(): Document;
@@ -135,6 +146,12 @@ export class DOM {
135
146
  * @param {*=} detail Custom data to include.
136
147
  */
137
148
  fireEventOn(name: string, target?: Node | undefined, detail?: any | undefined): void;
149
+ /**
150
+ * Downloads a file (blob) using a[download].
151
+ * @param {Blob|File} blob The file to save.
152
+ * @param {string} filename
153
+ */
154
+ saveFile(blob: Blob | File, filename: string): void;
138
155
  }
139
156
  /**
140
157
  * @license
@@ -162,12 +179,15 @@ export class ReportRenderer {
162
179
  constructor(dom: DOM);
163
180
  /** @type {DOM} */
164
181
  _dom: DOM;
182
+ /** @type {LH.Renderer.Options} */
183
+ _opts: any;
165
184
  /**
166
185
  * @param {LH.Result} lhr
167
- * @param {Element} container Parent element to render the report into.
186
+ * @param {HTMLElement?} rootEl Report root element containing the report
187
+ * @param {LH.Renderer.Options=} opts
168
188
  * @return {!Element}
169
189
  */
170
- renderReport(lhr: any, container: Element): Element;
190
+ renderReport(lhr: any, rootEl: HTMLElement | null, opts?: any): Element;
171
191
  /**
172
192
  * @param {LH.ReportResult} report
173
193
  * @return {DocumentFragment}
@@ -182,6 +202,11 @@ export class ReportRenderer {
182
202
  * @return {DocumentFragment}
183
203
  */
184
204
  _renderReportFooter(report: any): DocumentFragment;
205
+ /**
206
+ * @param {LH.ReportResult} report
207
+ * @param {DocumentFragment} footer
208
+ */
209
+ _renderMetaBlock(report: any, footer: DocumentFragment): void;
185
210
  /**
186
211
  * Returns a div with a list of top-level warnings, or an empty div if no warnings.
187
212
  * @param {LH.ReportResult} report
@@ -204,14 +229,14 @@ export class ReportRenderer {
204
229
  export class ReportUIFeatures {
205
230
  /**
206
231
  * @param {DOM} dom
232
+ * @param {LH.Renderer.Options} opts
207
233
  */
208
- constructor(dom: DOM);
234
+ constructor(dom: DOM, opts?: any);
209
235
  /** @type {LH.Result} */
210
236
  json: any;
211
237
  /** @type {DOM} */
212
238
  _dom: DOM;
213
- /** @type {Document} */
214
- _document: Document;
239
+ _opts: any;
215
240
  _topbar: TopbarFeatures;
216
241
  /**
217
242
  * Handle media query change events.
@@ -225,10 +250,9 @@ export class ReportUIFeatures {
225
250
  */
226
251
  initFeatures(lhr: any): void;
227
252
  /**
228
- * @param {{container?: Element, text: string, icon?: string, onClick: () => void}} opts
253
+ * @param {{text: string, icon?: string, onClick: () => void}} opts
229
254
  */
230
255
  addButton(opts: {
231
- container?: Element;
232
256
  text: string;
233
257
  icon?: string;
234
258
  onClick: () => void;
@@ -252,9 +276,9 @@ export class ReportUIFeatures {
252
276
  _resetUIState(): void;
253
277
  _setupThirdPartyFilter(): void;
254
278
  /**
255
- * @param {Element} el
279
+ * @param {Element} rootEl
256
280
  */
257
- _setupElementScreenshotOverlay(el: Element): void;
281
+ _setupElementScreenshotOverlay(rootEl: Element): void;
258
282
  /**
259
283
  * From a table with URL entries, finds the rows containing third-party URLs
260
284
  * and returns them.
@@ -264,11 +288,24 @@ export class ReportUIFeatures {
264
288
  */
265
289
  _getThirdPartyRows(rowEls: HTMLElement[], finalUrl: string): Array<HTMLElement>;
266
290
  /**
267
- * Downloads a file (blob) using a[download].
268
- * @param {Blob|File} blob The file to save.
291
+ * DevTools uses its own file manager to download files, so it redefines this function.
292
+ * Wrapper is necessary so DevTools can still override this function.
293
+ *
294
+ * @param {Blob|File} blob
269
295
  */
270
296
  _saveFile(blob: Blob | File): void;
271
297
  }
298
+ /**
299
+ * @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
300
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
301
+ * 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.
302
+ */
303
+ /**
304
+ * @param {LH.Result} lhr
305
+ * @param {LH.Renderer.Options} opts
306
+ * @return {HTMLElement}
307
+ */
308
+ export function renderReport(lhr: any, opts?: any): HTMLElement;
272
309
  type LineContentType = number;
273
310
  declare namespace LineContentType {
274
311
  const CONTENT_NORMAL: number;
@@ -329,6 +366,13 @@ declare class CategoryRenderer {
329
366
  * @return {!Element}
330
367
  */
331
368
  populateAuditValues(audit: any, component: DocumentFragment): Element;
369
+ /**
370
+ * Inject the final screenshot next to the score gauge of the first category (likely Performance)
371
+ * @param {HTMLElement} categoriesEl
372
+ * @param {LH.ReportResult['audits']} audits
373
+ * @param {Element} scoreScaleEl
374
+ */
375
+ injectFinalScreenshot(categoriesEl: HTMLElement, audits: any, scoreScaleEl: Element): any;
332
376
  /**
333
377
  * @return {Element}
334
378
  */
@@ -353,9 +397,9 @@ declare class CategoryRenderer {
353
397
  * Renders the group container for a group of audits. Individual audit elements can be added
354
398
  * directly to the returned element.
355
399
  * @param {LH.Result.ReportGroup} group
356
- * @return {Element}
400
+ * @return {[Element, Element | null]}
357
401
  */
358
- renderAuditGroup(group: any): Element;
402
+ renderAuditGroup(group: any): [Element, Element | null];
359
403
  /**
360
404
  * Takes an array of auditRefs, groups them if requested, then returns an
361
405
  * array of audit and audit-group elements.
@@ -451,21 +495,14 @@ declare class CategoryRenderer {
451
495
  * ⋮
452
496
  * @param {LH.ReportResult.Category} category
453
497
  * @param {Object<string, LH.Result.ReportGroup>=} groupDefinitions
454
- * @param {{environment?: 'PSI', gatherMode: LH.Result.GatherMode}=} options
498
+ * @param {{gatherMode: LH.Result.GatherMode}=} options
455
499
  * @return {Element}
456
500
  */
457
501
  render(category: any, groupDefinitions?: {
458
502
  [x: string]: any;
459
503
  } | undefined, options?: {
460
- environment?: 'PSI';
461
504
  gatherMode: any;
462
505
  } | undefined): Element;
463
- /**
464
- * Create a non-semantic span used for hash navigation of categories
465
- * @param {Element} element
466
- * @param {string} id
467
- */
468
- createPermalinkSpan(element: Element, id: string): void;
469
506
  }
470
507
  /**
471
508
  * @license Copyright 2021 The Lighthouse Authors. All Rights Reserved.
@@ -482,16 +519,14 @@ declare class TopbarFeatures {
482
519
  lhr: any;
483
520
  _reportUIFeatures: ReportUIFeatures;
484
521
  _dom: DOM;
485
- /** @type {Document} */
486
- _document: Document;
487
522
  _dropDownMenu: DropDownMenu;
488
523
  _copyAttempt: boolean;
489
524
  /** @type {HTMLElement} */
490
525
  topbarEl: HTMLElement;
491
526
  /** @type {HTMLElement} */
492
- scoreScaleEl: HTMLElement;
493
- /** @type {HTMLElement} */
494
- stickyHeaderEl: HTMLElement;
527
+ categoriesEl: HTMLElement;
528
+ /** @type {HTMLElement?} */
529
+ stickyHeaderEl: HTMLElement | null;
495
530
  /** @type {HTMLElement} */
496
531
  highlightEl: HTMLElement;
497
532
  /**
@@ -514,7 +549,6 @@ declare class TopbarFeatures {
514
549
  * open a `<details>` element.
515
550
  */
516
551
  collapseAllDetails(): void;
517
- _updateStickyHeaderOnScroll(): void;
518
552
  /**
519
553
  * @param {LH.Result} lhr
520
554
  */
@@ -539,15 +573,19 @@ declare class TopbarFeatures {
539
573
  /**
540
574
  * Finds the first scrollable ancestor of `element`. Falls back to the document.
541
575
  * @param {Element} element
542
- * @return {Node}
576
+ * @return {Element | Document}
543
577
  */
544
- _getScrollParent(element: Element): Node;
578
+ _getScrollParent(element: Element): Element | Document;
545
579
  /**
546
580
  * Sets up listeners to collapse audit `<details>` when the user closes the
547
581
  * print dialog, all `<details>` are collapsed.
548
582
  */
549
583
  _setUpCollapseDetailsAfterPrinting(): void;
550
- _setupStickyHeaderElements(): void;
584
+ _setupStickyHeader(): void;
585
+ /**
586
+ * Toggle visibility and update highlighter position
587
+ */
588
+ _updateStickyHeader(): void;
551
589
  }
552
590
  declare class DetailsRenderer {
553
591
  /**