chrome-devtools-frontend 1.0.1642845 → 1.0.1643099

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 (128) hide show
  1. package/SECURITY.md +1 -0
  2. package/front_end/core/host/UserMetrics.ts +2 -1
  3. package/front_end/core/protocol_client/InspectorBackend.ts +4 -0
  4. package/front_end/core/sdk/CSSMatchedStyles.ts +55 -26
  5. package/front_end/core/sdk/CSSRule.ts +1 -0
  6. package/front_end/core/sdk/DebuggerModel.ts +5 -0
  7. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +4 -3
  8. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +4 -3
  9. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -5
  10. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  11. package/front_end/generated/protocol.ts +7 -0
  12. package/front_end/models/ai_assistance/AiAgent2.ts +100 -18
  13. package/front_end/models/ai_assistance/AiConversation.ts +18 -14
  14. package/front_end/models/ai_assistance/AiUtils.ts +71 -0
  15. package/front_end/models/ai_assistance/ChangeManager.ts +2 -5
  16. package/front_end/models/ai_assistance/{agents/ConversationSummaryAgent.ts → ConversationSummary.ts} +29 -66
  17. package/front_end/models/ai_assistance/ExtensionScope.ts +1 -4
  18. package/front_end/models/ai_assistance/{agents/PerformanceAnnotationsAgent.ts → PerformanceAnnotations.ts} +47 -89
  19. package/front_end/models/ai_assistance/README.md +8 -0
  20. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +65 -40
  21. package/front_end/models/ai_assistance/agents/AiAgent.ts +37 -6
  22. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +11 -0
  23. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +55 -5
  24. package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -0
  25. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +119 -78
  26. package/front_end/models/ai_assistance/agents/StorageAgent.ts +47 -38
  27. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -25
  28. package/front_end/models/ai_assistance/agents/StylingAgent.ts +46 -326
  29. package/front_end/models/ai_assistance/ai_assistance.ts +14 -4
  30. package/front_end/models/ai_assistance/contexts/DOMNodeContext.snapshot.txt +51 -0
  31. package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +200 -0
  32. package/front_end/models/ai_assistance/skills/styling.md +44 -2
  33. package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +140 -0
  34. package/front_end/models/ai_assistance/tools/GetStyles.ts +141 -0
  35. package/front_end/models/ai_assistance/tools/Tool.ts +64 -0
  36. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +36 -0
  37. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +5 -7
  38. package/front_end/models/lighthouse/LighthouseReporterTypes.ts +5 -0
  39. package/front_end/models/live-metrics/LiveMetrics.ts +24 -13
  40. package/front_end/models/stack_trace/DetailedErrorStackParser.ts +2 -2
  41. package/front_end/models/stack_trace/StackTrace.ts +4 -1
  42. package/front_end/models/stack_trace/StackTraceImpl.ts +9 -2
  43. package/front_end/models/stack_trace/StackTraceModel.ts +17 -4
  44. package/front_end/models/stack_trace/Trie.ts +1 -1
  45. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -22
  46. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +16 -0
  47. package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
  48. package/front_end/panels/ai_assistance/components/ChatMessage.ts +96 -4
  49. package/front_end/panels/ai_assistance/components/chatMessage.css +6 -0
  50. package/front_end/panels/application/DOMStorageItemsView.ts +4 -0
  51. package/front_end/panels/application/KeyValueStorageItemsView.ts +39 -7
  52. package/front_end/panels/application/components/AdsView.ts +219 -0
  53. package/front_end/panels/application/components/adsView.css +54 -0
  54. package/front_end/panels/application/components/components.ts +2 -0
  55. package/front_end/panels/common/ExtensionServer.ts +26 -15
  56. package/front_end/panels/console/SymbolizedErrorWidget.ts +73 -22
  57. package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
  58. package/front_end/panels/elements/StylePropertiesSection.ts +8 -0
  59. package/front_end/panels/elements/StylePropertyHighlighter.ts +4 -2
  60. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -5
  61. package/front_end/panels/elements/StylesContainer.ts +1 -1
  62. package/front_end/panels/elements/StylesSidebarPane.ts +4 -4
  63. package/front_end/panels/layer_viewer/PaintProfilerView.ts +106 -132
  64. package/front_end/panels/lighthouse/LighthousePanel.ts +4 -3
  65. package/front_end/panels/network/NetworkLogView.ts +8 -1
  66. package/front_end/panels/network/networkLogView.css +0 -15
  67. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +5 -4
  68. package/front_end/third_party/chromium/README.chromium +1 -1
  69. package/front_end/third_party/lighthouse/README.chromium +2 -2
  70. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1607 -5733
  71. package/front_end/third_party/lighthouse/locales/ar-XB.json +290 -65
  72. package/front_end/third_party/lighthouse/locales/ar.json +290 -65
  73. package/front_end/third_party/lighthouse/locales/bg.json +290 -65
  74. package/front_end/third_party/lighthouse/locales/ca.json +295 -70
  75. package/front_end/third_party/lighthouse/locales/cs.json +290 -65
  76. package/front_end/third_party/lighthouse/locales/da.json +294 -69
  77. package/front_end/third_party/lighthouse/locales/de.json +295 -70
  78. package/front_end/third_party/lighthouse/locales/el.json +290 -65
  79. package/front_end/third_party/lighthouse/locales/en-GB.json +290 -65
  80. package/front_end/third_party/lighthouse/locales/en-US.json +79 -67
  81. package/front_end/third_party/lighthouse/locales/en-XA.json +253 -64
  82. package/front_end/third_party/lighthouse/locales/en-XL.json +79 -67
  83. package/front_end/third_party/lighthouse/locales/es-419.json +290 -65
  84. package/front_end/third_party/lighthouse/locales/es.json +298 -73
  85. package/front_end/third_party/lighthouse/locales/fi.json +290 -65
  86. package/front_end/third_party/lighthouse/locales/fil.json +290 -65
  87. package/front_end/third_party/lighthouse/locales/fr.json +294 -69
  88. package/front_end/third_party/lighthouse/locales/he.json +293 -68
  89. package/front_end/third_party/lighthouse/locales/hi.json +291 -66
  90. package/front_end/third_party/lighthouse/locales/hr.json +290 -65
  91. package/front_end/third_party/lighthouse/locales/hu.json +290 -65
  92. package/front_end/third_party/lighthouse/locales/id.json +290 -65
  93. package/front_end/third_party/lighthouse/locales/it.json +294 -69
  94. package/front_end/third_party/lighthouse/locales/ja.json +290 -65
  95. package/front_end/third_party/lighthouse/locales/ko.json +290 -65
  96. package/front_end/third_party/lighthouse/locales/lt.json +290 -65
  97. package/front_end/third_party/lighthouse/locales/lv.json +290 -65
  98. package/front_end/third_party/lighthouse/locales/nl.json +290 -65
  99. package/front_end/third_party/lighthouse/locales/no.json +290 -65
  100. package/front_end/third_party/lighthouse/locales/pl.json +290 -65
  101. package/front_end/third_party/lighthouse/locales/pt-PT.json +291 -66
  102. package/front_end/third_party/lighthouse/locales/pt.json +290 -65
  103. package/front_end/third_party/lighthouse/locales/ro.json +290 -65
  104. package/front_end/third_party/lighthouse/locales/ru.json +301 -76
  105. package/front_end/third_party/lighthouse/locales/sk.json +291 -66
  106. package/front_end/third_party/lighthouse/locales/sl.json +290 -65
  107. package/front_end/third_party/lighthouse/locales/sr-Latn.json +290 -65
  108. package/front_end/third_party/lighthouse/locales/sr.json +290 -65
  109. package/front_end/third_party/lighthouse/locales/sv.json +297 -72
  110. package/front_end/third_party/lighthouse/locales/ta.json +291 -66
  111. package/front_end/third_party/lighthouse/locales/te.json +293 -68
  112. package/front_end/third_party/lighthouse/locales/th.json +291 -66
  113. package/front_end/third_party/lighthouse/locales/tr.json +290 -65
  114. package/front_end/third_party/lighthouse/locales/uk.json +290 -65
  115. package/front_end/third_party/lighthouse/locales/vi.json +291 -66
  116. package/front_end/third_party/lighthouse/locales/zh-HK.json +292 -67
  117. package/front_end/third_party/lighthouse/locales/zh-TW.json +291 -66
  118. package/front_end/third_party/lighthouse/locales/zh.json +291 -66
  119. package/front_end/third_party/lighthouse/report/bundle.d.ts +6 -6
  120. package/front_end/third_party/lighthouse/report/bundle.js +4 -7
  121. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
  122. package/front_end/ui/legacy/Widget.ts +32 -8
  123. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +36 -3
  124. package/front_end/ui/legacy/components/data_grid/dataGridAiButton.css +20 -0
  125. package/front_end/ui/legacy/components/utils/Linkifier.ts +19 -4
  126. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  127. package/mcp/mcp.ts +1 -0
  128. package/package.json +1 -1
@@ -2661,10 +2661,11 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2661
2661
  return container;
2662
2662
  }
2663
2663
 
2664
- #getLinkableFunction(functionName: string, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles):
2665
- InlineEditor.LinkSwatch.LinkSwatch {
2664
+ #getLinkableFunction(
2665
+ functionName: string, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
2666
+ property: SDK.CSSProperty.CSSProperty): InlineEditor.LinkSwatch.LinkSwatch {
2666
2667
  const swatch = new InlineEditor.LinkSwatch.LinkSwatch();
2667
- const registeredFunction = matchedStyles.getRegisteredFunction(functionName);
2668
+ const {registeredFunction, treeScopeDistance} = matchedStyles.getRegisteredFunction(functionName, property);
2668
2669
  const isDefined = Boolean(registeredFunction);
2669
2670
  swatch.data = {
2670
2671
  jslogContext: 'css-function',
@@ -2675,7 +2676,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2675
2676
  if (!registeredFunction) {
2676
2677
  return;
2677
2678
  }
2678
- this.#stylesContainer.jumpToFunctionDefinition(registeredFunction);
2679
+ this.#stylesContainer.jumpToFunctionDefinition(registeredFunction, treeScopeDistance);
2679
2680
  },
2680
2681
  };
2681
2682
  return swatch;
@@ -2696,7 +2697,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2696
2697
  const tooltipId = this.getTooltipId(`${functionName}-trace`);
2697
2698
  // clang-format off
2698
2699
  return html`
2699
- <span tabIndex=-1 class=tracing-anchor aria-details=${tooltipId}>${functionName.startsWith('--') ? this.#getLinkableFunction(functionName, matchedStyles) : functionName}</span>
2700
+ <span tabIndex=-1 class=tracing-anchor aria-details=${tooltipId}>${functionName.startsWith('--') ? this.#getLinkableFunction(functionName, matchedStyles, context.property) : functionName}</span>
2700
2701
  <devtools-tooltip
2701
2702
  id=${tooltipId}
2702
2703
  use-hotkey
@@ -37,7 +37,7 @@ export interface StylesContainer {
37
37
  computedValue: string|null): ElementsComponents.CSSVariableValueView.CSSVariableValueView;
38
38
  getVariableParserError(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, variableName: string):
39
39
  ElementsComponents.CSSVariableValueView.CSSVariableParserError|null;
40
- jumpToFunctionDefinition(functionName: string): void;
40
+ jumpToFunctionDefinition(functionName: string, treeScopeDistance: number): void;
41
41
  continueEditingElement(sectionIndex: number, propertyIndex: number): void;
42
42
  revealProperty(cssProperty: SDK.CSSProperty.CSSProperty): void;
43
43
  resetFocus(): void;
@@ -344,16 +344,16 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
344
344
  }
345
345
  }
346
346
 
347
- jumpToSection(sectionName: string, blockName: string): void {
348
- this.decorator.findAndHighlightSection(sectionName, blockName);
347
+ jumpToSection(sectionName: string, blockName: string, treeScopeDistance?: number): void {
348
+ this.decorator.findAndHighlightSection(sectionName, blockName, treeScopeDistance);
349
349
  }
350
350
 
351
351
  jumpToSectionBlock(section: string): void {
352
352
  this.decorator.findAndHighlightSectionBlock(section);
353
353
  }
354
354
 
355
- jumpToFunctionDefinition(functionName: string): void {
356
- this.jumpToSection(functionName, FUNCTION_SECTION_NAME);
355
+ jumpToFunctionDefinition(functionName: string, treeScopeDistance: number): void {
356
+ this.jumpToSection(functionName, FUNCTION_SECTION_NAME, treeScopeDistance);
357
357
  }
358
358
 
359
359
  jumpToFontPaletteDefinition(paletteName: string): void {
@@ -11,9 +11,13 @@ import type * as SDK from '../../core/sdk/sdk.js';
11
11
  import type * as Protocol from '../../generated/protocol.js';
12
12
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
13
13
  import * as UI from '../../ui/legacy/legacy.js';
14
+ import * as Lit from '../../ui/lit/lit.js';
14
15
 
15
16
  import paintProfilerStyles from './paintProfiler.css.js';
16
17
 
18
+ const {html, render, nothing} = Lit;
19
+ const {repeat} = Lit.Directives;
20
+
17
21
  const UIStrings = {
18
22
  /**
19
23
  * @description Text to indicate the progress of a profile
@@ -397,161 +401,131 @@ export interface EventTypes {
397
401
  [Events.WINDOW_CHANGED]: void;
398
402
  }
399
403
 
400
- export class PaintProfilerCommandLogView extends UI.Widget.VBox {
401
- private readonly treeOutline: UI.TreeOutline.TreeOutlineInShadow;
402
- private log: SDK.PaintProfiler.PaintProfilerLogItem[];
403
- private readonly treeItemCache: Map<SDK.PaintProfiler.PaintProfilerLogItem, LogTreeElement>;
404
- private selectionWindow?: {left: number, right: number}|null;
405
- constructor() {
406
- super();
407
- this.setMinimumSize(100, 25);
408
- this.element.classList.add('overflow-auto');
409
-
410
- this.treeOutline = new UI.TreeOutline.TreeOutlineInShadow();
411
- UI.ARIAUtils.setLabel(this.treeOutline.contentElement, i18nString(UIStrings.commandLog));
412
- this.element.appendChild(this.treeOutline.element);
413
- this.setDefaultFocusedElement(this.treeOutline.contentElement);
414
-
415
- this.log = [];
416
- this.treeItemCache = new Map();
417
- }
418
-
419
- setCommandLog(log: SDK.PaintProfiler.PaintProfilerLogItem[]): void {
420
- this.log = log;
404
+ export interface CommandLogViewInput {
405
+ visibleLogItems: SDK.PaintProfiler.PaintProfilerLogItem[];
406
+ }
421
407
 
422
- this.updateWindow({left: 0, right: this.log.length});
408
+ function paramToString(param: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue, name: string): string {
409
+ if (typeof param !== 'object') {
410
+ return typeof param === 'string' && param.length > 100 ? name : JSON.stringify(param);
423
411
  }
424
-
425
- private appendLogItem(logItem: SDK.PaintProfiler.PaintProfilerLogItem): void {
426
- let treeElement = this.treeItemCache.get(logItem);
427
- if (!treeElement) {
428
- treeElement = new LogTreeElement(logItem);
429
- this.treeItemCache.set(logItem, treeElement);
430
- } else if (treeElement.parent) {
431
- return;
412
+ let str = '';
413
+ let keyCount = 0;
414
+ for (const key in param) {
415
+ const paramKey = param[key];
416
+ if (++keyCount > 4 || typeof paramKey === 'object' || (typeof paramKey === 'string' && paramKey.length > 100)) {
417
+ return name;
418
+ }
419
+ if (str) {
420
+ str += ', ';
432
421
  }
433
- this.treeOutline.appendChild(treeElement);
422
+ str += paramKey;
434
423
  }
424
+ return str;
425
+ }
435
426
 
436
- updateWindow(selectionWindow: {left: number, right: number}|null): void {
437
- this.selectionWindow = selectionWindow;
438
- this.requestUpdate();
427
+ function paramsToString(params: SDK.PaintProfiler.RawPaintProfilerLogItemParams|null): string {
428
+ let str = '';
429
+ for (const key in params) {
430
+ if (str) {
431
+ str += ', ';
432
+ }
433
+ str += paramToString(params[key], key);
439
434
  }
435
+ return str;
436
+ }
440
437
 
441
- override performUpdate(): Promise<void> {
442
- if (!this.selectionWindow || !this.log.length) {
443
- this.treeOutline.removeChildren();
444
- return Promise.resolve();
445
- }
446
- const root = this.treeOutline.rootElement();
447
- for (;;) {
448
- const child = root.firstChild() as LogTreeElement;
449
- if (!child || child.logItem.commandIndex >= this.selectionWindow.left) {
450
- break;
438
+ function renderProperty(name: string, value: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue): Lit.LitTemplate {
439
+ const isObject = value !== null && typeof value === 'object';
440
+
441
+ // clang-format off
442
+ return html`
443
+ <li role="treeitem">
444
+ <span>${name}: </span>${
445
+ isObject ? html`
446
+ <ul role="group">
447
+ ${Object.entries(value).map(([key, val]) => renderProperty(key, val))}
448
+ </ul>` : html`
449
+ <span>${JSON.stringify(value)}</span>`
451
450
  }
452
- root.removeChildAtIndex(0);
453
- }
454
- for (;;) {
455
- const child = root.lastChild() as LogTreeElement;
456
- if (!child || child.logItem.commandIndex < this.selectionWindow.right) {
457
- break;
458
- }
459
- root.removeChildAtIndex(root.children().length - 1);
460
- }
461
- for (let i = this.selectionWindow.left, right = this.selectionWindow.right; i < right; ++i) {
462
- this.appendLogItem(this.log[i]);
463
- }
464
- return Promise.resolve();
465
- }
451
+ </li>
452
+ `;
453
+ // clang-format on
466
454
  }
467
455
 
468
- export class LogTreeElement extends UI.TreeOutline.TreeElement {
469
- readonly logItem: SDK.PaintProfiler.PaintProfilerLogItem;
456
+ function renderLogItem(logItem: SDK.PaintProfiler.PaintProfilerLogItem): Lit.LitTemplate {
457
+ const hasParams = Boolean(logItem.params && Object.keys(logItem.params).length > 0);
458
+ const titleText = logItem.method + '(' + paramsToString(logItem.params) + ')';
459
+
460
+ // clang-format off
461
+ return html`
462
+ <li role="treeitem">
463
+ ${titleText}
464
+ ${hasParams ? html`
465
+ <ul role="group">
466
+ ${Object.entries(logItem.params || {}).map(([key, val]) => renderProperty(key, val))}
467
+ </ul>` : nothing}
468
+ </li>
469
+ `;
470
+ // clang-format on
471
+ }
470
472
 
471
- constructor(logItem: SDK.PaintProfiler.PaintProfilerLogItem) {
472
- super('', Boolean(logItem.params));
473
- this.logItem = logItem;
474
- }
473
+ // clang-format off
474
+ export const COMMAND_LOG_DEFAULT_VIEW = (input: CommandLogViewInput, _output: undefined, target: HTMLElement): void => {
475
+ render(html`
476
+ <div class="overflow-auto flex-auto vbox">
477
+ <devtools-tree
478
+ autofocus
479
+ aria-label=${i18nString(UIStrings.commandLog)}
480
+ .template=${html`
481
+ <ul role="tree">
482
+ ${repeat(input.visibleLogItems,
483
+ item => item.commandIndex,
484
+ item => renderLogItem(item))}
485
+ </ul>`}>
486
+ </devtools-tree>
487
+ </div>`,
488
+ target);
489
+ };
490
+ // clang-format on
491
+
492
+ type CommandLogView = typeof COMMAND_LOG_DEFAULT_VIEW;
475
493
 
476
- override onattach(): void {
477
- this.update();
478
- }
494
+ export class PaintProfilerCommandLogView extends UI.Widget.VBox {
495
+ private log: SDK.PaintProfiler.PaintProfilerLogItem[];
496
+ private selectionWindow?: {left: number, right: number}|null;
497
+ readonly #view: CommandLogView;
479
498
 
480
- override async onpopulate(): Promise<void> {
481
- for (const param in this.logItem.params) {
482
- LogPropertyTreeElement.appendLogPropertyItem(this, param, this.logItem.params[param]);
483
- }
484
- }
499
+ constructor(element?: HTMLElement, view: CommandLogView = COMMAND_LOG_DEFAULT_VIEW) {
500
+ super(element);
501
+ this.#view = view;
502
+ this.setMinimumSize(100, 25);
485
503
 
486
- private paramToString(param: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue, name: string): string {
487
- if (typeof param !== 'object') {
488
- return typeof param === 'string' && param.length > 100 ? name : JSON.stringify(param);
489
- }
490
- let str = '';
491
- let keyCount = 0;
492
- for (const key in param) {
493
- const paramKey = param[key];
494
- if (++keyCount > 4 || paramKey === 'object' || (paramKey === 'string' && paramKey.length > 100)) {
495
- return name;
496
- }
497
- if (str) {
498
- str += ', ';
499
- }
500
- str += paramKey;
501
- }
502
- return str;
504
+ this.log = [];
503
505
  }
504
506
 
505
- private paramsToString(params: SDK.PaintProfiler.RawPaintProfilerLogItemParams|null): string {
506
- let str = '';
507
- for (const key in params) {
508
- if (str) {
509
- str += ', ';
510
- }
511
- str += this.paramToString(params[key], key);
512
- }
513
- return str;
507
+ override wasShown(): void {
508
+ super.wasShown();
509
+ this.requestUpdate();
514
510
  }
515
511
 
516
- private update(): void {
517
- const title = document.createDocumentFragment();
518
- UI.UIUtils.createTextChild(title, this.logItem.method + '(' + this.paramsToString(this.logItem.params) + ')');
519
- this.title = title;
512
+ setCommandLog(log: SDK.PaintProfiler.PaintProfilerLogItem[]): void {
513
+ this.log = log;
514
+ this.updateWindow({left: 0, right: this.log.length});
520
515
  }
521
- }
522
-
523
- export class LogPropertyTreeElement extends UI.TreeOutline.TreeElement {
524
- private property: {name: string, value: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue};
525
516
 
526
- constructor(property: {name: string, value: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue}) {
527
- super();
528
- this.property = property;
517
+ updateWindow(selectionWindow: {left: number, right: number}|null): void {
518
+ this.selectionWindow = selectionWindow;
519
+ this.requestUpdate();
529
520
  }
530
521
 
531
- static appendLogPropertyItem(
532
- element: UI.TreeOutline.TreeElement, name: string,
533
- value: SDK.PaintProfiler.RawPaintProfilerLogItemParamValue): void {
534
- const treeElement = new LogPropertyTreeElement({name, value});
535
- element.appendChild(treeElement);
536
- if (value && typeof value === 'object') {
537
- for (const property in value) {
538
- LogPropertyTreeElement.appendLogPropertyItem(treeElement, property, value[property]);
539
- }
540
- }
541
- }
522
+ override performUpdate(): Promise<void> {
523
+ const visibleLogItems = this.selectionWindow && this.log.length ?
524
+ this.log.slice(this.selectionWindow.left, this.selectionWindow.right) :
525
+ [];
542
526
 
543
- override onattach(): void {
544
- const title = document.createDocumentFragment();
545
- const nameElement = title.createChild('span', 'name');
546
- nameElement.textContent = this.property.name;
547
- const separatorElement = title.createChild('span', 'separator');
548
- separatorElement.textContent = ': ';
549
- if (this.property.value === null || typeof this.property.value !== 'object') {
550
- const valueElement = title.createChild('span', 'value');
551
- valueElement.textContent = JSON.stringify(this.property.value);
552
- valueElement.classList.add('cm-js-' + (this.property.value === null ? 'null' : typeof this.property.value));
553
- }
554
- this.title = title;
527
+ this.#view({visibleLogItems}, undefined, this.contentElement);
528
+ return Promise.resolve();
555
529
  }
556
530
  }
557
531
 
@@ -374,11 +374,12 @@ export class LighthousePanel extends UI.Panel.Panel {
374
374
  }
375
375
 
376
376
  private loadedFromFile(report: string): void {
377
- const data = JSON.parse(report);
378
- if (!data['lighthouseVersion']) {
377
+ const data = JSON.parse(report) as LighthouseModel.ReporterTypes.ReportJSON;
378
+ if (!data.lighthouseVersion) {
379
379
  return;
380
380
  }
381
- this.buildReportUI(data as LighthouseModel.ReporterTypes.ReportJSON);
381
+ data.isImported = true;
382
+ this.buildReportUI(data);
382
383
  }
383
384
 
384
385
  override elementsToRestoreScrollPositionsFor(): Element[] {
@@ -54,6 +54,8 @@ import * as Adorners from '../../ui/components/adorners/adorners.js';
54
54
  import * as Buttons from '../../ui/components/buttons/buttons.js';
55
55
  import * as RenderCoordinator from '../../ui/components/render_coordinator/render_coordinator.js';
56
56
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
57
+ // eslint-disable-next-line @devtools/es-modules-import
58
+ import dataGridAiButtonStyles from '../../ui/legacy/components/data_grid/dataGridAiButton.css.js';
57
59
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
58
60
  import * as Components from '../../ui/legacy/components/utils/utils.js';
59
61
  import * as UI from '../../ui/legacy/legacy.js';
@@ -560,6 +562,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
560
562
  networkLogLargeRowsSetting: Common.Settings.Setting<boolean>) {
561
563
  super();
562
564
  this.registerRequiredCSS(networkLogViewStyles);
565
+ this.registerRequiredCSS(dataGridAiButtonStyles);
563
566
  this.setMinimumSize(50, 64);
564
567
 
565
568
  this.element.id = 'network-container';
@@ -2504,7 +2507,11 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
2504
2507
  // (it may be different from the inspected page platform).
2505
2508
  const escapeString = platform === 'win' ? escapeStringWin : escapeStringPosix;
2506
2509
 
2507
- command.push(escapeString(request.url()).replace(/[[{}\]]/g, '\\$&'));
2510
+ // The shell escaping above protects the *shell* parser, but not curl's own
2511
+ // argv parser: if the (HAR-imported) URL begins with '-', curl will parse
2512
+ // it as an option (e.g. "-K//host/share/file" -> --config UNC path).
2513
+ // Passing the URL via --url forces curl to treat it as a URL operand.
2514
+ command.push('--url ' + escapeString(request.url()).replace(/[[{}\]]/g, '\\$&'));
2508
2515
 
2509
2516
  let inferredMethod = 'GET';
2510
2517
  const data = [];
@@ -268,21 +268,6 @@ td.time-column {
268
268
  vertical-align: sub;
269
269
  }
270
270
 
271
- .data-grid-data-grid-node .ai-button-container {
272
- display: none;
273
- float: right;
274
-
275
- devtools-floating-button {
276
- position: absolute;
277
- z-index: 999;
278
- margin-left: -17px;
279
- }
280
- }
281
-
282
- .data-grid-data-grid-node:hover .ai-button-container {
283
- display: inline-flex;
284
- }
285
-
286
271
  .image-network-icon-preview {
287
272
  inset: 0;
288
273
  margin: auto;
@@ -194,7 +194,7 @@ export class EntryLabelOverlay extends HTMLElement {
194
194
  #callTree: AiAssistanceModels.AICallTree.AICallTree|null = null;
195
195
  // Creates or gets the setting if it exists.
196
196
  #aiAnnotationsEnabledSetting = Common.Settings.Settings.instance().createSetting('ai-annotations-enabled', false);
197
- #agent = new AiAssistanceModels.PerformanceAnnotationsAgent.PerformanceAnnotationsAgent({
197
+ #performanceAnnotations = new AiAssistanceModels.PerformanceAnnotations.PerformanceAnnotations({
198
198
  aidaClient: new Host.AidaClient.AidaClient(),
199
199
  serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
200
200
  });
@@ -254,8 +254,9 @@ export class EntryLabelOverlay extends HTMLElement {
254
254
  /**
255
255
  * So we can provide a mocked agent in tests. Do not call this method outside of a test!
256
256
  */
257
- overrideAIAgentForTest(agent: AiAssistanceModels.PerformanceAnnotationsAgent.PerformanceAnnotationsAgent): void {
258
- this.#agent = agent;
257
+ overridePerformanceAnnotationsForTest(performanceAnnotations:
258
+ AiAssistanceModels.PerformanceAnnotations.PerformanceAnnotations): void {
259
+ this.#performanceAnnotations = performanceAnnotations;
259
260
  }
260
261
 
261
262
  entryHighlightWrapper(): HTMLElement|null {
@@ -534,7 +535,7 @@ export class EntryLabelOverlay extends HTMLElement {
534
535
  this.#focusInputBox();
535
536
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
536
537
 
537
- this.#label = await this.#agent.generateAIEntryLabel(this.#callTree);
538
+ this.#label = await this.#performanceAnnotations.generateAIEntryLabel(this.#callTree);
538
539
  this.dispatchEvent(new EntryLabelChangeEvent(this.#label));
539
540
  this.#inputField.innerText = this.#label;
540
541
  this.#placeCursorAtInputEnd();
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: 2d046db188ecad76b2859f8baeb9685cb8fe9c08
4
+ Revision: e1605f15bac37245745e5fb8327995ededbe2337
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -1,7 +1,7 @@
1
1
  Name: Lighthouse
2
2
  Short Name: lighthouse
3
- Version: 13.3.0
4
- Revision: 7d8dcf5004950cad3faa20664e4a7cf2817bd653
3
+ Version: 13.4.0
4
+ Revision: cb79bea56c4668fd7a338f2f421f87754ee927a2
5
5
  Update Mechanism: Manual
6
6
  URL: https://github.com/GoogleChrome/lighthouse
7
7
  License: Apache-2.0