chrome-devtools-frontend 1.0.1681498 → 1.0.1682249

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 (141) hide show
  1. package/eslint.config.mjs +8 -3
  2. package/front_end/core/sdk/ConsoleModel.ts +1 -1
  3. package/front_end/core/sdk/PreloadingModel.ts +44 -22
  4. package/front_end/core/sdk/RemoteObject.ts +4 -1
  5. package/front_end/core/sdk/RuntimeModel.ts +5 -5
  6. package/front_end/core/sdk/sdk.ts +2 -0
  7. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
  8. package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
  9. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -5
  10. package/front_end/entrypoints/main/MainImpl.ts +9 -10
  11. package/front_end/entrypoints/shell/shell.ts +0 -2
  12. package/front_end/entrypoints/trace_app/trace_app.ts +0 -2
  13. package/front_end/generated/InspectorBackendCommands.ts +2 -0
  14. package/front_end/generated/protocol-mapping.d.ts +16 -0
  15. package/front_end/generated/protocol-proxy-api.d.ts +12 -0
  16. package/front_end/generated/protocol.ts +12 -0
  17. package/front_end/models/ai_assistance/ExtensionScope.ts +11 -12
  18. package/front_end/models/ai_assistance/agents/AiAgent.ts +1 -1
  19. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -1
  20. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
  21. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
  22. package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +2 -1
  23. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +8 -8
  24. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +8 -8
  25. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -0
  26. package/front_end/models/formatter/ScriptFormatter.ts +1 -0
  27. package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
  28. package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +4 -4
  29. package/front_end/models/logs/NetworkLog.ts +8 -1
  30. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +4 -2
  31. package/front_end/models/stack_trace/StackTraceImpl.ts +1 -0
  32. package/front_end/models/trace/Name.ts +5 -5
  33. package/front_end/models/trace/Styles.ts +115 -115
  34. package/front_end/models/trace/extras/TraceTree.ts +2 -1
  35. package/front_end/models/trace/helpers/Network.ts +4 -1
  36. package/front_end/models/trace/insights/CLSCulprits.ts +4 -2
  37. package/front_end/models/trace/insights/CharacterSet.ts +3 -3
  38. package/front_end/models/trace/insights/DOMSize.ts +1 -1
  39. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +6 -2
  40. package/front_end/models/trace/insights/FontDisplay.ts +9 -3
  41. package/front_end/models/trace/insights/ForcedReflow.ts +4 -4
  42. package/front_end/models/trace/insights/INPBreakdown.ts +3 -4
  43. package/front_end/models/trace/insights/ImageDelivery.ts +2 -2
  44. package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
  45. package/front_end/models/trace/insights/LCPDiscovery.ts +5 -5
  46. package/front_end/models/trace/insights/LegacyJavaScript.ts +7 -3
  47. package/front_end/models/trace/insights/ModernHTTP.ts +3 -3
  48. package/front_end/models/trace/insights/NetworkDependencyTree.ts +13 -9
  49. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  50. package/front_end/models/trace/insights/SlowCSSSelector.ts +29 -25
  51. package/front_end/models/trace/insights/ThirdParties.ts +13 -5
  52. package/front_end/models/trace/insights/Viewport.ts +4 -2
  53. package/front_end/models/workspace/IgnoreListManager.ts +53 -17
  54. package/front_end/panels/accessibility/ARIAAttributesView.ts +11 -2
  55. package/front_end/panels/ai_assistance/components/ChatMessage.ts +67 -53
  56. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
  57. package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +2 -2
  58. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +5 -5
  59. package/front_end/panels/animation/AnimationTimeline.ts +2 -0
  60. package/front_end/panels/application/preloading/PreloadingView.ts +9 -3
  61. package/front_end/panels/application/preloading/components/components.ts +2 -0
  62. package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +10 -11
  63. package/front_end/panels/changes/CombinedDiffView.ts +1 -1
  64. package/front_end/panels/common/ExtensionServer.ts +9 -10
  65. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +9 -4
  66. package/front_end/panels/elements/ElementStatePaneWidget.ts +3 -0
  67. package/front_end/panels/elements/ElementsTreeElement.ts +7 -1
  68. package/front_end/panels/elements/EventListenersWidget.ts +10 -11
  69. package/front_end/panels/issues/IssueView.ts +5 -6
  70. package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
  71. package/front_end/panels/media/PlayerPropertiesView.ts +309 -416
  72. package/front_end/panels/media/playerPropertiesView.css +1 -1
  73. package/front_end/panels/network/NetworkPanel.ts +2 -1
  74. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -2
  75. package/front_end/panels/network/network-meta.ts +6 -0
  76. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -1
  77. package/front_end/panels/recorder/RecordingView.ts +89 -73
  78. package/front_end/panels/recorder/ReplaySection.ts +59 -40
  79. package/front_end/panels/recorder/injected/injected.ts +4 -0
  80. package/front_end/panels/security/SecurityPanel.ts +5 -6
  81. package/front_end/panels/security/SecurityPanelSidebar.ts +244 -204
  82. package/front_end/panels/security/security.ts +0 -4
  83. package/front_end/panels/settings/EditFileSystemView.ts +8 -7
  84. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -14
  85. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +10 -11
  86. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -3
  87. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +5 -5
  88. package/front_end/panels/timeline/components/CWVMetrics.ts +1 -2
  89. package/front_end/panels/timeline/components/IgnoreListSetting.ts +5 -5
  90. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -3
  91. package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
  92. package/front_end/panels/timeline/components/Sidebar.ts +3 -3
  93. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -2
  94. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +3 -1
  95. package/front_end/panels/timeline/components/insights/CLSCulprits.ts +1 -2
  96. package/front_end/panels/timeline/components/insights/Cache.ts +1 -2
  97. package/front_end/panels/timeline/components/insights/CharacterSet.ts +1 -2
  98. package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -2
  99. package/front_end/panels/timeline/components/insights/DocumentLatency.ts +2 -2
  100. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
  101. package/front_end/panels/timeline/components/insights/FontDisplay.ts +1 -2
  102. package/front_end/panels/timeline/components/insights/ForcedReflow.ts +1 -2
  103. package/front_end/panels/timeline/components/insights/INPBreakdown.ts +1 -2
  104. package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -2
  105. package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +13 -13
  106. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +1 -2
  107. package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +4 -4
  108. package/front_end/panels/timeline/components/insights/ModernHTTP.ts +1 -2
  109. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +10 -8
  110. package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
  111. package/front_end/panels/timeline/components/insights/SidebarInsight.ts +3 -1
  112. package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
  113. package/front_end/panels/timeline/components/insights/ThirdParties.ts +1 -2
  114. package/front_end/panels/timeline/components/insights/Viewport.ts +1 -2
  115. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -2
  116. package/front_end/panels/timeline/timeline.ts +0 -2
  117. package/front_end/panels/web_audio/WebAudioView.ts +7 -7
  118. package/front_end/panels/webauthn/WebauthnPane.ts +9 -9
  119. package/front_end/third_party/chromium/README.chromium +1 -1
  120. package/front_end/ui/components/diff_view/DiffView.ts +2 -1
  121. package/front_end/ui/components/report_view/ReportView.docs.ts +2 -2
  122. package/front_end/ui/components/text_editor/javascript.ts +12 -13
  123. package/front_end/ui/legacy/GlassPane.ts +38 -14
  124. package/front_end/ui/legacy/Treeoutline.ts +14 -3
  125. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +1 -1
  126. package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +1 -1
  127. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
  128. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +21 -30
  129. package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +3 -8
  130. package/front_end/ui/legacy/components/utils/ImagePreview.ts +15 -16
  131. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +4 -4
  132. package/front_end/ui/legacy/components/utils/Linkifier.ts +8 -10
  133. package/front_end/ui/settings/InspectorMainSettings.ts +12 -0
  134. package/front_end/ui/settings/settings.ts +2 -0
  135. package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
  136. package/mcp/mcp.ts +0 -6
  137. package/package.json +1 -1
  138. package/front_end/models/logs/logs-meta.ts +0 -24
  139. package/front_end/models/workspace/workspace-meta.ts +0 -40
  140. package/front_end/panels/security/OriginTreeElement.ts +0 -60
  141. package/front_end/panels/security/SecurityPanelSidebarTreeElement.ts +0 -30
@@ -33,7 +33,7 @@ export const UIStrings = {
33
33
  /**
34
34
  * @description Text to tell the user that the charset is NOT declared in the Content-Type HTTP response header.
35
35
  */
36
- failedHttpHeader: 'Does not declare charset in HTTP header',
36
+ failedHttpHeader: 'Doesn’t declare charset in HTTP header',
37
37
  /**
38
38
  * @description Text to tell the user that a meta charset tag was found in the first 1024 bytes of the HTML.
39
39
  */
@@ -45,11 +45,11 @@ export const UIStrings = {
45
45
  /**
46
46
  * @description Text to tell the user that no meta charset tag was found in the HTML.
47
47
  */
48
- failedMetaCharsetMissing: 'Does not declare charset using a meta tag',
48
+ failedMetaCharsetMissing: 'Doesn’t declare charset using a meta tag',
49
49
  /**
50
50
  * @description Text to tell the user that trace data did not include the Blink signal for meta charset.
51
51
  */
52
- failedMetaCharsetUnknown: 'Could not determine meta charset declaration from trace',
52
+ failedMetaCharsetUnknown: 'Couldn’t determine meta charset declaration from trace',
53
53
  } as const;
54
54
 
55
55
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/CharacterSet.ts', UIStrings);
@@ -43,7 +43,7 @@ export const UIStrings = {
43
43
  */
44
44
  totalElements: 'Total elements',
45
45
  /**
46
- * @description Label for a value representing the maximum depth of the Document Object Model (DOM). "DOM" is a acronym and should not be translated.
46
+ * @description Label for a value representing the maximum depth of the Document Object Model (DOM). "DOM" is an acronym and should not be translated.
47
47
  */
48
48
  maxDOMDepth: 'DOM depth',
49
49
  /**
@@ -27,9 +27,13 @@ export const UIStrings = {
27
27
  */
28
28
  description:
29
29
  'Remove large, [duplicate JavaScript modules](https://developer.chrome.com/docs/performance/insights/duplicated-javascript) from bundles to reduce unnecessary bytes consumed by network activity.',
30
- /** Label for a column in a data table; entries will be the locations of JavaScript or CSS code, e.g. the name of a Javascript package or module. */
30
+ /**
31
+ * @description Label for a column in a data table; entries will be the locations of JavaScript or CSS code, e.g. the name of a JavaScript package or module.
32
+ */
31
33
  columnSource: 'Source',
32
- /** Label for a column in a data table; entries will be the number of wasted bytes due to duplication of a web resource. */
34
+ /**
35
+ * @description Label for a column in a data table; entries will be the number of wasted bytes due to duplication of a web resource.
36
+ */
33
37
  columnDuplicatedBytes: 'Duplicated bytes',
34
38
  /**
35
39
  * @description Message shown when no duplicated JavaScript is found.
@@ -17,16 +17,22 @@ import {
17
17
  } from './types.js';
18
18
 
19
19
  export const UIStrings = {
20
- /** Title of an insight that provides details about the fonts used on the page, and the value of their `font-display` properties. */
20
+ /**
21
+ * @description Title of an insight that provides details about the fonts used on the page, and the value of their `font-display` properties.
22
+ */
21
23
  title: 'Font display',
22
24
  /**
23
25
  * @description Text to tell the user about the font-display CSS feature to help improve a the UX of a page.
24
26
  */
25
27
  description:
26
28
  'Consider setting [`font-display`](https://developer.chrome.com/docs/performance/insights/font-display) to `swap` or `optional` to ensure text is consistently visible. `swap` can be further optimized to mitigate layout shifts with [font metric overrides](https://developer.chrome.com/blog/font-fallbacks).',
27
- /** Column for a font loaded by the page to render text. */
29
+ /**
30
+ * @description Column for a font loaded by the page to render text.
31
+ */
28
32
  fontColumn: 'Font',
29
- /** Column for the amount of time wasted. */
33
+ /**
34
+ * @description Column for the amount of time wasted.
35
+ */
30
36
  wastedTimeColumn: 'Wasted time',
31
37
  /**
32
38
  * @description Message shown when no fonts with suboptimal font-display are found.
@@ -29,15 +29,15 @@ export const UIStrings = {
29
29
  description:
30
30
  'A forced reflow occurs when JavaScript queries geometric properties (such as `offsetWidth`) after styles have been invalidated by a change to the DOM state. This can result in poor performance. Learn more about [forced reflows](https://developer.chrome.com/docs/performance/insights/forced-reflow) and possible mitigations.',
31
31
  /**
32
- * @description Title of a list to provide related stack trace data
32
+ * @description Title of a list to provide related stack trace data.
33
33
  */
34
34
  reflowCallFrames: 'Call frames that trigger reflow',
35
35
  /**
36
- * @description Text to describe the top time-consuming function call
36
+ * @description Text to describe the top time-consuming function call.
37
37
  */
38
38
  topTimeConsumingFunctionCall: 'Top function call',
39
39
  /**
40
- * @description Text to describe the total reflow time
40
+ * @description Text to describe the total reflow time.
41
41
  */
42
42
  totalReflowTime: 'Total reflow time',
43
43
  /**
@@ -45,7 +45,7 @@ export const UIStrings = {
45
45
  */
46
46
  unattributed: '[unattributed]',
47
47
  /**
48
- * @description Text for the name of anonymous functions
48
+ * @description Text for the name of anonymous functions.
49
49
  */
50
50
  anonymous: '(anonymous)',
51
51
  } as const;
@@ -5,7 +5,6 @@
5
5
  import * as i18n from '../../../core/i18n/i18n.js';
6
6
  import * as Handlers from '../handlers/handlers.js';
7
7
  import * as Helpers from '../helpers/helpers.js';
8
- import type {SyntheticInteractionPair} from '../types/TraceEvents.js';
9
8
  import type * as Types from '../types/types.js';
10
9
 
11
10
  import {
@@ -58,8 +57,8 @@ const str_ = i18n.i18n.registerUIStrings('models/trace/insights/INPBreakdown.ts'
58
57
  export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
59
58
 
60
59
  export type INPBreakdownInsightModel = InsightModel<typeof UIStrings, {
61
- longestInteractionEvent?: SyntheticInteractionPair,
62
- highPercentileInteractionEvent?: SyntheticInteractionPair,
60
+ longestInteractionEvent?: Types.Events.SyntheticInteractionPair,
61
+ highPercentileInteractionEvent?: Types.Events.SyntheticInteractionPair,
63
62
  }>;
64
63
 
65
64
  export function isINPBreakdownInsight(insight: InsightModel): insight is INPBreakdownInsightModel {
@@ -101,7 +100,7 @@ export function generateInsight(
101
100
  return finalize({});
102
101
  }
103
102
 
104
- const longestByInteractionId = new Map<number, SyntheticInteractionPair>();
103
+ const longestByInteractionId = new Map<number, Types.Events.SyntheticInteractionPair>();
105
104
  for (const event of interactionEvents) {
106
105
  const key = event.interactionId;
107
106
  const longest = longestByInteractionId.get(key);
@@ -25,7 +25,7 @@ export const UIStrings = {
25
25
  * @description Description of an insight that recommends ways to reduce the size of images downloaded and used on the page.
26
26
  */
27
27
  description:
28
- 'Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery)',
28
+ 'Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery).',
29
29
  /**
30
30
  * @description Message displayed in a chip explaining that an image file size is large for the # of pixels it has and recommends possible adjustments to improve the image size.
31
31
  */
@@ -56,7 +56,7 @@ export const UIStrings = {
56
56
  */
57
57
  others: '{PH1} others',
58
58
  /**
59
- * @description Text status indicating that no potential optimizations were found for any image file
59
+ * @description Text status indicating that no potential optimizations were found for any image file.
60
60
  */
61
61
  noOptimizableImages: 'No optimizable images',
62
62
  /**
@@ -58,7 +58,7 @@ export const UIStrings = {
58
58
  */
59
59
  fieldDuration: 'Field p75',
60
60
  /**
61
- * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
61
+ * @description Text status indicating that the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
62
62
  */
63
63
  noLcp: 'No LCP detected',
64
64
  } as const;
@@ -20,14 +20,14 @@ import {
20
20
 
21
21
  export const UIStrings = {
22
22
  /**
23
- * @description Title of an insight that provides details about the LCP metric, and the network requests necessary to load it. Details how the LCP request was discoverable - in other words, the path necessary to load it (ex: network requests, JavaScript)
23
+ * @description Title of an insight that provides details about the LCP metric, and the network requests necessary to load it. Details how the LCP request was discoverable - in other words, the path necessary to load it (ex: network requests, JavaScript).
24
24
  */
25
25
  title: 'LCP request discovery',
26
26
  /**
27
27
  * @description Description of an insight that provides details about the LCP metric, and the network requests necessary to load it.
28
28
  */
29
29
  description:
30
- '[Optimize LCP](https://developer.chrome.com/docs/performance/insights/lcp-discovery) by making the LCP image discoverable from the HTML immediately, and avoiding lazy-loading',
30
+ '[Optimize LCP](https://developer.chrome.com/docs/performance/insights/lcp-discovery) by making the LCP image discoverable from the HTML immediately, and avoiding lazy-loading.',
31
31
  /**
32
32
  * @description Text to tell the user how long after the earliest discovery time their LCP element loaded.
33
33
  * @example {401ms} PH1
@@ -52,15 +52,15 @@ export const UIStrings = {
52
52
  /**
53
53
  * @description Text to tell the user that LCP resources should avoid using loading=lazy.
54
54
  */
55
- lazyLoadNotApplied: 'LCP resources should not use loading=lazy',
55
+ lazyLoadNotApplied: 'LCP resources shouldn’t use loading=lazy',
56
56
  /**
57
- * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
57
+ * @description Text status indicating that the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
58
58
  */
59
59
  noLcp: 'No LCP detected',
60
60
  /**
61
61
  * @description Text status indicating that the Largest Contentful Paint (LCP) metric was text rather than an image. "LCP" is an acronym and should not be translated.
62
62
  */
63
- noLcpResource: 'No LCP resource detected because the LCP is not an image',
63
+ noLcpResource: 'No LCP resource detected because the LCP isn’t an image',
64
64
  } as const;
65
65
 
66
66
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPDiscovery.ts', UIStrings);
@@ -28,10 +28,14 @@ export const UIStrings = {
28
28
  * @description Description of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.
29
29
  */
30
30
  description:
31
- 'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript)',
32
- /** Label for a column in a data table; entries will be the individual JavaScript scripts. */
31
+ 'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren’t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript).',
32
+ /**
33
+ * @description Label for a column in a data table; entries will be the individual JavaScript scripts.
34
+ */
33
35
  columnScript: 'Script',
34
- /** Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes). */
36
+ /**
37
+ * @description Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes).
38
+ */
35
39
  columnWastedBytes: 'Wasted bytes',
36
40
  /**
37
41
  * @description Message shown when no legacy JavaScript is found.
@@ -24,7 +24,7 @@ export const UIStrings = {
24
24
  */
25
25
  title: 'Modern HTTP',
26
26
  /**
27
- * @description Description of an insight that recommends recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
27
+ * @description Description of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
28
28
  */
29
29
  description:
30
30
  'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',
@@ -37,10 +37,10 @@ export const UIStrings = {
37
37
  */
38
38
  protocol: 'Protocol',
39
39
  /**
40
- * @description Text explaining that there were not requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
40
+ * @description Text explaining that there were no requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
41
41
  */
42
42
  noOldProtocolRequests:
43
- 'No requests used HTTP/1.1, or its current use of HTTP/1.1 does not present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they are not served from a local development environment or a third-party source.',
43
+ 'No requests used HTTP/1.1, or its current use of HTTP/1.1 doesn’t present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they aren’t served from a local development environment or a third-party source.',
44
44
  } as const;
45
45
 
46
46
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);
@@ -38,7 +38,7 @@ export const UIStrings = {
38
38
  warningDescription:
39
39
  'Avoid chaining critical requests by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources to improve page load.',
40
40
  /**
41
- * @description Text status indicating that there isn't long chaining critical network requests.
41
+ * @description Text status indicating that there aren’t long chaining critical network requests.
42
42
  */
43
43
  noNetworkDependencyTree: 'No rendering tasks impacted by network dependencies',
44
44
  /**
@@ -46,9 +46,13 @@ export const UIStrings = {
46
46
  * the browser must download before it can render the page.
47
47
  */
48
48
  maxCriticalPathLatency: 'Max critical path latency:',
49
- /** Label for a column in a data table; entries will be the network request */
49
+ /**
50
+ * @description Label for a column in a data table; entries will be the network request.
51
+ */
50
52
  columnRequest: 'Request',
51
- /** Label for a column in a data table; entries will be the time from main document till current network request. */
53
+ /**
54
+ * @description Label for a column in a data table; entries will be the time from main document till current network request.
55
+ */
52
56
  columnTime: 'Time',
53
57
  /**
54
58
  * @description Title of the table of the detected preconnect origins.
@@ -60,9 +64,9 @@ export const UIStrings = {
60
64
  preconnectOriginsTableDescription:
61
65
  '[preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints help the browser establish a connection earlier in the page load, saving time when the first request for that origin is made. The following are the origins that the page preconnected to.',
62
66
  /**
63
- * @description Text status indicating that there isn't any preconnected origins.
67
+ * @description Text status indicating that no origins were preconnected.
64
68
  */
65
- noPreconnectOrigins: 'no origins were preconnected',
69
+ noPreconnectOrigins: 'No origins were preconnected',
66
70
  /**
67
71
  * @description A warning message that is shown when found more than 4 preconnected links. "preconnect" should not be translated.
68
72
  */
@@ -73,15 +77,15 @@ export const UIStrings = {
73
77
  */
74
78
  unusedWarning: 'Unused preconnect. Only use `preconnect` for origins that the page is likely to request.',
75
79
  /**
76
- * @description A warning message that is shown when the user forget to set the `crossorigin` HTML attribute, or setting it to an incorrect value, on the link is a common mistake when adding preconnect links. "preconnect" should not be translated.
77
- * */
80
+ * @description A warning message that is shown when the user forgets to set the `crossorigin` HTML attribute, or setting it to an incorrect value, on the link is a common mistake when adding preconnect links. "preconnect" should not be translated.
81
+ */
78
82
  crossoriginWarning: 'Unused preconnect. Check that the `crossorigin` attribute is used properly.',
79
83
  /**
80
84
  * @description Label for a column in a data table; entries will be the source of the origin.
81
85
  */
82
86
  columnSource: 'Source',
83
87
  /**
84
- * @description Text status indicating that there isn't preconnect candidates.
88
+ * @description Text status indicating that there aren’t preconnect candidates.
85
89
  */
86
90
  noPreconnectCandidates: 'No additional origins are good candidates for preconnecting',
87
91
  /**
@@ -94,7 +98,7 @@ export const UIStrings = {
94
98
  estSavingTableDescription:
95
99
  'Add [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect/) hints to your most important origins, but try to use no more than 4.',
96
100
  /**
97
- * @description Label for a column in a data table; entries will be the origin of a web resource
101
+ * @description Label for a column in a data table; entries will be the origin of a web resource.
98
102
  */
99
103
  columnOrigin: 'Origin',
100
104
  /**
@@ -40,7 +40,7 @@ export const UIStrings = {
40
40
  */
41
41
  duration: 'Duration',
42
42
  /**
43
- * @description Text status indicating that no requests blocked the initial render of a navigation
43
+ * @description Text status indicating that no requests blocked the initial render of a navigation.
44
44
  */
45
45
  noRenderBlocking: 'No render-blocking requests for this navigation',
46
46
  } as const;
@@ -4,9 +4,7 @@
4
4
 
5
5
  import * as i18n from '../../../core/i18n/i18n.js';
6
6
  import type * as Handlers from '../handlers/handlers.js';
7
- import type {SelectorStatsData} from '../handlers/SelectorStatsHandler.js';
8
7
  import * as Helpers from '../helpers/helpers.js';
9
- import {type SelectorTiming, SelectorTimingsKey} from '../types/TraceEvents.js';
10
8
  import * as Types from '../types/types.js';
11
9
 
12
10
  import {
@@ -21,23 +19,23 @@ export const UIStrings = {
21
19
  /**
22
20
  * @description Title of an insight that provides details about slow CSS selectors.
23
21
  */
24
- title: 'CSS Selector costs',
22
+ title: 'CSS selector costs',
25
23
 
26
24
  /**
27
25
  * @description Text to describe how to improve the performance of CSS selectors.
28
26
  */
29
27
  description:
30
- 'If Recalculate Style costs remain high, selector optimization can reduce them. [Optimize the selectors](https://developer.chrome.com/docs/performance/insights/slow-css-selector) with both high elapsed time and high slow-path %. Simpler selectors, fewer selectors, a smaller DOM, and a shallower DOM will all reduce matching costs.',
28
+ 'If recalculate style costs remain high, selector optimization can reduce them. [Optimize the selectors](https://developer.chrome.com/docs/performance/insights/slow-css-selector) with both high elapsed time and high slow-path %. Simpler selectors, fewer selectors, a smaller DOM, and a shallower DOM will all reduce matching costs.',
31
29
  /**
32
- * @description Column name for count of elements that the engine attempted to match against a style rule
30
+ * @description Column name for count of elements that the engine attempted to match against a style rule.
33
31
  */
34
32
  matchAttempts: 'Match attempts',
35
33
  /**
36
- * @description Column name for count of elements that matched a style rule
34
+ * @description Column name for count of elements that matched a style rule.
37
35
  */
38
36
  matchCount: 'Match count',
39
37
  /**
40
- * @description Column name for elapsed time spent computing a style rule
38
+ * @description Column name for elapsed time spent computing a style rule.
41
39
  */
42
40
  elapsed: 'Elapsed time',
43
41
  /**
@@ -52,13 +50,13 @@ export const UIStrings = {
52
50
  * @description Text status indicating that no CSS selector data was found.
53
51
  */
54
52
  enableSelectorData:
55
- 'No CSS selector data was found. CSS selector stats need to be enabled in the performance panel settings.',
53
+ 'No CSS selector data was found. CSS selector stats need to be enabled in the Performance panel settings.',
56
54
  /**
57
- * @description top CSS selector when ranked by elapsed time in ms
55
+ * @description Top CSS selector when ranked by elapsed time in ms.
58
56
  */
59
57
  topSelectorElapsedTime: 'Top selector elapsed time',
60
58
  /**
61
- * @description top CSS selector when ranked by match attempt
59
+ * @description Top CSS selector when ranked by match attempt.
62
60
  */
63
61
  topSelectorMatchAttempt: 'Top selector match attempt',
64
62
  } as const;
@@ -75,8 +73,9 @@ export type SlowCSSSelectorInsightModel = InsightModel<typeof UIStrings, {
75
73
  topSelectorMatchAttempts: Types.Events.SelectorTiming | null,
76
74
  }>;
77
75
 
78
- function aggregateSelectorStats(data: SelectorStatsData, context: InsightSetContext): SelectorTiming[] {
79
- const selectorMap = new Map<String, SelectorTiming>();
76
+ function aggregateSelectorStats(data: Handlers.ModelHandlers.SelectorStats.SelectorStatsData,
77
+ context: InsightSetContext): Types.Events.SelectorTiming[] {
78
+ const selectorMap = new Map<String, Types.Events.SelectorTiming>();
80
79
 
81
80
  for (const [event, value] of data.dataForRecalcStyleEvent) {
82
81
  if (event.args.beginData?.frame !== context.frameId) {
@@ -86,13 +85,16 @@ function aggregateSelectorStats(data: SelectorStatsData, context: InsightSetCont
86
85
  continue;
87
86
  }
88
87
  for (const timing of value.timings) {
89
- const key = timing[SelectorTimingsKey.Selector] + '_' + timing[SelectorTimingsKey.StyleSheetId];
88
+ const key =
89
+ timing[Types.Events.SelectorTimingsKey.Selector] + '_' + timing[Types.Events.SelectorTimingsKey.StyleSheetId];
90
90
  const findTiming = selectorMap.get(key);
91
91
  if (findTiming !== undefined) {
92
- findTiming[SelectorTimingsKey.Elapsed] += timing[SelectorTimingsKey.Elapsed];
93
- findTiming[SelectorTimingsKey.FastRejectCount] += timing[SelectorTimingsKey.FastRejectCount];
94
- findTiming[SelectorTimingsKey.MatchAttempts] += timing[SelectorTimingsKey.MatchAttempts];
95
- findTiming[SelectorTimingsKey.MatchCount] += timing[SelectorTimingsKey.MatchCount];
92
+ findTiming[Types.Events.SelectorTimingsKey.Elapsed] += timing[Types.Events.SelectorTimingsKey.Elapsed];
93
+ findTiming[Types.Events.SelectorTimingsKey.FastRejectCount] +=
94
+ timing[Types.Events.SelectorTimingsKey.FastRejectCount];
95
+ findTiming[Types.Events.SelectorTimingsKey.MatchAttempts] +=
96
+ timing[Types.Events.SelectorTimingsKey.MatchAttempts];
97
+ findTiming[Types.Events.SelectorTimingsKey.MatchCount] += timing[Types.Events.SelectorTimingsKey.MatchCount];
96
98
  } else {
97
99
  selectorMap.set(key, {...timing});
98
100
  }
@@ -134,28 +136,30 @@ export function generateInsight(
134
136
  let totalMatchCount = 0;
135
137
 
136
138
  selectorTimings.map(timing => {
137
- totalElapsedUs += timing[SelectorTimingsKey.Elapsed];
138
- totalMatchAttempts += timing[SelectorTimingsKey.MatchAttempts];
139
- totalMatchCount += timing[SelectorTimingsKey.MatchCount];
139
+ totalElapsedUs += timing[Types.Events.SelectorTimingsKey.Elapsed];
140
+ totalMatchAttempts += timing[Types.Events.SelectorTimingsKey.MatchAttempts];
141
+ totalMatchCount += timing[Types.Events.SelectorTimingsKey.MatchCount];
140
142
  });
141
143
 
142
- let topSelectorElapsedMs: SelectorTiming|null = null;
143
- let topSelectorMatchAttempts: SelectorTiming|null = null;
144
+ let topSelectorElapsedMs: Types.Events.SelectorTiming|null = null;
145
+ let topSelectorMatchAttempts: Types.Events.SelectorTiming|null = null;
144
146
 
145
147
  if (selectorTimings.length > 0) {
146
148
  // find the selector with most elapsed time
147
149
  topSelectorElapsedMs = selectorTimings.reduce((a, b) => {
148
- return a[SelectorTimingsKey.Elapsed] > b[SelectorTimingsKey.Elapsed] ? a : b;
150
+ return a[Types.Events.SelectorTimingsKey.Elapsed] > b[Types.Events.SelectorTimingsKey.Elapsed] ? a : b;
149
151
  });
150
152
 
151
153
  // check if the slowest selector is slow enough to trigger insights info
152
- if (topSelectorElapsedMs && topSelectorElapsedMs[SelectorTimingsKey.Elapsed] < slowCSSSelectorThreshold) {
154
+ if (topSelectorElapsedMs &&
155
+ topSelectorElapsedMs[Types.Events.SelectorTimingsKey.Elapsed] < slowCSSSelectorThreshold) {
153
156
  topSelectorElapsedMs = null;
154
157
  }
155
158
 
156
159
  // find the selector with most match attempts
157
160
  topSelectorMatchAttempts = selectorTimings.reduce((a, b) => {
158
- return a[SelectorTimingsKey.MatchAttempts] > b[SelectorTimingsKey.MatchAttempts] ? a : b;
161
+ return a[Types.Events.SelectorTimingsKey.MatchAttempts] > b[Types.Events.SelectorTimingsKey.MatchAttempts] ? a :
162
+ b;
159
163
  });
160
164
  }
161
165
 
@@ -17,7 +17,9 @@ import {
17
17
  } from './types.js';
18
18
 
19
19
  export const UIStrings = {
20
- /** Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as "third-party code"). */
20
+ /**
21
+ * @description Title of an insight that provides details about the code on a web page that the user doesn't control (referred to as "third-party code").
22
+ */
21
23
  title: '3rd parties',
22
24
  /**
23
25
  * @description Description of a DevTools insight that identifies the code on the page that the user doesn't control.
@@ -25,14 +27,20 @@ export const UIStrings = {
25
27
  */
26
28
  description: '3rd party code can significantly impact load performance. ' +
27
29
  '[Reduce and defer loading of 3rd party code](https://developer.chrome.com/docs/performance/insights/third-parties) to prioritize your page’s content.',
28
- /** Label for a table column that displays the name of a third-party provider. */
30
+ /**
31
+ * @description Label for a table column that displays the name of a third-party provider.
32
+ */
29
33
  columnThirdParty: '3rd party',
30
- /** Label for a column in a data table; entries will be the download size of a web resource in kilobytes. */
34
+ /**
35
+ * @description Label for a column in a data table; entries will be the download size of a web resource in kilobytes.
36
+ */
31
37
  columnTransferSize: 'Transfer size',
32
- /** Label for a table column that displays how much time each row spent running on the main thread, entries will be the number of milliseconds spent. */
38
+ /**
39
+ * @description Label for a table column that displays how much time each row spent running on the main thread, entries will be the number of milliseconds spent.
40
+ */
33
41
  columnMainThreadTime: 'Main thread time',
34
42
  /**
35
- * @description Text block indicating that no third party content was detected on the page
43
+ * @description Text block indicating that no third party content was detected on the page.
36
44
  */
37
45
  noThirdParties: 'No third parties found',
38
46
  } as const;
@@ -18,13 +18,15 @@ import {
18
18
  } from './types.js';
19
19
 
20
20
  export const UIStrings = {
21
- /** Title of an insight that provides details about if the page's viewport is optimized for mobile viewing. */
21
+ /**
22
+ * @description Title of an insight that provides details about if the page's viewport is optimized for mobile viewing.
23
+ */
22
24
  title: 'Optimize viewport for mobile',
23
25
  /**
24
26
  * @description Text to tell the user how a viewport meta element can improve performance. \xa0 is a non-breaking space
25
27
  */
26
28
  description:
27
- 'Tap interactions may be [delayed by up to 300\xA0ms](https://developer.chrome.com/docs/performance/insights/viewport) if the viewport is not optimized for mobile.',
29
+ 'Tap interactions may be [delayed by up to 300\xA0ms](https://developer.chrome.com/docs/performance/insights/viewport) if the viewport isn’t optimized for mobile.',
28
30
  /**
29
31
  * @description Text for a label describing the portion of an interaction event that was delayed due to a bad mobile viewport.
30
32
  */