chrome-devtools-frontend 1.0.1613625 → 1.0.1614363

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 (61) hide show
  1. package/AUTHORS +1 -0
  2. package/front_end/core/common/MapWithDefault.ts +2 -2
  3. package/front_end/core/common/Object.ts +6 -9
  4. package/front_end/core/common/VersionController.ts +17 -1
  5. package/front_end/core/host/UserMetrics.ts +0 -1
  6. package/front_end/core/root/ExperimentNames.ts +0 -1
  7. package/front_end/core/sdk/OverlayModel.ts +2 -4
  8. package/front_end/core/sdk/sdk-meta.ts +13 -0
  9. package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +4 -0
  10. package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -1
  11. package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -1
  12. package/front_end/entrypoints/main/MainImpl.ts +0 -6
  13. package/front_end/entrypoints/shell/shell.ts +4 -0
  14. package/front_end/entrypoints/trace_app/trace_app.ts +4 -0
  15. package/front_end/generated/InspectorBackendCommands.ts +2 -2
  16. package/front_end/generated/protocol.ts +5 -3
  17. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +10 -2
  18. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +23 -7
  19. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +161 -36
  20. package/front_end/models/javascript_metadata/NativeFunctions.js +673 -639
  21. package/front_end/models/stack_trace/DetailedErrorStackParser.ts +142 -0
  22. package/front_end/models/stack_trace/StackTrace.ts +18 -0
  23. package/front_end/models/stack_trace/StackTraceImpl.ts +96 -4
  24. package/front_end/models/stack_trace/Trie.ts +21 -0
  25. package/front_end/models/stack_trace/stack_trace_impl.ts +2 -0
  26. package/front_end/panels/ai_assistance/components/ChatView.ts +4 -3
  27. package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +4 -1
  28. package/front_end/panels/ai_assistance/components/optInChangeDialog.css +1 -2
  29. package/front_end/panels/application/WebMCPView.ts +249 -17
  30. package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
  31. package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +7 -0
  32. package/front_end/panels/console/ConsoleContextSelector.ts +1 -1
  33. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -3
  34. package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -2
  35. package/front_end/panels/network/RequestConditionsDrawer.ts +4 -2
  36. package/front_end/panels/network/RequestPayloadView.ts +8 -3
  37. package/front_end/panels/network/RequestTimingView.ts +6 -7
  38. package/front_end/panels/performance_monitor/PerformanceMonitor.ts +7 -5
  39. package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
  40. package/front_end/panels/recorder/models/RecordingPlayer.ts +1 -1
  41. package/front_end/services/puppeteer/PuppeteerConnection.ts +1 -1
  42. package/front_end/third_party/chromium/README.chromium +1 -1
  43. package/front_end/third_party/codemirror/codemirror-tsconfig.json +4 -4
  44. package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +1 -1
  45. package/front_end/tsconfig.json +2 -1
  46. package/front_end/ui/kit/icons/Icon.ts +0 -1
  47. package/front_end/ui/legacy/EmptyWidget.ts +2 -2
  48. package/front_end/ui/legacy/Treeoutline.ts +2 -3
  49. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -2
  50. package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +4 -5
  51. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -4
  52. package/front_end/ui/legacy/components/source_frame/XMLView.ts +12 -7
  53. package/front_end/ui/lit/lit.ts +4 -1
  54. package/front_end/ui/lit/render.ts +81 -0
  55. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -1
  56. package/package.json +2 -2
  57. /package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.mjs.d.ts → runmode-standalone.d.mts} +0 -0
  58. /package/front_end/third_party/codemirror/package/mode/css/{css.mjs.d.ts → css.d.mts} +0 -0
  59. /package/front_end/third_party/codemirror/package/mode/javascript/{javascript.mjs.d.ts → javascript.d.mts} +0 -0
  60. /package/front_end/third_party/codemirror/package/mode/xml/{xml.mjs.d.ts → xml.d.mts} +0 -0
  61. /package/front_end/third_party/lighthouse/report-assets/{report-generator.mjs.d.ts → report-generator.d.mts} +0 -0
@@ -8,6 +8,8 @@ import '../../ui/components/node_text/node_text.js';
8
8
  import '../../ui/legacy/components/data_grid/data_grid.js';
9
9
  import '../../ui/legacy/legacy.js';
10
10
 
11
+ import type {JSONSchema7, JSONSchema7Definition} from 'json-schema';
12
+
11
13
  import * as Common from '../../core/common/common.js';
12
14
  import * as i18n from '../../core/i18n/i18n.js';
13
15
  import * as Platform from '../../core/platform/platform.js';
@@ -30,6 +32,7 @@ import {
30
32
  type TemplateResult,
31
33
  } from '../../ui/lit/lit.js';
32
34
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
35
+ import * as ProtocolMonitor from '../protocol_monitor/protocol_monitor.js';
33
36
 
34
37
  import webMCPViewStyles from './webMCPView.css.js';
35
38
 
@@ -130,7 +133,7 @@ const UIStrings = {
130
133
  /**
131
134
  * @description Text for the status of a tool call that succeeded
132
135
  */
133
- success: 'Success',
136
+ completed: 'Completed',
134
137
  /**
135
138
  * @description Text for the status of a tool call that has failed
136
139
  */
@@ -167,7 +170,7 @@ export interface FilterState {
167
170
  declarative?: boolean,
168
171
  };
169
172
  statusTypes?: {
170
- success?: boolean,
173
+ completed?: boolean,
171
174
  error?: boolean,
172
175
  pending?: boolean,
173
176
  };
@@ -202,8 +205,8 @@ export function filterToolCalls(
202
205
  const statusTypes = filterState.statusTypes;
203
206
  if (statusTypes) {
204
207
  filtered = filtered.filter(call => {
205
- const {success, error, pending} = statusTypes;
206
- if (success && call.result?.status === Protocol.WebMCP.InvocationStatus.Success) {
208
+ const {completed, error, pending} = statusTypes;
209
+ if (completed && call.result?.status === Protocol.WebMCP.InvocationStatus.Completed) {
207
210
  return true;
208
211
  }
209
212
  if (error && call.result?.status === Protocol.WebMCP.InvocationStatus.Error) {
@@ -243,33 +246,33 @@ export function filterToolCalls(
243
246
  }
244
247
  export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
245
248
  function calculateToolStats(calls: WebMCP.WebMCPModel.Call[]):
246
- {total: number, success: number, failed: number, canceled: number, inProgress: number} {
247
- let total = 0, success = 0, failed = 0, canceled = 0, inProgress = 0;
249
+ {total: number, completed: number, failed: number, canceled: number, inProgress: number} {
250
+ let total = 0, completed = 0, failed = 0, canceled = 0, inProgress = 0;
248
251
  for (const call of calls) {
249
252
  total++;
250
253
  if (call.result?.status === Protocol.WebMCP.InvocationStatus.Error) {
251
254
  failed++;
252
255
  } else if (call.result?.status === Protocol.WebMCP.InvocationStatus.Canceled) {
253
256
  canceled++;
254
- } else if (call.result?.status === Protocol.WebMCP.InvocationStatus.Success) {
255
- success++;
257
+ } else if (call.result?.status === Protocol.WebMCP.InvocationStatus.Completed) {
258
+ completed++;
256
259
  } else if (call.result === undefined) {
257
260
  inProgress++;
258
261
  }
259
262
  }
260
- return {total, success, failed, canceled, inProgress};
263
+ return {total, completed, failed, canceled, inProgress};
261
264
  }
262
265
 
263
266
  function getIconGroupsFromStats(toolStats: ReturnType<typeof calculateToolStats>):
264
267
  IconButton.IconButton.IconWithTextData[] {
265
268
  const groups = [];
266
- if (toolStats.success > 0) {
269
+ if (toolStats.completed > 0) {
267
270
  groups.push({
268
271
  iconName: 'check-circle',
269
272
  iconColor: 'var(--sys-color-green)',
270
273
  iconWidth: '16px',
271
274
  iconHeight: '16px',
272
- text: String(toolStats.success),
275
+ text: String(toolStats.completed),
273
276
  });
274
277
  }
275
278
  if (toolStats.failed > 0) {
@@ -341,8 +344,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
341
344
  return i18nString(UIStrings.error);
342
345
  case Protocol.WebMCP.InvocationStatus.Canceled:
343
346
  return i18nString(UIStrings.canceled);
344
- case Protocol.WebMCP.InvocationStatus.Success:
345
- return i18nString(UIStrings.success);
347
+ case Protocol.WebMCP.InvocationStatus.Completed:
348
+ return i18nString(UIStrings.completed);
346
349
  default:
347
350
  return i18nString(UIStrings.inProgress);
348
351
  }
@@ -600,19 +603,19 @@ export class WebMCPView extends UI.Widget.VBox {
600
603
  }
601
604
 
602
605
  #showStatusTypesContextMenu(contextMenu: UI.ContextMenu.ContextMenu): void {
603
- const toggle = (key: 'success'|'error'|'pending'): void => {
606
+ const toggle = (key: 'completed'|'error'|'pending'): void => {
604
607
  const current = this.#filterState.statusTypes ?? {};
605
608
  const next = {...current, [key]: !current[key]};
606
609
  let statusTypesToPass: FilterState['statusTypes'] = next;
607
- if (!next.success && !next.error && !next.pending) {
610
+ if (!next.completed && !next.error && !next.pending) {
608
611
  statusTypesToPass = undefined;
609
612
  }
610
613
  this.#handleFilterChange({...this.#filterState, statusTypes: statusTypesToPass});
611
614
  };
612
615
 
613
616
  contextMenu.defaultSection().appendCheckboxItem(
614
- i18nString(UIStrings.success), () => toggle('success'),
615
- {checked: this.#filterState.statusTypes?.['success'] ?? false, jslogContext: 'webmcp.success'});
617
+ i18nString(UIStrings.completed), () => toggle('completed'),
618
+ {checked: this.#filterState.statusTypes?.['completed'] ?? false, jslogContext: 'webmcp.completed'});
616
619
  contextMenu.defaultSection().appendCheckboxItem(
617
620
  i18nString(UIStrings.error), () => toggle('error'),
618
621
  {checked: this.#filterState.statusTypes?.['error'] ?? false, jslogContext: 'webmcp.error'});
@@ -990,3 +993,232 @@ export class ToolDetailsWidget extends UI.Widget.Widget {
990
993
  this.requestUpdate();
991
994
  }
992
995
  }
996
+
997
+ export interface ParsedToolSchema {
998
+ parameters: ProtocolMonitor.JSONEditor.Parameter[];
999
+ typesByName: Map<string, ProtocolMonitor.JSONEditor.Parameter[]>;
1000
+ enumsByName: Map<string, Record<string, string>>;
1001
+ }
1002
+
1003
+ const parsedSchemaCache = new WeakMap<object, ParsedToolSchema>();
1004
+
1005
+ export function parseToolSchema(schema: JSONSchema7): ParsedToolSchema {
1006
+ if (typeof schema === 'object' && schema !== null) {
1007
+ const cached = parsedSchemaCache.get(schema);
1008
+ if (cached) {
1009
+ return cached;
1010
+ }
1011
+ }
1012
+
1013
+ const typesByName = new Map<string, ProtocolMonitor.JSONEditor.Parameter[]>();
1014
+ const enumsByName = new Map<string, Record<string, string>>();
1015
+ const simpleTypesByName = new Map<string, ProtocolMonitor.JSONEditor.ParameterType>();
1016
+ let typeCount = 0;
1017
+
1018
+ function createEnumRecord(values: unknown[]): Record<string, string> {
1019
+ const enumRecord: Record<string, string> = {};
1020
+ for (const val of values) {
1021
+ enumRecord[String(val)] = String(val);
1022
+ }
1023
+ return enumRecord;
1024
+ }
1025
+
1026
+ function preScanDefinition(name: string, def: JSONSchema7Definition): void {
1027
+ if (typeof def === 'boolean') {
1028
+ return;
1029
+ }
1030
+ if (def.type === 'string' && def.enum) {
1031
+ enumsByName.set(name, createEnumRecord(def.enum));
1032
+ } else if (def.type && typeof def.type === 'string' && def.type !== 'object' && def.type !== 'array') {
1033
+ let paramType = ProtocolMonitor.JSONEditor.ParameterType.STRING;
1034
+ switch (def.type) {
1035
+ case 'number':
1036
+ case 'integer':
1037
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.NUMBER;
1038
+ break;
1039
+ case 'boolean':
1040
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.BOOLEAN;
1041
+ break;
1042
+ }
1043
+ simpleTypesByName.set(name, paramType);
1044
+ }
1045
+ }
1046
+
1047
+ function parseDefinition(name: string, def: JSONSchema7Definition): void {
1048
+ if (typeof def === 'boolean') {
1049
+ return;
1050
+ }
1051
+ if (def.type === 'object' && def.properties) {
1052
+ const nestedParams: ProtocolMonitor.JSONEditor.Parameter[] = [];
1053
+ for (const [key, value] of Object.entries(def.properties)) {
1054
+ const isOpt = !(def.required || []).includes(key);
1055
+ nestedParams.push(parseProperty(key, value, isOpt));
1056
+ }
1057
+ typesByName.set(name, nestedParams);
1058
+ }
1059
+ }
1060
+
1061
+ // First pass: populate enums and simple types
1062
+ if (schema.definitions) {
1063
+ for (const [name, def] of Object.entries(schema.definitions)) {
1064
+ preScanDefinition(name, def);
1065
+ }
1066
+ }
1067
+ if (schema.$defs) {
1068
+ for (const [name, def] of Object.entries(schema.$defs)) {
1069
+ preScanDefinition(name, def);
1070
+ }
1071
+ }
1072
+
1073
+ // Second pass: parse objects
1074
+ if (schema.definitions) {
1075
+ for (const [name, def] of Object.entries(schema.definitions)) {
1076
+ parseDefinition(name, def);
1077
+ }
1078
+ }
1079
+ if (schema.$defs) {
1080
+ for (const [name, def] of Object.entries(schema.$defs)) {
1081
+ parseDefinition(name, def);
1082
+ }
1083
+ }
1084
+
1085
+ function parseProperty(
1086
+ name: string, propDef: JSONSchema7Definition, optional: boolean): ProtocolMonitor.JSONEditor.Parameter {
1087
+ if (typeof propDef === 'boolean') {
1088
+ return {
1089
+ name,
1090
+ optional,
1091
+ description: '',
1092
+ type: ProtocolMonitor.JSONEditor.ParameterType.STRING,
1093
+ isCorrectType: true,
1094
+ };
1095
+ }
1096
+ const prop = propDef;
1097
+ if (prop.$ref) {
1098
+ const typeRef = prop.$ref.split('/').pop() || '';
1099
+ let paramType = ProtocolMonitor.JSONEditor.ParameterType.OBJECT;
1100
+ if (enumsByName.has(typeRef)) {
1101
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.STRING;
1102
+ } else {
1103
+ const simpleType = simpleTypesByName.get(typeRef);
1104
+ if (simpleType !== undefined) {
1105
+ paramType = simpleType;
1106
+ }
1107
+ }
1108
+ return {
1109
+ name,
1110
+ optional,
1111
+ description: prop.description || '',
1112
+ type: paramType,
1113
+ typeRef,
1114
+ isCorrectType: true,
1115
+ };
1116
+ }
1117
+
1118
+ const typeStr = Array.isArray(prop.type) ? prop.type[0] : prop.type;
1119
+ let type: string|undefined = typeStr === 'integer' ? 'number' : typeStr;
1120
+ if (!typeStr) {
1121
+ if (prop.properties) {
1122
+ type = 'object';
1123
+ } else if (prop.items) {
1124
+ type = 'array';
1125
+ } else {
1126
+ type = 'unknown';
1127
+ }
1128
+ }
1129
+ const description = prop.description || '';
1130
+
1131
+ let paramType = ProtocolMonitor.JSONEditor.ParameterType.UNKNOWN;
1132
+ switch (type) {
1133
+ case 'string':
1134
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.STRING;
1135
+ break;
1136
+ case 'number':
1137
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.NUMBER;
1138
+ break;
1139
+ case 'boolean':
1140
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.BOOLEAN;
1141
+ break;
1142
+ case 'object':
1143
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.OBJECT;
1144
+ break;
1145
+ case 'array':
1146
+ paramType = ProtocolMonitor.JSONEditor.ParameterType.ARRAY;
1147
+ break;
1148
+ }
1149
+
1150
+ const base: ProtocolMonitor.JSONEditor.Parameter = {
1151
+ name,
1152
+ optional,
1153
+ description,
1154
+ type: paramType,
1155
+ isCorrectType: true,
1156
+ };
1157
+
1158
+ if (type === 'object') {
1159
+ if (prop.properties) {
1160
+ const typeRef = `Object_${++typeCount}`;
1161
+ const nestedParams: ProtocolMonitor.JSONEditor.Parameter[] = [];
1162
+ for (const [key, value] of Object.entries(prop.properties)) {
1163
+ const isOpt = !(prop.required || []).includes(key);
1164
+ nestedParams.push(parseProperty(key, value, isOpt));
1165
+ }
1166
+ typesByName.set(typeRef, nestedParams);
1167
+ base.typeRef = typeRef;
1168
+ } else {
1169
+ base.isKeyEditable = true;
1170
+ }
1171
+ } else if (type === 'array') {
1172
+ const items =
1173
+ prop.items && !Array.isArray(prop.items) && typeof prop.items !== 'boolean' ? prop.items : undefined;
1174
+ if (items) {
1175
+ const itemTypeStr = Array.isArray(items.type) ? items.type[0] : items.type;
1176
+ if (items.$ref) {
1177
+ base.typeRef = items.$ref.split('/').pop() || '';
1178
+ } else if (itemTypeStr === 'object' && items.properties) {
1179
+ const typeRef = `Object_${++typeCount}`;
1180
+ const nestedParams: ProtocolMonitor.JSONEditor.Parameter[] = [];
1181
+ for (const [key, value] of Object.entries(items.properties)) {
1182
+ const isOpt = !(items.required || []).includes(key);
1183
+ nestedParams.push(parseProperty(key, value, isOpt));
1184
+ }
1185
+ typesByName.set(typeRef, nestedParams);
1186
+ base.typeRef = typeRef;
1187
+ } else if (itemTypeStr) {
1188
+ const itemType = itemTypeStr === 'integer' ? 'number' : itemTypeStr;
1189
+ if (itemType === 'string' && items.enum) {
1190
+ const typeRef = `Enum_${++typeCount}`;
1191
+ enumsByName.set(typeRef, createEnumRecord(items.enum));
1192
+ base.typeRef = typeRef;
1193
+ } else {
1194
+ base.typeRef = itemType as string;
1195
+ }
1196
+ } else {
1197
+ base.typeRef = 'string';
1198
+ }
1199
+ } else {
1200
+ base.typeRef = 'string';
1201
+ }
1202
+ } else if (type === 'string' && prop.enum) {
1203
+ const typeRef = `Enum_${++typeCount}`;
1204
+ enumsByName.set(typeRef, createEnumRecord(prop.enum));
1205
+ base.typeRef = typeRef;
1206
+ }
1207
+
1208
+ return base;
1209
+ }
1210
+
1211
+ const parameters: ProtocolMonitor.JSONEditor.Parameter[] = [];
1212
+ if ((schema.type === 'object' || !schema.type) && schema.properties) {
1213
+ for (const [key, value] of Object.entries(schema.properties)) {
1214
+ const isOpt = !(schema.required || []).includes(key);
1215
+ parameters.push(parseProperty(key, value, isOpt));
1216
+ }
1217
+ }
1218
+
1219
+ const result = {parameters, typesByName, enumsByName};
1220
+ if (typeof schema === 'object' && schema !== null) {
1221
+ parsedSchemaCache.set(schema, result);
1222
+ }
1223
+ return result;
1224
+ }
@@ -150,7 +150,7 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
150
150
  </div>
151
151
  ${renderProtocolTest(input.protocolHandler, input.queryInputState, input.protocolSelectHandler,
152
152
  input.queryInputChangeHandler, input.testProtocolClickHandler)}
153
- `, target);
153
+ `, target, {container: {classes: ['vbox']}});
154
154
  // clang-format on
155
155
  };
156
156
 
@@ -172,7 +172,7 @@ export class ProtocolHandlersView extends UI.Widget.Widget {
172
172
  #view: View;
173
173
 
174
174
  constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
175
- super(element, {useShadowDom: false, classes: ['vbox']});
175
+ super(element, {useShadowDom: false});
176
176
  this.#view = view;
177
177
  }
178
178
 
@@ -166,8 +166,15 @@ export const DEFAULT_SUMMARY_TOOLBAR_VIEW: View =
166
166
  role="link"
167
167
  jslog=${VisualLogging.link('open-ai-settings').track({
168
168
  click: true,
169
+ keydown: 'Enter',
169
170
  })}
170
171
  @click=${input.onManageInSettingsTooltipClick}
172
+ @keydown=${(e: KeyboardEvent) => {
173
+ if (e.key === 'Enter') {
174
+ e.consume(true);
175
+ input.onManageInSettingsTooltipClick();
176
+ }
177
+ }}
171
178
  >${lockedString(UIStringsNotTranslate.manageInSettings)}</span></div></devtools-tooltip>
172
179
  </div>
173
180
  `, target);
@@ -303,7 +303,7 @@ interface ViewInput {
303
303
  type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
304
304
 
305
305
  const DEFAULT_VIEW: View = (input, _output, target): void => {
306
- if (!input.title || !input.subtitle) {
306
+ if (!input.title) {
307
307
  render(nothing, target);
308
308
  return;
309
309
  }
@@ -8,7 +8,6 @@ import '../../ui/kit/kit.js';
8
8
  import * as Common from '../../core/common/common.js';
9
9
  import * as i18n from '../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../core/platform/platform.js';
11
- import * as Root from '../../core/root/root.js';
12
11
  import * as SDK from '../../core/sdk/sdk.js';
13
12
  import type * as Protocol from '../../generated/protocol.js';
14
13
  import * as Geometry from '../../models/geometry/geometry.js';
@@ -483,7 +482,7 @@ function renderContrastIssue(key: string, issues: ContrastIssue[]): TemplateResu
483
482
  const color = (minContrastIssue.textColor.asString(Common.Color.Format.HEXA));
484
483
  const backgroundColor = (minContrastIssue.backgroundColor.asString(Common.Color.Format.HEXA));
485
484
 
486
- const showAPCA = Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA);
485
+ const showAPCA = Common.Settings.Settings.instance().moduleSetting('apca').get();
487
486
 
488
487
  const title = i18nString(UIStrings.textColorSOverSBackgroundResults, {
489
488
  PH1: color,
@@ -1041,7 +1040,7 @@ function renderContrastRatio(data: PopulateNodesEventNodeTypes): TemplateResult
1041
1040
  if (!('contrastRatio' in data)) {
1042
1041
  throw new Error('Contrast ratio entry is missing a contrast ratio.');
1043
1042
  }
1044
- const showAPCA = Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA);
1043
+ const showAPCA = Common.Settings.Settings.instance().moduleSetting('apca').get();
1045
1044
  const contrastRatio = Platform.NumberUtilities.floor(data.contrastRatio, 2);
1046
1045
  const contrastRatioString = showAPCA ? contrastRatio + '%' : contrastRatio;
1047
1046
  const border = getBorderString(data.backgroundColor);
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
- import * as Root from '../../core/root/root.js';
7
6
  import * as SDK from '../../core/sdk/sdk.js';
8
7
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
9
8
  import type * as Protocol from '../../generated/protocol.js';
@@ -267,7 +266,7 @@ export class CSSOverviewModel extends SDK.SDKModel.SDKModel<void> {
267
266
  const formattedTextColor = formatColor(blendedTextColor);
268
267
  const formattedBackgroundColor = formatColor(blendedBackgroundColor.asLegacyColor());
269
268
  const key = `${formattedTextColor}_${formattedBackgroundColor}`;
270
- if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA)) {
269
+ if (Common.Settings.Settings.instance().moduleSetting('apca').get()) {
271
270
  const contrastRatio = contrastInfo.contrastRatioAPCA();
272
271
  const threshold = contrastInfo.contrastRatioAPCAThreshold();
273
272
  const passes = contrastRatio && threshold ? Math.abs(contrastRatio) >= threshold : false;
@@ -291,7 +291,9 @@ interface AffectedCountViewInput {
291
291
  }
292
292
  type AffectedCountView = (input: AffectedCountViewInput, output: object, target: HTMLElement) => void;
293
293
  export const AFFECTED_COUNT_DEFAULT_VIEW: AffectedCountView = (input, output, target) => {
294
- render(html`${i18nString(UIStrings.dAffected, {PH1: input.count})}`, target);
294
+ render(
295
+ html`${i18nString(UIStrings.dAffected, {PH1: input.count})}`, target,
296
+ {container: {classes: ['blocked-url-count']}});
295
297
  };
296
298
 
297
299
  function matchesUrl(conditions: SDK.NetworkManager.RequestCondition, url: string): boolean {
@@ -304,7 +306,7 @@ export class AffectedCountWidget extends UI.Widget.Widget {
304
306
  #lookUpRequestCount?: (condition: SDK.NetworkManager.RequestCondition) => number;
305
307
 
306
308
  constructor(target?: HTMLElement, view = AFFECTED_COUNT_DEFAULT_VIEW) {
307
- super(target, {classes: ['blocked-url-count']});
309
+ super(target);
308
310
  this.#view = view;
309
311
  }
310
312
 
@@ -289,8 +289,13 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
289
289
  </ul>
290
290
  </li>
291
291
  </ul>
292
- `}></devtools-tree>
293
- `, target);
292
+ `}></devtools-tree>`, target, {
293
+ container: {
294
+ classes: ['request-payload-view'],
295
+ attributes: {
296
+ jslog: `${VisualLogging.pane('payload').track({resize: true})}`,
297
+ },
298
+ }});
294
299
  // clang-format on
295
300
  };
296
301
 
@@ -305,7 +310,7 @@ export class RequestPayloadView extends UI.Widget.VBox {
305
310
  #viewQueryParamSource = false;
306
311
 
307
312
  constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
308
- super({jslog: `${VisualLogging.pane('payload').track({resize: true})}`, classes: ['request-payload-view']});
313
+ super();
309
314
  this.#view = view;
310
315
  }
311
316
 
@@ -407,9 +407,9 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
407
407
  }
408
408
  }
409
409
 
410
- render(
411
- // clang-format off
412
- html`<style>${networkingTimingTableStyles}</style>
410
+ // clang-format off
411
+ render(html`
412
+ <style>${networkingTimingTableStyles}</style>
413
413
  <table
414
414
  class=${classes}
415
415
  jslog=${VisualLogging.pane('timing').track({
@@ -532,9 +532,8 @@ ${uiI18n.getFormatLocalizedStringTemplate(str_, UIStrings.duringDevelopmentYouCa
532
532
  html`<devtools-link href="https://web.dev/custom-metrics/#server-timing-api" .jslogContext=${'server-timing-api'}>${i18nString(UIStrings.theServerTimingApi)}</devtools-link>`})}
533
533
  </td>
534
534
  </tr>` : nothing}
535
- </table>`,
536
- // clang-format on
537
- target);
535
+ </table>`, target, {container: {classes: ['resource-timing-view']}});
536
+ // clang-format on
538
537
  };
539
538
 
540
539
  export class RequestTimingView extends UI.Widget.VBox {
@@ -543,7 +542,7 @@ export class RequestTimingView extends UI.Widget.VBox {
543
542
  #lastMinimumBoundary = -1;
544
543
  readonly #view: View;
545
544
  constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
546
- super(target, {classes: ['resource-timing-view']});
545
+ super(target);
547
546
  this.#view = view;
548
547
  }
549
548
 
@@ -626,8 +626,9 @@ interface ControlPaneInput {
626
626
  type ControlPaneView = (input: ControlPaneInput, output: object, target: HTMLElement) => void;
627
627
 
628
628
  const CONTROL_PANE_DEFAULT_VIEW: ControlPaneView = (input, _output, target) => {
629
- render(
630
- input.chartsInfo.map(chartInfo => {
629
+ // clang-format off
630
+ render(html`
631
+ ${input.chartsInfo.map(chartInfo => {
631
632
  const chartName = chartInfo.metrics[0].name;
632
633
  const active = input.enabledCharts.has(chartName);
633
634
  const value = input.metricValues.get(chartName) || 0;
@@ -637,8 +638,9 @@ const CONTROL_PANE_DEFAULT_VIEW: ControlPaneView = (input, _output, target) => {
637
638
  value,
638
639
  (e: Event) => input.onCheckboxChange(chartName, e),
639
640
  );
640
- }),
641
- target);
641
+ })}
642
+ `, target, {container: {classes: ['perfmon-control-pane']}});
643
+ // clang-format on
642
644
  };
643
645
 
644
646
  export class ControlPane extends UI.Widget.VBox {
@@ -651,7 +653,7 @@ export class ControlPane extends UI.Widget.VBox {
651
653
  readonly #view: ControlPaneView;
652
654
 
653
655
  constructor(element: HTMLElement, view = CONTROL_PANE_DEFAULT_VIEW) {
654
- super(element, {useShadowDom: false, classes: ['perfmon-control-pane']});
656
+ super(element, {useShadowDom: false});
655
657
  this.#view = view;
656
658
 
657
659
  this.#enabledChartsSetting = Common.Settings.Settings.instance().createSetting(
@@ -410,7 +410,7 @@ export class JSONEditor extends Common.ObjectWrapper.eventMixin<EventTypes, type
410
410
  typeRef: schema?.typeRef,
411
411
  value,
412
412
  description,
413
- } as unknown as Parameter;
413
+ } as Parameter;
414
414
  }
415
415
 
416
416
  #convertPrimitiveParameter(key: string, value: unknown, schema?: Parameter): Parameter {
@@ -133,7 +133,7 @@ export class RecordingPlayer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
133
133
  throw new Error('could not find main page!');
134
134
  }
135
135
 
136
- browser.on('targetdiscovered', (targetInfo: ReturnType<puppeteer.Target['_getTargetInfo']>) => {
136
+ browser.on('targetdiscovered', (targetInfo: Protocol.Target.TargetInfo) => {
137
137
  // Pop-ups opened by the main target won't be auto-attached. Therefore,
138
138
  // we need to create a session for them explicitly. We user openedId
139
139
  // and type to classify a target as requiring a session.
@@ -91,7 +91,7 @@ export class PuppeteerConnectionHelper {
91
91
  undefined /* process */,
92
92
  undefined /* closeCallback */,
93
93
  undefined /* targetFilterCallback */,
94
- target => isPageTargetCallback((target as puppeteer.Target)._getTargetInfo() as Protocol.Target.TargetInfo),
94
+ target => isPageTargetCallback((target as puppeteer.Target)._getTargetInfo()),
95
95
  false /* waitForInitiallyDiscoveredTargets */,
96
96
  );
97
97
 
@@ -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: a287ca9049cc3727d680078c1d9275b32f721c2d
4
+ Revision: aa779a3f59f2eda5d9befe0632bc75c1a05fe8dd
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -4,12 +4,12 @@
4
4
  },
5
5
  "files": [
6
6
  "package/addon/runmode/runmode-standalone.mjs",
7
- "package/addon/runmode/runmode-standalone.mjs.d.ts",
7
+ "package/addon/runmode/runmode-standalone.d.mts",
8
8
  "package/mode/css/css.mjs",
9
- "package/mode/css/css.mjs.d.ts",
9
+ "package/mode/css/css.d.mts",
10
10
  "package/mode/javascript/javascript.mjs",
11
- "package/mode/javascript/javascript.mjs.d.ts",
11
+ "package/mode/javascript/javascript.d.mts",
12
12
  "package/mode/xml/xml.mjs",
13
- "package/mode/xml/xml.mjs.d.ts"
13
+ "package/mode/xml/xml.d.mts"
14
14
  ]
15
15
  }
@@ -5,7 +5,7 @@
5
5
  "files": [
6
6
  "report-assets/report.js",
7
7
  "report-assets/report-generator.mjs",
8
- "report-assets/report-generator.mjs.d.ts",
8
+ "report-assets/report-generator.d.mts",
9
9
  "lighthouse-dt-bundle.js"
10
10
  ]
11
11
  }
@@ -27,7 +27,8 @@
27
27
  "no-unclosed-tag": "error"
28
28
  }
29
29
  }
30
- ]
30
+ ],
31
+ "types": ["chai", "mocha", "sinon", "karma-chai-sinon"]
31
32
  },
32
33
  "exclude": ["devtools_compatibility.js"],
33
34
  "references": [{ "path": "./tsconfig.compatibility.json" }]
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
  /* eslint-disable @devtools/no-imperative-dom-api */
5
5
 
6
- // @ts-expect-error tsc 6 can't find type declarations for this file.
7
6
  import '../../../Images/Images.js';
8
7
 
9
8
  import iconStyles from './icon.css.js';
@@ -49,7 +49,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
49
49
  ${input.link ? html`<devtools-link href=${input.link} jslogContext=${'learn-more'}>${i18nString(UIStrings.learnMore)}</devtools-link>` : ''}
50
50
  </div>
51
51
  ${input.extraElements}
52
- </div>`, target);
52
+ </div>`, target, {container: {classes: ['empty-view-scroller']}});
53
53
  // clang-format on
54
54
  };
55
55
 
@@ -66,7 +66,7 @@ export class EmptyWidget extends VBox {
66
66
  if (!element && headerOrElement instanceof HTMLElement) {
67
67
  element = headerOrElement;
68
68
  }
69
- super(element, {classes: ['empty-view-scroller']});
69
+ super(element);
70
70
  this.#header = header;
71
71
  this.#text = text;
72
72
  this.#link = undefined;