chrome-devtools-frontend 1.0.1601661 → 1.0.1602348

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 (60) hide show
  1. package/.agents/skills/version-control/SKILL.md +71 -0
  2. package/front_end/core/host/InspectorFrontendHostStub.ts +0 -5
  3. package/front_end/core/root/Runtime.ts +0 -8
  4. package/front_end/core/sdk/DOMModel.ts +5 -4
  5. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
  6. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -1
  7. package/front_end/generated/InspectorBackendCommands.ts +6 -5
  8. package/front_end/generated/protocol.ts +36 -3
  9. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +167 -9
  10. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  11. package/front_end/models/live-metrics/LiveMetrics.ts +51 -31
  12. package/front_end/panels/accessibility/ARIAAttributesView.ts +2 -2
  13. package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
  14. package/front_end/panels/ai_assistance/components/ChatMessage.ts +15 -19
  15. package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -4
  16. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -1
  17. package/front_end/panels/console_counters/WarningErrorCounter.ts +7 -14
  18. package/front_end/panels/elements/NodeStackTraceWidget.ts +2 -1
  19. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
  20. package/front_end/panels/network/RequestPayloadView.ts +2 -2
  21. package/front_end/panels/recorder/RecorderController.ts +4 -3
  22. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -1
  23. package/front_end/panels/recorder/components/RecordingView.ts +2 -2
  24. package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -0
  25. package/front_end/panels/security/SecurityPanel.ts +3 -3
  26. package/front_end/panels/sensors/SensorsView.ts +131 -88
  27. package/front_end/panels/timeline/TimelineDetailsView.ts +6 -37
  28. package/front_end/panels/timeline/TimelineUIUtils.ts +0 -118
  29. package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
  30. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -2
  31. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +162 -9
  32. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -8
  33. package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -10
  34. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  35. package/front_end/third_party/chromium/README.chromium +1 -1
  36. package/front_end/third_party/puppeteer/README.chromium +2 -2
  37. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  38. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +4 -0
  39. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  40. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  41. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  42. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  43. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  44. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  45. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +3 -3
  46. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  47. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +4 -0
  48. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  49. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  50. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  51. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  52. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  53. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  54. package/front_end/third_party/puppeteer/package/package.json +1 -1
  55. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +8 -0
  56. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  57. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  58. package/front_end/ui/legacy/Toolbar.ts +25 -3
  59. package/front_end/ui/legacy/Widget.ts +35 -40
  60. package/package.json +1 -1
@@ -62,29 +62,7 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
62
62
 
63
63
  private constructor() {
64
64
  super();
65
- const targetManager = SDK.TargetManager.TargetManager.instance();
66
- targetManager.observeTargets(this, {scoped: true});
67
- // Listen for target info changes to detect prerender activation.
68
- // Scoped observers don't receive events when a prerendered target becomes
69
- // primary because setScopeTarget() isn't called during that transition.
70
- targetManager.addEventListener(
71
- SDK.TargetManager.Events.AVAILABLE_TARGETS_CHANGED, this.#onAvailableTargetsChanged, this);
72
- }
73
-
74
- #onAvailableTargetsChanged(): void {
75
- const primaryTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
76
- if (primaryTarget && primaryTarget !== this.#target) {
77
- // Primary target changed (e.g., prerender activation). Switch to it.
78
- void this.#switchToTarget(primaryTarget);
79
- }
80
- }
81
-
82
- async #switchToTarget(newTarget: SDK.Target.Target): Promise<void> {
83
- if (this.#target) {
84
- await this.disable();
85
- }
86
- this.#target = newTarget;
87
- await this.enable();
65
+ SDK.TargetManager.TargetManager.instance().observeTargets(this);
88
66
  }
89
67
 
90
68
  static instance(opts: {forceNew?: boolean} = {forceNew: false}): LiveMetrics {
@@ -393,6 +371,31 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
393
371
  this.#sendStatusUpdate();
394
372
  }
395
373
 
374
+ async #getFrameForExecutionContextId(executionContextId: Protocol.Runtime.ExecutionContextId):
375
+ Promise<SDK.ResourceTreeModel.ResourceTreeFrame|null> {
376
+ if (!this.#target) {
377
+ return null;
378
+ }
379
+
380
+ const runtimeModel = this.#target.model(SDK.RuntimeModel.RuntimeModel);
381
+ if (!runtimeModel) {
382
+ return null;
383
+ }
384
+
385
+ const executionContext = runtimeModel.executionContext(executionContextId);
386
+ if (!executionContext) {
387
+ return null;
388
+ }
389
+
390
+ const frameId = executionContext.frameId;
391
+ if (!frameId) {
392
+ return null;
393
+ }
394
+
395
+ const frameManager = SDK.FrameManager.FrameManager.instance();
396
+ return await frameManager.getOrWaitForFrame(frameId);
397
+ }
398
+
396
399
  async #onBindingCalled(event: {data: Protocol.Runtime.BindingCalledEvent}): Promise<void> {
397
400
  const {data} = event;
398
401
  if (data.name !== Spec.EVENT_BINDING_NAME) {
@@ -404,8 +407,22 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
404
407
  await this.#mutex.run(async () => {
405
408
  const webVitalsEvent = JSON.parse(data.payload) as Spec.WebVitalsEvent;
406
409
 
407
- // Track the execution context from 'reset' events for logInteractionScripts().
408
- if (webVitalsEvent.name === 'reset') {
410
+ // This ensures that `#lastResetContextId` will always be an execution context on the
411
+ // primary frame. If we receive events from this execution context then we automatically
412
+ // know that they are for the primary frame.
413
+ if (this.#lastResetContextId !== data.executionContextId) {
414
+ if (webVitalsEvent.name !== 'reset') {
415
+ return;
416
+ }
417
+
418
+ // We should avoid calling this function for every event.
419
+ // If an interaction triggers a pre-rendered navigation then the old primary frame could
420
+ // be removed before we reach this point, and then it will hang forever.
421
+ const frame = await this.#getFrameForExecutionContextId(data.executionContextId);
422
+ if (!frame?.isPrimaryFrame()) {
423
+ return;
424
+ }
425
+
409
426
  this.#lastResetContextId = data.executionContextId;
410
427
  }
411
428
 
@@ -447,7 +464,6 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
447
464
  }
448
465
 
449
466
  async targetAdded(target: SDK.Target.Target): Promise<void> {
450
- // Scoped observers can also receive events for OOPIFs and workers.
451
467
  if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {
452
468
  return;
453
469
  }
@@ -456,12 +472,20 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
456
472
  }
457
473
 
458
474
  async targetRemoved(target: SDK.Target.Target): Promise<void> {
459
- // Scoped observers can also receive events for OOPIFs and workers.
460
475
  if (target !== this.#target) {
461
476
  return;
462
477
  }
463
478
  await this.disable();
464
479
  this.#target = undefined;
480
+
481
+ // If the user navigates to a page that was pre-rendered then the primary page target
482
+ // will be swapped and the old target will be removed. We should ensure live metrics
483
+ // remain enabled on the new primary page target.
484
+ const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
485
+ if (primaryPageTarget) {
486
+ this.#target = primaryPageTarget;
487
+ await this.enable();
488
+ }
465
489
  }
466
490
 
467
491
  async enable(): Promise<void> {
@@ -531,10 +555,6 @@ export class LiveMetrics extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
531
555
  return;
532
556
  }
533
557
 
534
- // Reset to ensure clean state when re-enabling on a new target.
535
- // See crbug.com/478832430.
536
- this.#lastResetContextId = undefined;
537
-
538
558
  await this.#killAllLiveMetricContexts();
539
559
 
540
560
  const runtimeModel = this.#target.model(SDK.RuntimeModel.RuntimeModel);
@@ -26,6 +26,7 @@ const UIStrings = {
26
26
  const str_ = i18n.i18n.registerUIStrings('panels/accessibility/ARIAAttributesView.ts', UIStrings);
27
27
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
28
28
  const {render, html} = Lit;
29
+ const {widget} = UI.Widget;
29
30
 
30
31
  interface ViewInput {
31
32
  propertyCompletions: Map<SDK.DOMModel.Attribute, string[]>;
@@ -62,8 +63,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
62
63
  html`
63
64
  <style>${accessibilityPropertiesStyles}</style>
64
65
  <devtools-widget
65
- .widgetConfig=${UI.Widget.widgetConfig(UI.EmptyWidget.EmptyWidget,
66
- {text: i18nString(UIStrings.noAriaAttributes)})}
66
+ ${widget(UI.EmptyWidget.EmptyWidget, {text: i18nString(UIStrings.noAriaAttributes)})}
67
67
  class="gray-info-message info-message-overflow"></devtools-widget>` :
68
68
  html`<devtools-tree
69
69
  hide-overflow
@@ -22,6 +22,7 @@ import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
22
22
  import chatInputStyles from './chatInput.css.js';
23
23
 
24
24
  const {html, Directives: {createRef, ref}} = Lit;
25
+ const {widget} = UI.Widget;
25
26
 
26
27
  const UIStrings = {
27
28
  /**
@@ -332,7 +333,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
332
333
  html`
333
334
  <devtools-widget
334
335
  class="title"
335
- .widgetConfig=${UI.Widget.widgetConfig(PanelsCommon.DOMLinkifier.DOMNodeLink, {
336
+ ${widget(PanelsCommon.DOMLinkifier.DOMNodeLink, {
336
337
  node: input.context.getItem(),
337
338
  options: {
338
339
  disabled: !input.isContextSelected,
@@ -352,7 +353,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
352
353
  input.context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext ?
353
354
  html`<devtools-icon class="icon" name="performance" title="Performance"></devtools-icon>` :
354
355
  Lit.nothing}
355
- <span
356
+ <span
356
357
  role="button"
357
358
  class="title"
358
359
  tabindex="0"
@@ -736,15 +736,13 @@ async function makeLcpBreakdownWidget(widgetData: LcpBreakdownAiWidget): Promise
736
736
  return null;
737
737
  }
738
738
 
739
- const widgetConfig = UI.Widget.widgetConfig(TimelineInsights.LCPBreakdown.LCPBreakdown, {
740
- model: insight,
741
- minimal: true,
742
- });
743
-
744
739
  // clang-format off
745
740
  const renderedWidget = html`<devtools-widget
746
741
  class="lcp-breakdown-widget"
747
- .widgetConfig=${widgetConfig}></devtools-widget>`;
742
+ ${widget(TimelineInsights.LCPBreakdown.LCPBreakdown, {
743
+ model: insight,
744
+ minimal: true,
745
+ })}></devtools-widget>`;
748
746
  // clang-format on
749
747
 
750
748
  return {renderedWidget, revealable: new TimelineUtils.Helpers.RevealableInsight(insight)};
@@ -826,24 +824,22 @@ async function makeDomTreeWidget(widgetData: DomTreeAiWidget): Promise<WidgetMak
826
824
  return null;
827
825
  }
828
826
 
829
- const widgetConfig = UI.Widget.widgetConfig(Elements.ElementsTreeOutline.DOMTreeWidget, {
830
- maxTreeDepth: 2,
831
- enableContextMenu: false,
832
- showComments: false,
833
- showAIButton: false,
834
- disableEdits: true,
835
- expandRoot: true,
836
- rootDOMNode: root,
837
- visibleWidth: 400,
838
- wrap: true,
839
- });
840
-
841
827
  const networkRequest = widgetData.data.networkRequest;
842
828
 
843
829
  // clang-format off
844
830
  const renderedWidget = html`
845
831
  ${networkRequest ? renderNetworkRequestPreview(networkRequest) : Lit.nothing}
846
- <devtools-widget class="dom-tree-widget" .widgetConfig=${widgetConfig}></devtools-widget>
832
+ <devtools-widget class="dom-tree-widget" ${widget(Elements.ElementsTreeOutline.DOMTreeWidget, {
833
+ maxTreeDepth: 2,
834
+ enableContextMenu: false,
835
+ showComments: false,
836
+ showAIButton: false,
837
+ disableEdits: true,
838
+ expandRoot: true,
839
+ rootDOMNode: root,
840
+ visibleWidth: 400,
841
+ wrap: true,
842
+ })}></devtools-widget>
847
843
  `;
848
844
  // clang-format on
849
845
 
@@ -40,7 +40,7 @@ import {StorageItemsToolbar} from './StorageItemsToolbar.js';
40
40
 
41
41
  const {ARIAUtils} = UI;
42
42
  const {EmptyWidget} = UI.EmptyWidget;
43
- const {VBox, widgetConfig} = UI.Widget;
43
+ const {VBox, widget} = UI.Widget;
44
44
  const {Size} = Geometry;
45
45
  const {repeat} = LitDirectives;
46
46
 
@@ -118,14 +118,14 @@ export abstract class KeyValueStorageItemsView extends UI.Widget.VBox {
118
118
  // clang-format off
119
119
  render(html `
120
120
  <devtools-widget
121
- .widgetConfig=${widgetConfig(StorageItemsToolbar, {metadataView})}
121
+ ${widget(StorageItemsToolbar, {metadataView})}
122
122
  class=flex-none
123
123
  ${UI.Widget.widgetRef(StorageItemsToolbar, view => {output.toolbar = view;})}
124
124
  ></devtools-widget>
125
125
  <devtools-split-view sidebar-position="second" name="${id}-split-view-state">
126
126
  <devtools-widget
127
127
  slot="main"
128
- .widgetConfig=${widgetConfig(VBox, {minimumSize: new Size(0, 50)})}>
128
+ ${widget(VBox, {minimumSize: new Size(0, 50)})}>
129
129
  <devtools-data-grid
130
130
  .name=${`${id}-datagrid-with-preview`}
131
131
  striped
@@ -160,7 +160,7 @@ export abstract class KeyValueStorageItemsView extends UI.Widget.VBox {
160
160
  </devtools-widget>
161
161
  <devtools-widget
162
162
  slot="sidebar"
163
- .widgetConfig=${widgetConfig(VBox, {minimumSize: new Size(0, 50)})}
163
+ ${widget(VBox, {minimumSize: new Size(0, 50)})}
164
164
  jslog=${VisualLogging.pane('preview').track({resize: true})}>
165
165
  ${input.preview?.element}
166
166
  </devtools-widget>
@@ -27,6 +27,7 @@ const UIStringsNotTranslate = {
27
27
  } as const;
28
28
 
29
29
  const lockedString = i18n.i18n.lockedString;
30
+ const {widget} = UI.Widget;
30
31
 
31
32
  export interface AiCodeCompletionSummaryToolbarProps {
32
33
  citationsTooltipId: string;
@@ -64,7 +65,7 @@ export const DEFAULT_SUMMARY_TOOLBAR_VIEW: View = (input, _output, target) => {
64
65
  // clang-format off
65
66
  const disclaimer = input.disclaimerTooltipId && input.spinnerTooltipId ?
66
67
  html`<devtools-widget
67
- .widgetConfig=${UI.Widget.widgetConfig(AiCodeCompletionDisclaimer, {
68
+ ${widget(AiCodeCompletionDisclaimer, {
68
69
  disclaimerTooltipId: input.disclaimerTooltipId,
69
70
  spinnerTooltipId: input.spinnerTooltipId,
70
71
  loading: input.loading,
@@ -72,14 +72,8 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
72
72
  accessibleName: consoleTitle,
73
73
  compact,
74
74
  groups: [
75
- {
76
- iconName: 'cross-circle-filled',
77
- text: countToText(errors)
78
- },
79
- {
80
- iconName: 'warning-filled',
81
- text: countToText(warnings)
82
- },
75
+ {iconName: 'cross-circle-filled', text: countToText(errors)},
76
+ {iconName: 'warning-filled', text: countToText(warnings)},
83
77
  ],
84
78
  };
85
79
 
@@ -201,12 +195,11 @@ export class WarningErrorCounter implements UI.Toolbar.Provider {
201
195
  document.createElement('devtools-widget') as UI.Widget.WidgetElement<WarningErrorCounterWidget>;
202
196
  const toolbarItem = new UI.Toolbar.ToolbarItemWithCompactLayout(widgetElement);
203
197
  toolbarItem.setVisible(false);
204
- widgetElement.widgetConfig = UI.Widget.widgetConfig(e => {
205
- const widget = new WarningErrorCounterWidget(e, toolbarItem.setVisible.bind(toolbarItem));
206
- toolbarItem.addEventListener(
207
- UI.Toolbar.ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED, widget.onSetCompactLayout, widget);
208
- return widget;
209
- });
198
+
199
+ const widget = new WarningErrorCounterWidget(widgetElement, toolbarItem.setVisible.bind(toolbarItem));
200
+ toolbarItem.addEventListener(
201
+ UI.Toolbar.ToolbarItemWithCompactLayoutEvents.COMPACT_LAYOUT_UPDATED, widget.onSetCompactLayout, widget);
202
+
210
203
  this.toolbarItem = toolbarItem;
211
204
  }
212
205
 
@@ -20,6 +20,7 @@ const UIStrings = {
20
20
  } as const;
21
21
  const str_ = i18n.i18n.registerUIStrings('panels/elements/NodeStackTraceWidget.ts', UIStrings);
22
22
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
+ const {widget} = UI.Widget;
23
24
 
24
25
  interface ViewInput {
25
26
  stackTrace?: StackTrace.StackTrace.StackTrace;
@@ -35,7 +36,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
35
36
  ${target && stackTrace ?
36
37
  html`<devtools-widget
37
38
  class="stack-trace"
38
- .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {stackTrace})}>
39
+ ${widget(Components.JSPresentationUtils.StackTracePreviewContent, {stackTrace})}>
39
40
  </devtools-widget>` :
40
41
  html`<div class="gray-info-message">${i18nString(UIStrings.noStackTraceAvailable)}</div>`}`,
41
42
  target);
@@ -55,6 +55,7 @@ const ASTUtils = SDK.CSSPropertyParser.ASTUtils;
55
55
  const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
56
56
  const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
57
57
  const GridLanesEditor = ElementsComponents.StylePropertyEditor.GridLanesEditor;
58
+ const {widget} = UI.Widget;
58
59
 
59
60
  const UIStrings = {
60
61
  /**
@@ -2688,7 +2689,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2688
2689
  e.consume(true);
2689
2690
  }
2690
2691
  }}
2691
- .widgetConfig=${UI.Widget.widgetConfig(CSSValueTraceView)}>
2692
+ ${widget(CSSValueTraceView)}>
2692
2693
  </devtools-widget>
2693
2694
  </devtools-tooltip>`;
2694
2695
  // clang-format on
@@ -51,7 +51,7 @@ import requestPayloadViewStyles from './requestPayloadView.css.js';
51
51
  import {ShowMoreDetailsWidget} from './ShowMoreDetailsWidget.js';
52
52
 
53
53
  const {classMap} = Directives;
54
- const {widgetConfig} = UI.Widget;
54
+ const {widget} = UI.Widget;
55
55
  const {ifExpanded} = UI.TreeOutline;
56
56
  const UIStrings = {
57
57
  /**
@@ -146,7 +146,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
146
146
 
147
147
  const createSourceText = (text: string): TemplateResult => html`<li role=treeitem
148
148
  @contextmenu=${copyValueContextmenu(i18nString(UIStrings.copyPayload), () => text, 'copy-payload')}>
149
- <devtools-widget class='payload-value source-code' .widgetConfig=${widgetConfig(ShowMoreDetailsWidget, {text})}>
149
+ <devtools-widget class='payload-value source-code' ${widget(ShowMoreDetailsWidget, {text})}>
150
150
  </devtools-widget>
151
151
  </li>`;
152
152
 
@@ -151,6 +151,7 @@ const UIStrings = {
151
151
  } as const;
152
152
  const str_ = i18n.i18n.registerUIStrings('panels/recorder/RecorderController.ts', UIStrings);
153
153
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
154
+ const {widget} = UI.Widget;
154
155
 
155
156
  const GET_EXTENSIONS_MENU_ITEM = 'get-extensions-link';
156
157
  const GET_EXTENSIONS_URL = 'https://goo.gle/recorder-extension-list' as Platform.DevToolsPath.UrlString;
@@ -1203,7 +1204,7 @@ export class RecorderController extends LitElement {
1203
1204
  // clang-format off
1204
1205
  return html`
1205
1206
  <devtools-widget
1206
- .widgetConfig=${UI.Widget.widgetConfig(Components.RecordingListView.RecordingListView, {
1207
+ ${widget(Components.RecordingListView.RecordingListView, {
1207
1208
  recordings: recordings.map(recording => ({
1208
1209
  storageName: recording.storageName,
1209
1210
  name: recording.flow.title,
@@ -1244,7 +1245,7 @@ export class RecorderController extends LitElement {
1244
1245
  return html`
1245
1246
  <devtools-widget
1246
1247
  class="recording-view"
1247
- .widgetConfig=${UI.Widget.widgetConfig(Components.RecordingView.RecordingView, {
1248
+ ${widget(Components.RecordingView.RecordingView, {
1248
1249
  recording: this.currentRecording?.flow ?? {title: '', steps: []},
1249
1250
  replayState: this.#replayState,
1250
1251
  isRecording: this.isRecording,
@@ -1291,7 +1292,7 @@ export class RecorderController extends LitElement {
1291
1292
  return html`
1292
1293
  <devtools-widget
1293
1294
  class="recording-view"
1294
- .widgetConfig=${UI.Widget.widgetConfig(Components.CreateRecordingView.CreateRecordingView, {
1295
+ ${widget(Components.CreateRecordingView.CreateRecordingView, {
1295
1296
  recorderSettings: this.#recorderSettings,
1296
1297
  onRecordingStarted: this.#onRecordingStarted.bind(this),
1297
1298
  onRecordingCancelled: this.onRecordingCancelled.bind(this),
@@ -101,6 +101,7 @@ const str_ = i18n.i18n.registerUIStrings(
101
101
  UIStrings,
102
102
  );
103
103
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
104
+ const {widget} = UI.Widget;
104
105
 
105
106
  export interface ViewInput {
106
107
  name: string;
@@ -269,7 +270,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
269
270
  <div class="controls">
270
271
  <devtools-widget
271
272
  class="control-button"
272
- .widgetConfig=${UI.Widget.widgetConfig(ControlButton, {
273
+ ${widget(ControlButton, {
273
274
  label: i18nString(UIStrings.startRecording),
274
275
  shape: 'circle',
275
276
  onClick: onRecordingStarted,
@@ -597,7 +597,7 @@ function renderSections(input: ViewInput): Lit.LitTemplate {
597
597
  return html`
598
598
  <devtools-widget
599
599
  @copystep=${input.onCopyStep}
600
- .widgetConfig=${UI.Widget.widgetConfig(StepView, {
600
+ ${widget(StepView, {
601
601
  step,
602
602
  state: input.getStepState(step),
603
603
  error: input.currentStep === step ? (input.currentError ?? undefined) : undefined,
@@ -812,7 +812,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
812
812
  <div class="controls">
813
813
  <devtools-widget
814
814
  class="control-button"
815
- .widgetConfig=${UI.Widget.widgetConfig(ControlButton, {
815
+ ${widget(ControlButton, {
816
816
  label: footerButtonTitle,
817
817
  shape: 'square',
818
818
  disabled: input.recordingTogglingInProgress,
@@ -2,6 +2,9 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ // Clang-formatter and EsLint have a mismatch due to the naming of `puppeteer-replay`
6
+ /* eslint-disable import/order */
7
+
5
8
  import * as Common from '../../../core/common/common.js';
6
9
  import type * as Platform from '../../../core/platform/platform.js';
7
10
  import * as SDK from '../../../core/sdk/sdk.js';
@@ -29,7 +29,7 @@ import {
29
29
  } from './SecurityModel.js';
30
30
  import {SecurityPanelSidebar} from './SecurityPanelSidebar.js';
31
31
 
32
- const {widgetConfig} = UI.Widget;
32
+ const {widget, widgetRef} = UI.Widget;
33
33
 
34
34
  const UIStrings = {
35
35
  /**
@@ -552,8 +552,8 @@ const DEFAULT_VIEW: View = (input: ViewInput, output: ViewOutput, target: HTMLEl
552
552
  ${UI.Widget.widgetRef(UI.SplitWidget.SplitWidget, e => {output.splitWidget = e;})}>
553
553
  <devtools-widget
554
554
  slot="sidebar"
555
- .widgetConfig=${widgetConfig(SecurityPanelSidebar)}
556
- ${UI.Widget.widgetRef(SecurityPanelSidebar, e => {output.sidebar = e;})}>
555
+ ${widget(SecurityPanelSidebar)}
556
+ ${widgetRef(SecurityPanelSidebar, e => {output.sidebar = e;})}>
557
557
  </devtools-widget>
558
558
  </devtools-split-view>`,
559
559
  target);