chrome-devtools-frontend 1.0.1539972 → 1.0.1541552

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 (106) hide show
  1. package/eslint.config.mjs +167 -151
  2. package/front_end/Tests.js +5 -1
  3. package/front_end/core/common/Revealer.ts +5 -0
  4. package/front_end/core/common/Settings.ts +106 -95
  5. package/front_end/core/host/InspectorFrontendHost.ts +10 -10
  6. package/front_end/core/sdk/NetworkManager.ts +16 -11
  7. package/front_end/core/sdk/sdk-meta.ts +0 -35
  8. package/front_end/entrypoints/main/MainImpl.ts +15 -7
  9. package/front_end/entrypoints/shell/shell.ts +1 -0
  10. package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
  11. package/front_end/foundation/README.md +10 -0
  12. package/front_end/foundation/Universe.ts +29 -0
  13. package/front_end/foundation/foundation.ts +7 -0
  14. package/front_end/generated/InspectorBackendCommands.ts +6 -3
  15. package/front_end/generated/SupportedCSSProperties.js +13 -0
  16. package/front_end/generated/protocol.ts +58 -2
  17. package/front_end/models/ai_assistance/BuiltInAi.ts +2 -1
  18. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +44 -34
  19. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
  20. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
  21. package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
  22. package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
  23. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  24. package/front_end/models/trace/Processor.ts +5 -4
  25. package/front_end/models/trace/insights/types.ts +1 -1
  26. package/front_end/models/trace/types/TraceEvents.ts +1 -1
  27. package/front_end/models/workspace/IgnoreListManager.ts +41 -47
  28. package/front_end/models/workspace/workspace-meta.ts +40 -0
  29. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +1 -1
  30. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
  31. package/front_end/panels/animation/AnimationTimeline.ts +4 -4
  32. package/front_end/panels/animation/AnimationUI.ts +28 -34
  33. package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
  34. package/front_end/panels/elements/LayoutPane.ts +2 -2
  35. package/front_end/panels/elements/components/AdornerManager.ts +9 -9
  36. package/front_end/panels/elements/layoutPane.css +5 -9
  37. package/front_end/panels/event_listeners/EventListenersView.ts +1 -1
  38. package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
  39. package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
  40. package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
  41. package/front_end/panels/issues/IssueView.ts +1 -1
  42. package/front_end/panels/issues/IssuesPane.ts +12 -15
  43. package/front_end/panels/issues/issues.ts +0 -2
  44. package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
  45. package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
  46. package/front_end/panels/network/RequestTimingView.ts +13 -8
  47. package/front_end/panels/network/network-meta.ts +11 -0
  48. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
  49. package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
  50. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -1
  51. package/front_end/panels/sources/breakpointsView.css +1 -1
  52. package/front_end/panels/sources/sourcesPanel.css +2 -2
  53. package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
  54. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  55. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
  56. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
  57. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -1
  58. package/front_end/third_party/chromium/README.chromium +1 -1
  59. package/front_end/third_party/puppeteer/README.chromium +2 -2
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +3 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  67. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +4 -4
  68. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  69. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +3 -1
  70. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  72. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  73. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  75. package/front_end/third_party/puppeteer/package/package.json +1 -1
  76. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +3 -1
  77. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  78. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  79. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  80. package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
  81. package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
  82. package/front_end/ui/legacy/UIUtils.ts +2 -1
  83. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
  84. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +148 -125
  85. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
  86. package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
  87. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
  88. package/front_end/ui/legacy/inspectorCommon.css +3 -2
  89. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  90. package/mcp/mcp.ts +16 -0
  91. package/package.json +2 -1
  92. package/front_end/ui/components/docs/context_menu/basic.html +0 -45
  93. package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
  94. package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
  95. package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
  96. package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
  97. package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
  98. package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
  99. package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
  100. package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
  101. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
  102. package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
  103. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
  104. package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
  105. package/front_end/ui/components/docs/snackbars/basic.html +0 -17
  106. package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
@@ -4,7 +4,29 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import type * as Protocol from '../../generated/protocol.js';
7
- import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
7
+
8
+ import {AttributionReportingIssue} from './AttributionReportingIssue.js';
9
+ import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
10
+ import {CookieDeprecationMetadataIssue} from './CookieDeprecationMetadataIssue.js';
11
+ import {CookieIssue} from './CookieIssue.js';
12
+ import {CorsIssue} from './CorsIssue.js';
13
+ import {DeprecationIssue} from './DeprecationIssue.js';
14
+ import {ElementAccessibilityIssue} from './ElementAccessibilityIssue.js';
15
+ import {GenericIssue} from './GenericIssue.js';
16
+ import {HeavyAdIssue} from './HeavyAdIssue.js';
17
+ import {Issue, IssueCategory, IssueKind, unionIssueKind} from './Issue.js';
18
+ import type {EventTypes as IssuesManagerEventsTypes, IssueAddedEvent} from './IssuesManager.js';
19
+ import {Events as IssuesManagerEvents} from './IssuesManagerEvents.js';
20
+ import {LowTextContrastIssue} from './LowTextContrastIssue.js';
21
+ import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
22
+ import {MixedContentIssue} from './MixedContentIssue.js';
23
+ import {PartitioningBlobURLIssue} from './PartitioningBlobURLIssue.js';
24
+ import {QuirksModeIssue} from './QuirksModeIssue.js';
25
+ import {SharedArrayBufferIssue} from './SharedArrayBufferIssue.js';
26
+
27
+ export interface IssuesProvider extends Common.EventTarget.EventTarget<IssuesManagerEventsTypes> {
28
+ issues(): Iterable<Issue>;
29
+ }
8
30
 
9
31
  interface AggregationKeyTag {
10
32
  aggregationKeyTag: undefined;
@@ -24,7 +46,7 @@ export type AggregationKey = {
24
46
  * Currently only grouping by issue code, is supported. The class provides helpers to support displaying
25
47
  * of all resources that are affected by the aggregated issues.
26
48
  */
27
- export class AggregatedIssue extends IssuesManager.Issue.Issue {
49
+ export class AggregatedIssue extends Issue {
28
50
  #affectedCookies = new Map<string, {
29
51
  cookie: Protocol.Audits.AffectedCookie,
30
52
  hasRequest: boolean,
@@ -33,24 +55,23 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
33
55
  #affectedRequests: Protocol.Audits.AffectedRequest[] = [];
34
56
  #affectedRequestIds = new Set<Protocol.Network.RequestId>();
35
57
  #affectedLocations = new Map<string, Protocol.Audits.SourceCodeLocation>();
36
- #heavyAdIssues = new Set<IssuesManager.HeavyAdIssue.HeavyAdIssue>();
58
+ #heavyAdIssues = new Set<HeavyAdIssue>();
37
59
  #blockedByResponseDetails = new Map<string, Protocol.Audits.BlockedByResponseIssueDetails>();
38
60
  #bounceTrackingSites = new Set<string>();
39
- #corsIssues = new Set<IssuesManager.CorsIssue.CorsIssue>();
40
- #cspIssues = new Set<IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue>();
41
- #deprecationIssues = new Set<IssuesManager.DeprecationIssue.DeprecationIssue>();
42
- #issueKind = IssuesManager.Issue.IssueKind.IMPROVEMENT;
43
- #lowContrastIssues = new Set<IssuesManager.LowTextContrastIssue.LowTextContrastIssue>();
44
- #cookieDeprecationMetadataIssues =
45
- new Set<IssuesManager.CookieDeprecationMetadataIssue.CookieDeprecationMetadataIssue>();
46
- #mixedContentIssues = new Set<IssuesManager.MixedContentIssue.MixedContentIssue>();
47
- #partitioningBlobURLIssues = new Set<IssuesManager.PartitioningBlobURLIssue.PartitioningBlobURLIssue>();
48
- #sharedArrayBufferIssues = new Set<IssuesManager.SharedArrayBufferIssue.SharedArrayBufferIssue>();
49
- #quirksModeIssues = new Set<IssuesManager.QuirksModeIssue.QuirksModeIssue>();
50
- #attributionReportingIssues = new Set<IssuesManager.AttributionReportingIssue.AttributionReportingIssue>();
51
- #genericIssues = new Set<IssuesManager.GenericIssue.GenericIssue>();
52
- #elementAccessibilityIssues = new Set<IssuesManager.ElementAccessibilityIssue.ElementAccessibilityIssue>();
53
- #representative?: IssuesManager.Issue.Issue;
61
+ #corsIssues = new Set<CorsIssue>();
62
+ #cspIssues = new Set<ContentSecurityPolicyIssue>();
63
+ #deprecationIssues = new Set<DeprecationIssue>();
64
+ #issueKind = IssueKind.IMPROVEMENT;
65
+ #lowContrastIssues = new Set<LowTextContrastIssue>();
66
+ #cookieDeprecationMetadataIssues = new Set<CookieDeprecationMetadataIssue>();
67
+ #mixedContentIssues = new Set<MixedContentIssue>();
68
+ #partitioningBlobURLIssues = new Set<PartitioningBlobURLIssue>();
69
+ #sharedArrayBufferIssues = new Set<SharedArrayBufferIssue>();
70
+ #quirksModeIssues = new Set<QuirksModeIssue>();
71
+ #attributionReportingIssues = new Set<AttributionReportingIssue>();
72
+ #genericIssues = new Set<GenericIssue>();
73
+ #elementAccessibilityIssues = new Set<ElementAccessibilityIssue>();
74
+ #representative?: Issue;
54
75
  #aggregatedIssuesCount = 0;
55
76
  #key: AggregationKey;
56
77
 
@@ -94,32 +115,31 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
94
115
  return this.#affectedCookies.values();
95
116
  }
96
117
 
97
- getHeavyAdIssues(): Iterable<IssuesManager.HeavyAdIssue.HeavyAdIssue> {
118
+ getHeavyAdIssues(): Iterable<HeavyAdIssue> {
98
119
  return this.#heavyAdIssues;
99
120
  }
100
121
 
101
- getCookieDeprecationMetadataIssues():
102
- Iterable<IssuesManager.CookieDeprecationMetadataIssue.CookieDeprecationMetadataIssue> {
122
+ getCookieDeprecationMetadataIssues(): Iterable<CookieDeprecationMetadataIssue> {
103
123
  return this.#cookieDeprecationMetadataIssues;
104
124
  }
105
125
 
106
- getMixedContentIssues(): Iterable<IssuesManager.MixedContentIssue.MixedContentIssue> {
126
+ getMixedContentIssues(): Iterable<MixedContentIssue> {
107
127
  return this.#mixedContentIssues;
108
128
  }
109
129
 
110
- getCorsIssues(): Set<IssuesManager.CorsIssue.CorsIssue> {
130
+ getCorsIssues(): Set<CorsIssue> {
111
131
  return this.#corsIssues;
112
132
  }
113
133
 
114
- getCspIssues(): Iterable<IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue> {
134
+ getCspIssues(): Iterable<ContentSecurityPolicyIssue> {
115
135
  return this.#cspIssues;
116
136
  }
117
137
 
118
- getDeprecationIssues(): Iterable<IssuesManager.DeprecationIssue.DeprecationIssue> {
138
+ getDeprecationIssues(): Iterable<DeprecationIssue> {
119
139
  return this.#deprecationIssues;
120
140
  }
121
141
 
122
- getLowContrastIssues(): Iterable<IssuesManager.LowTextContrastIssue.LowTextContrastIssue> {
142
+ getLowContrastIssues(): Iterable<LowTextContrastIssue> {
123
143
  return this.#lowContrastIssues;
124
144
  }
125
145
 
@@ -127,45 +147,45 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
127
147
  return this.#affectedRequests.values();
128
148
  }
129
149
 
130
- getSharedArrayBufferIssues(): Iterable<IssuesManager.SharedArrayBufferIssue.SharedArrayBufferIssue> {
150
+ getSharedArrayBufferIssues(): Iterable<SharedArrayBufferIssue> {
131
151
  return this.#sharedArrayBufferIssues;
132
152
  }
133
153
 
134
- getQuirksModeIssues(): Iterable<IssuesManager.QuirksModeIssue.QuirksModeIssue> {
154
+ getQuirksModeIssues(): Iterable<QuirksModeIssue> {
135
155
  return this.#quirksModeIssues;
136
156
  }
137
157
 
138
- getAttributionReportingIssues(): ReadonlySet<IssuesManager.AttributionReportingIssue.AttributionReportingIssue> {
158
+ getAttributionReportingIssues(): ReadonlySet<AttributionReportingIssue> {
139
159
  return this.#attributionReportingIssues;
140
160
  }
141
161
 
142
- getGenericIssues(): ReadonlySet<IssuesManager.GenericIssue.GenericIssue> {
162
+ getGenericIssues(): ReadonlySet<GenericIssue> {
143
163
  return this.#genericIssues;
144
164
  }
145
165
 
146
- getElementAccessibilityIssues(): Iterable<IssuesManager.ElementAccessibilityIssue.ElementAccessibilityIssue> {
166
+ getElementAccessibilityIssues(): Iterable<ElementAccessibilityIssue> {
147
167
  return this.#elementAccessibilityIssues;
148
168
  }
149
169
 
150
- getDescription(): IssuesManager.MarkdownIssueDescription.MarkdownIssueDescription|null {
170
+ getDescription(): MarkdownIssueDescription|null {
151
171
  if (this.#representative) {
152
172
  return this.#representative.getDescription();
153
173
  }
154
174
  return null;
155
175
  }
156
176
 
157
- getCategory(): IssuesManager.Issue.IssueCategory {
177
+ getCategory(): IssueCategory {
158
178
  if (this.#representative) {
159
179
  return this.#representative.getCategory();
160
180
  }
161
- return IssuesManager.Issue.IssueCategory.OTHER;
181
+ return IssueCategory.OTHER;
162
182
  }
163
183
 
164
184
  getAggregatedIssuesCount(): number {
165
185
  return this.#aggregatedIssuesCount;
166
186
  }
167
187
 
168
- getPartitioningBlobURLIssues(): Iterable<IssuesManager.PartitioningBlobURLIssue.PartitioningBlobURLIssue> {
188
+ getPartitioningBlobURLIssues(): Iterable<PartitioningBlobURLIssue> {
169
189
  return this.#partitioningBlobURLIssues;
170
190
  }
171
191
 
@@ -178,12 +198,12 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
178
198
  return `${domain};${path};${name}`;
179
199
  }
180
200
 
181
- addInstance(issue: IssuesManager.Issue.Issue): void {
201
+ addInstance(issue: Issue): void {
182
202
  this.#aggregatedIssuesCount++;
183
203
  if (!this.#representative) {
184
204
  this.#representative = issue;
185
205
  }
186
- this.#issueKind = IssuesManager.Issue.unionIssueKind(this.#issueKind, issue.getKind());
206
+ this.#issueKind = unionIssueKind(this.#issueKind, issue.getKind());
187
207
  let hasRequest = false;
188
208
  for (const request of issue.requests()) {
189
209
  const {requestId} = request;
@@ -217,52 +237,52 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
217
237
  this.#affectedLocations.set(key, location);
218
238
  }
219
239
  }
220
- if (issue instanceof IssuesManager.CookieDeprecationMetadataIssue.CookieDeprecationMetadataIssue) {
240
+ if (issue instanceof CookieDeprecationMetadataIssue) {
221
241
  this.#cookieDeprecationMetadataIssues.add(issue);
222
242
  }
223
- if (issue instanceof IssuesManager.MixedContentIssue.MixedContentIssue) {
243
+ if (issue instanceof MixedContentIssue) {
224
244
  this.#mixedContentIssues.add(issue);
225
245
  }
226
- if (issue instanceof IssuesManager.HeavyAdIssue.HeavyAdIssue) {
246
+ if (issue instanceof HeavyAdIssue) {
227
247
  this.#heavyAdIssues.add(issue);
228
248
  }
229
249
  for (const details of issue.getBlockedByResponseDetails()) {
230
250
  const key = JSON.stringify(details, ['parentFrame', 'blockedFrame', 'requestId', 'frameId', 'reason', 'request']);
231
251
  this.#blockedByResponseDetails.set(key, details);
232
252
  }
233
- if (issue instanceof IssuesManager.ContentSecurityPolicyIssue.ContentSecurityPolicyIssue) {
253
+ if (issue instanceof ContentSecurityPolicyIssue) {
234
254
  this.#cspIssues.add(issue);
235
255
  }
236
- if (issue instanceof IssuesManager.DeprecationIssue.DeprecationIssue) {
256
+ if (issue instanceof DeprecationIssue) {
237
257
  this.#deprecationIssues.add(issue);
238
258
  }
239
- if (issue instanceof IssuesManager.SharedArrayBufferIssue.SharedArrayBufferIssue) {
259
+ if (issue instanceof SharedArrayBufferIssue) {
240
260
  this.#sharedArrayBufferIssues.add(issue);
241
261
  }
242
- if (issue instanceof IssuesManager.LowTextContrastIssue.LowTextContrastIssue) {
262
+ if (issue instanceof LowTextContrastIssue) {
243
263
  this.#lowContrastIssues.add(issue);
244
264
  }
245
- if (issue instanceof IssuesManager.CorsIssue.CorsIssue) {
265
+ if (issue instanceof CorsIssue) {
246
266
  this.#corsIssues.add(issue);
247
267
  }
248
- if (issue instanceof IssuesManager.QuirksModeIssue.QuirksModeIssue) {
268
+ if (issue instanceof QuirksModeIssue) {
249
269
  this.#quirksModeIssues.add(issue);
250
270
  }
251
- if (issue instanceof IssuesManager.AttributionReportingIssue.AttributionReportingIssue) {
271
+ if (issue instanceof AttributionReportingIssue) {
252
272
  this.#attributionReportingIssues.add(issue);
253
273
  }
254
- if (issue instanceof IssuesManager.GenericIssue.GenericIssue) {
274
+ if (issue instanceof GenericIssue) {
255
275
  this.#genericIssues.add(issue);
256
276
  }
257
- if (issue instanceof IssuesManager.ElementAccessibilityIssue.ElementAccessibilityIssue) {
277
+ if (issue instanceof ElementAccessibilityIssue) {
258
278
  this.#elementAccessibilityIssues.add(issue);
259
279
  }
260
- if (issue instanceof IssuesManager.PartitioningBlobURLIssue.PartitioningBlobURLIssue) {
280
+ if (issue instanceof PartitioningBlobURLIssue) {
261
281
  this.#partitioningBlobURLIssues.add(issue);
262
282
  }
263
283
  }
264
284
 
265
- getKind(): IssuesManager.Issue.IssueKind {
285
+ getKind(): IssueKind {
266
286
  return this.#issueKind;
267
287
  }
268
288
 
@@ -278,17 +298,16 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
278
298
  export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
279
299
  readonly #aggregatedIssuesByKey = new Map<AggregationKey, AggregatedIssue>();
280
300
  readonly #hiddenAggregatedIssuesByKey = new Map<AggregationKey, AggregatedIssue>();
281
- constructor(private readonly issuesManager: IssuesManager.IssuesManager.IssuesManager) {
301
+ constructor(private readonly issuesManager: IssuesProvider) {
282
302
  super();
283
- this.issuesManager.addEventListener(IssuesManager.IssuesManager.Events.ISSUE_ADDED, this.#onIssueAdded, this);
284
- this.issuesManager.addEventListener(
285
- IssuesManager.IssuesManager.Events.FULL_UPDATE_REQUIRED, this.#onFullUpdateRequired, this);
303
+ this.issuesManager.addEventListener(IssuesManagerEvents.ISSUE_ADDED, this.#onIssueAdded, this);
304
+ this.issuesManager.addEventListener(IssuesManagerEvents.FULL_UPDATE_REQUIRED, this.#onFullUpdateRequired, this);
286
305
  for (const issue of this.issuesManager.issues()) {
287
306
  this.#aggregateIssue(issue);
288
307
  }
289
308
  }
290
309
 
291
- #onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssuesManager.IssuesManager.IssueAddedEvent>): void {
310
+ #onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssueAddedEvent>): void {
292
311
  this.#aggregateIssue(event.data.issue);
293
312
  }
294
313
 
@@ -301,8 +320,8 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
301
320
  this.dispatchEventToListeners(Events.FULL_UPDATE_REQUIRED);
302
321
  }
303
322
 
304
- #aggregateIssue(issue: IssuesManager.Issue.Issue): AggregatedIssue|undefined {
305
- if (IssuesManager.CookieIssue.CookieIssue.isThirdPartyCookiePhaseoutRelatedIssue(issue)) {
323
+ #aggregateIssue(issue: Issue): AggregatedIssue|undefined {
324
+ if (CookieIssue.isThirdPartyCookiePhaseoutRelatedIssue(issue)) {
306
325
  return;
307
326
  }
308
327
 
@@ -312,8 +331,7 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
312
331
  return aggregatedIssue;
313
332
  }
314
333
 
315
- #aggregateIssueByStatus(aggregatedIssuesMap: Map<AggregationKey, AggregatedIssue>, issue: IssuesManager.Issue.Issue):
316
- AggregatedIssue {
334
+ #aggregateIssueByStatus(aggregatedIssuesMap: Map<AggregationKey, AggregatedIssue>, issue: Issue): AggregatedIssue {
317
335
  const key = issue.code() as unknown as AggregationKey;
318
336
  let aggregatedIssue = aggregatedIssuesMap.get(key);
319
337
  if (!aggregatedIssue) {
@@ -332,16 +350,16 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
332
350
  return new Set([...this.#aggregatedIssuesByKey.keys(), ...this.#hiddenAggregatedIssuesByKey.keys()]);
333
351
  }
334
352
 
335
- aggregatedIssueCategories(): Set<IssuesManager.Issue.IssueCategory> {
336
- const result = new Set<IssuesManager.Issue.IssueCategory>();
353
+ aggregatedIssueCategories(): Set<IssueCategory> {
354
+ const result = new Set<IssueCategory>();
337
355
  for (const issue of this.#aggregatedIssuesByKey.values()) {
338
356
  result.add(issue.getCategory());
339
357
  }
340
358
  return result;
341
359
  }
342
360
 
343
- aggregatedIssueKinds(): Set<IssuesManager.Issue.IssueKind> {
344
- const result = new Set<IssuesManager.Issue.IssueKind>();
361
+ aggregatedIssueKinds(): Set<IssueKind> {
362
+ const result = new Set<IssueKind>();
345
363
  for (const issue of this.#aggregatedIssuesByKey.values()) {
346
364
  result.add(issue.getKind());
347
365
  }
@@ -356,7 +374,7 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
356
374
  return this.#hiddenAggregatedIssuesByKey.size;
357
375
  }
358
376
 
359
- keyForIssue(issue: IssuesManager.Issue.Issue<string>): AggregationKey {
377
+ keyForIssue(issue: Issue<string>): AggregationKey {
360
378
  return issue.code() as unknown as AggregationKey;
361
379
  }
362
380
  }
@@ -17,6 +17,7 @@ import * as FederatedAuthUserInfoRequestIssue from './FederatedAuthUserInfoReque
17
17
  import * as GenericIssue from './GenericIssue.js';
18
18
  import * as HeavyAdIssue from './HeavyAdIssue.js';
19
19
  import * as Issue from './Issue.js';
20
+ import * as IssueAggregator from './IssueAggregator.js';
20
21
  import * as IssueResolver from './IssueResolver.js';
21
22
  import * as IssuesManager from './IssuesManager.js';
22
23
  import * as LowTextContrastIssue from './LowTextContrastIssue.js';
@@ -49,6 +50,7 @@ export {
49
50
  GenericIssue,
50
51
  HeavyAdIssue,
51
52
  Issue,
53
+ IssueAggregator,
52
54
  IssueResolver,
53
55
  IssuesManager,
54
56
  LowTextContrastIssue,
@@ -431,9 +431,13 @@ export class TraceProcessor extends EventTarget {
431
431
  #computeInsightSet(data: Handlers.Types.HandlerData, context: Insights.Types.InsightSetContext): void {
432
432
  const logger = context.options.logger;
433
433
 
434
+ if (!this.#insights) {
435
+ this.#insights = new Map();
436
+ }
437
+
434
438
  let id, urlString, navigation;
435
439
  if (context.navigation) {
436
- id = context.navigationId;
440
+ id = `NAVIGATION_${this.#insights.size}`;
437
441
  urlString = data.Meta.finalDisplayUrlByNavigationId.get(context.navigationId) ?? data.Meta.mainFrameURL;
438
442
  navigation = context.navigation;
439
443
  } else {
@@ -503,9 +507,6 @@ export class TraceProcessor extends EventTarget {
503
507
  bounds: context.bounds,
504
508
  model: insightSetModel,
505
509
  };
506
- if (!this.#insights) {
507
- this.#insights = new Map();
508
- }
509
510
  this.#insights.set(insightSet.id, insightSet);
510
511
  this.sortInsightSet(insightSet, context.options.metadata ?? null);
511
512
  }
@@ -110,7 +110,7 @@ export type PartialInsightModel<T> =
110
110
  * navigation (or the end of the trace).
111
111
  */
112
112
  export interface InsightSet {
113
- /** If for a navigation, this is the navigationId. Else it is Trace.Types.Events.NO_NAVIGATION. */
113
+ /** If for a navigation, this is of the form "NAVIGATION_(index)". Else it is Trace.Types.Events.NO_NAVIGATION. */
114
114
  id: Types.Events.NavigationId;
115
115
  /** The URL to show in the accordion list. */
116
116
  url: URL;
@@ -1001,7 +1001,7 @@ export const NO_NAVIGATION = 'NO_NAVIGATION';
1001
1001
  * portion of the trace for which we don't have any navigation event for (as it happeneded prior
1002
1002
  * to the trace start).
1003
1003
  */
1004
- export type NavigationId = string|typeof NO_NAVIGATION;
1004
+ export type NavigationId = string;
1005
1005
 
1006
1006
  /**
1007
1007
  * This is a synthetic Layout shift cluster. The rawSourceEvent is the worst layout shift event
@@ -50,51 +50,49 @@ export interface IgnoreListGeneralRules {
50
50
 
51
51
  export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
52
52
  SDK.TargetManager.SDKModelObserver<SDK.DebuggerModel.DebuggerModel> {
53
- readonly #listeners: Set<() => void>;
54
- readonly #isIgnoreListedURLCache: Map<string, boolean>;
55
- readonly #contentScriptExecutionContexts: Set<string>;
53
+ readonly #settings: Common.Settings.Settings;
54
+ readonly #targetManager: SDK.TargetManager.TargetManager;
56
55
 
57
- private constructor() {
56
+ readonly #listeners = new Set<() => void>();
57
+ readonly #isIgnoreListedURLCache = new Map<string, boolean>();
58
+ readonly #contentScriptExecutionContexts = new Set<string>();
59
+
60
+ private constructor(settings: Common.Settings.Settings, targetManager: SDK.TargetManager.TargetManager) {
58
61
  super();
62
+ this.#settings = settings;
63
+ this.#targetManager = targetManager;
59
64
 
60
- SDK.TargetManager.TargetManager.instance().addModelListener(
65
+ this.#targetManager.addModelListener(
61
66
  SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared,
62
67
  this.clearCacheIfNeeded.bind(this), this);
63
- SDK.TargetManager.TargetManager.instance().addModelListener(
68
+ this.#targetManager.addModelListener(
64
69
  SDK.RuntimeModel.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextCreated, this.onExecutionContextCreated,
65
70
  this, {scoped: true});
66
- SDK.TargetManager.TargetManager.instance().addModelListener(
71
+ this.#targetManager.addModelListener(
67
72
  SDK.RuntimeModel.RuntimeModel, SDK.RuntimeModel.Events.ExecutionContextDestroyed,
68
73
  this.onExecutionContextDestroyed, this, {scoped: true});
69
- Common.Settings.Settings.instance()
70
- .moduleSetting('skip-stack-frames-pattern')
71
- .addChangeListener(this.patternChanged.bind(this));
72
- Common.Settings.Settings.instance()
73
- .moduleSetting('skip-content-scripts')
74
- .addChangeListener(this.patternChanged.bind(this));
75
- Common.Settings.Settings.instance()
76
- .moduleSetting('automatically-ignore-list-known-third-party-scripts')
77
- .addChangeListener(this.patternChanged.bind(this));
78
- Common.Settings.Settings.instance()
79
- .moduleSetting('enable-ignore-listing')
74
+ this.#settings.moduleSetting('skip-stack-frames-pattern').addChangeListener(this.patternChanged.bind(this));
75
+ this.#settings.moduleSetting('skip-content-scripts').addChangeListener(this.patternChanged.bind(this));
76
+ this.#settings.moduleSetting('automatically-ignore-list-known-third-party-scripts')
80
77
  .addChangeListener(this.patternChanged.bind(this));
81
- Common.Settings.Settings.instance()
82
- .moduleSetting('skip-anonymous-scripts')
83
- .addChangeListener(this.patternChanged.bind(this));
84
-
85
- this.#listeners = new Set();
86
- this.#isIgnoreListedURLCache = new Map();
87
- this.#contentScriptExecutionContexts = new Set();
78
+ this.#settings.moduleSetting('enable-ignore-listing').addChangeListener(this.patternChanged.bind(this));
79
+ this.#settings.moduleSetting('skip-anonymous-scripts').addChangeListener(this.patternChanged.bind(this));
88
80
 
89
- SDK.TargetManager.TargetManager.instance().observeModels(SDK.DebuggerModel.DebuggerModel, this);
81
+ this.#targetManager.observeModels(SDK.DebuggerModel.DebuggerModel, this);
90
82
  }
91
83
 
92
84
  static instance(opts: {
93
85
  forceNew: boolean|null,
94
- } = {forceNew: null}): IgnoreListManager {
86
+ settings?: Common.Settings.Settings,
87
+ targetManager?: SDK.TargetManager.TargetManager,
88
+ } = {
89
+ forceNew: null,
90
+ }): IgnoreListManager {
95
91
  const {forceNew} = opts;
96
92
  if (!ignoreListManagerInstance || forceNew) {
97
- ignoreListManagerInstance = new IgnoreListManager();
93
+ ignoreListManagerInstance = new IgnoreListManager(
94
+ opts.settings ?? Common.Settings.Settings.instance(),
95
+ opts.targetManager ?? SDK.TargetManager.TargetManager.instance());
98
96
  }
99
97
 
100
98
  return ignoreListManagerInstance;
@@ -135,8 +133,7 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
135
133
  if (this.isContentScript(event.data)) {
136
134
  this.#contentScriptExecutionContexts.add(event.data.uniqueId);
137
135
  if (this.skipContentScripts) {
138
- for (const debuggerModel of SDK.TargetManager.TargetManager.instance().models(
139
- SDK.DebuggerModel.DebuggerModel)) {
136
+ for (const debuggerModel of this.#targetManager.models(SDK.DebuggerModel.DebuggerModel)) {
140
137
  void this.updateIgnoredExecutionContexts(debuggerModel);
141
138
  }
142
139
  }
@@ -148,8 +145,7 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
148
145
  if (this.isContentScript(event.data)) {
149
146
  this.#contentScriptExecutionContexts.delete(event.data.uniqueId);
150
147
  if (this.skipContentScripts) {
151
- for (const debuggerModel of SDK.TargetManager.TargetManager.instance().models(
152
- SDK.DebuggerModel.DebuggerModel)) {
148
+ for (const debuggerModel of this.#targetManager.models(SDK.DebuggerModel.DebuggerModel)) {
153
149
  void this.updateIgnoredExecutionContexts(debuggerModel);
154
150
  }
155
151
  }
@@ -163,8 +159,7 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
163
159
  }
164
160
 
165
161
  private getSkipStackFramesPatternSetting(): Common.Settings.RegExpSetting {
166
- return Common.Settings.Settings.instance().moduleSetting('skip-stack-frames-pattern') as
167
- Common.Settings.RegExpSetting;
162
+ return this.#settings.moduleSetting('skip-stack-frames-pattern') as Common.Settings.RegExpSetting;
168
163
  }
169
164
 
170
165
  private setIgnoreListPatterns(debuggerModel: SDK.DebuggerModel.DebuggerModel): Promise<boolean> {
@@ -327,58 +322,57 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
327
322
  }
328
323
 
329
324
  get enableIgnoreListing(): boolean {
330
- return Common.Settings.Settings.instance().moduleSetting('enable-ignore-listing').get();
325
+ return this.#settings.moduleSetting('enable-ignore-listing').get();
331
326
  }
332
327
 
333
328
  set enableIgnoreListing(value: boolean) {
334
- Common.Settings.Settings.instance().moduleSetting('enable-ignore-listing').set(value);
329
+ this.#settings.moduleSetting('enable-ignore-listing').set(value);
335
330
  }
336
331
 
337
332
  get skipContentScripts(): boolean {
338
- return this.enableIgnoreListing && Common.Settings.Settings.instance().moduleSetting('skip-content-scripts').get();
333
+ return this.enableIgnoreListing && this.#settings.moduleSetting('skip-content-scripts').get();
339
334
  }
340
335
 
341
336
  get skipAnonymousScripts(): boolean {
342
- return this.enableIgnoreListing &&
343
- Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts').get();
337
+ return this.enableIgnoreListing && this.#settings.moduleSetting('skip-anonymous-scripts').get();
344
338
  }
345
339
 
346
340
  get automaticallyIgnoreListKnownThirdPartyScripts(): boolean {
347
341
  return this.enableIgnoreListing &&
348
- Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts').get();
342
+ this.#settings.moduleSetting('automatically-ignore-list-known-third-party-scripts').get();
349
343
  }
350
344
 
351
345
  ignoreListContentScripts(): void {
352
346
  if (!this.enableIgnoreListing) {
353
347
  this.enableIgnoreListing = true;
354
348
  }
355
- Common.Settings.Settings.instance().moduleSetting('skip-content-scripts').set(true);
349
+ this.#settings.moduleSetting('skip-content-scripts').set(true);
356
350
  }
357
351
 
358
352
  unIgnoreListContentScripts(): void {
359
- Common.Settings.Settings.instance().moduleSetting('skip-content-scripts').set(false);
353
+ this.#settings.moduleSetting('skip-content-scripts').set(false);
360
354
  }
361
355
 
362
356
  ignoreListAnonymousScripts(): void {
363
357
  if (!this.enableIgnoreListing) {
364
358
  this.enableIgnoreListing = true;
365
359
  }
366
- Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts').set(true);
360
+ this.#settings.moduleSetting('skip-anonymous-scripts').set(true);
367
361
  }
368
362
 
369
363
  unIgnoreListAnonymousScripts(): void {
370
- Common.Settings.Settings.instance().moduleSetting('skip-anonymous-scripts').set(false);
364
+ this.#settings.moduleSetting('skip-anonymous-scripts').set(false);
371
365
  }
372
366
 
373
367
  ignoreListThirdParty(): void {
374
368
  if (!this.enableIgnoreListing) {
375
369
  this.enableIgnoreListing = true;
376
370
  }
377
- Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts').set(true);
371
+ this.#settings.moduleSetting('automatically-ignore-list-known-third-party-scripts').set(true);
378
372
  }
379
373
 
380
374
  unIgnoreListThirdParty(): void {
381
- Common.Settings.Settings.instance().moduleSetting('automatically-ignore-list-known-third-party-scripts').set(false);
375
+ this.#settings.moduleSetting('automatically-ignore-list-known-third-party-scripts').set(false);
382
376
  }
383
377
 
384
378
  ignoreListURL(url: Platform.DevToolsPath.UrlString): void {
@@ -467,7 +461,7 @@ export class IgnoreListManager extends Common.ObjectWrapper.ObjectWrapper<EventT
467
461
  this.#isIgnoreListedURLCache.clear();
468
462
 
469
463
  const promises: Array<Promise<unknown>> = [];
470
- for (const debuggerModel of SDK.TargetManager.TargetManager.instance().models(SDK.DebuggerModel.DebuggerModel)) {
464
+ for (const debuggerModel of this.#targetManager.models(SDK.DebuggerModel.DebuggerModel)) {
471
465
  promises.push(this.setIgnoreListPatterns(debuggerModel));
472
466
  const sourceMapManager = debuggerModel.sourceMapManager();
473
467
  for (const script of debuggerModel.scripts()) {
@@ -0,0 +1,40 @@
1
+ // Copyright 2025 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Common from '../../core/common/common.js';
6
+
7
+ Common.Settings.registerSettingExtension({
8
+ storageType: Common.Settings.SettingStorageType.SYNCED,
9
+ settingName: 'skip-stack-frames-pattern',
10
+ settingType: Common.Settings.SettingType.REGEX,
11
+ defaultValue: '/node_modules/|^node:',
12
+ });
13
+
14
+ Common.Settings.registerSettingExtension({
15
+ storageType: Common.Settings.SettingStorageType.SYNCED,
16
+ settingName: 'skip-content-scripts',
17
+ settingType: Common.Settings.SettingType.BOOLEAN,
18
+ defaultValue: true,
19
+ });
20
+
21
+ Common.Settings.registerSettingExtension({
22
+ storageType: Common.Settings.SettingStorageType.SYNCED,
23
+ settingName: 'automatically-ignore-list-known-third-party-scripts',
24
+ settingType: Common.Settings.SettingType.BOOLEAN,
25
+ defaultValue: true,
26
+ });
27
+
28
+ Common.Settings.registerSettingExtension({
29
+ storageType: Common.Settings.SettingStorageType.SYNCED,
30
+ settingName: 'skip-anonymous-scripts',
31
+ settingType: Common.Settings.SettingType.BOOLEAN,
32
+ defaultValue: false,
33
+ });
34
+
35
+ Common.Settings.registerSettingExtension({
36
+ storageType: Common.Settings.SettingStorageType.SYNCED,
37
+ settingName: 'enable-ignore-listing',
38
+ settingType: Common.Settings.SettingType.BOOLEAN,
39
+ defaultValue: true,
40
+ });
@@ -19,7 +19,7 @@ import type * as Lit from '../../../ui/lit/lit.js';
19
19
  * ```
20
20
  **/
21
21
  export class MarkdownRendererWithCodeBlock extends MarkdownView.MarkdownView.MarkdownInsightRenderer {
22
- override templateForToken(token: Marked.Marked.MarkedToken): Lit.TemplateResult|null {
22
+ override templateForToken(token: Marked.Marked.MarkedToken): Lit.LitTemplate|null {
23
23
  if (token.type === 'code') {
24
24
  const lines = (token.text).split('\n');
25
25
  if (lines[0]?.trim() === 'css') {
@@ -21,7 +21,7 @@ export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBl
21
21
  super();
22
22
  }
23
23
 
24
- override templateForToken(token: Marked.Marked.MarkedToken): Lit.TemplateResult|null {
24
+ override templateForToken(token: Marked.Marked.MarkedToken): Lit.LitTemplate|null {
25
25
  if (token.type === 'link' && token.href.startsWith('#')) {
26
26
  if (token.href.startsWith('#node-')) {
27
27
  const nodeId = Number(token.href.replace('#node-', '')) as Protocol.DOM.BackendNodeId;