chrome-devtools-frontend 1.0.1672557 → 1.0.1674545

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/front_end/core/common/SettingRegistration.ts +1 -26
  2. package/front_end/core/common/Settings.ts +4 -53
  3. package/front_end/core/host/UserMetrics.ts +127 -117
  4. package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +42 -9
  5. package/front_end/core/root/Runtime.ts +10 -0
  6. package/front_end/core/sdk/NetworkManager.ts +0 -35
  7. package/front_end/core/sdk/SourceMap.ts +1 -19
  8. package/front_end/core/sdk/SourceMapManager.ts +75 -48
  9. package/front_end/core/sdk/SourceMapScopesInfo.ts +0 -62
  10. package/front_end/devtools_compatibility.js +1 -1
  11. package/front_end/generated/InspectorBackendCommands.ts +4 -3
  12. package/front_end/generated/SupportedCSSProperties.ts +16 -1
  13. package/front_end/generated/protocol-mapping.d.ts +8 -0
  14. package/front_end/generated/protocol-proxy-api.d.ts +6 -0
  15. package/front_end/generated/protocol.ts +16 -2
  16. package/front_end/models/ai_assistance/AiSetting.ts +66 -3
  17. package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
  18. package/front_end/models/emulation/DeviceModeModel.ts +25 -34
  19. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
  20. package/front_end/models/trace/ModelImpl.ts +5 -0
  21. package/front_end/models/trace/Processor.ts +5 -0
  22. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +7 -1
  23. package/front_end/models/trace/handlers/MetaHandler.ts +8 -4
  24. package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +11 -0
  25. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
  26. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -45
  27. package/front_end/panels/application/BackgroundServiceView.ts +42 -40
  28. package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
  29. package/front_end/panels/common/ExtensionServer.ts +7 -1
  30. package/front_end/panels/common/common.ts +0 -1
  31. package/front_end/panels/console/ConsoleInsightTeaser.ts +7 -6
  32. package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
  33. package/front_end/panels/elements/ClassesPaneWidget.ts +2 -2
  34. package/front_end/panels/elements/ElementsTreeElement.ts +56 -4
  35. package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
  36. package/front_end/panels/elements/components/AdornerManager.ts +1 -0
  37. package/front_end/panels/emulation/AdvancedApp.ts +3 -3
  38. package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -11
  39. package/front_end/panels/emulation/DeviceModeView.ts +234 -75
  40. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -1
  41. package/front_end/panels/emulation/deviceModeView.css +4 -21
  42. package/front_end/panels/emulation/emulation-meta.ts +4 -30
  43. package/front_end/panels/emulation/emulation.ts +0 -3
  44. package/front_end/panels/explain/components/ConsoleInsight.ts +11 -7
  45. package/front_end/panels/layers/LayersPanel.ts +2 -2
  46. package/front_end/panels/layers/layers-meta.ts +2 -2
  47. package/front_end/panels/lighthouse/LighthouseController.ts +3 -7
  48. package/front_end/panels/mobile_throttling/CPUThrottlingSelector.ts +313 -0
  49. package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +0 -10
  50. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +21 -10
  51. package/front_end/panels/mobile_throttling/mobile_throttling.ts +3 -0
  52. package/front_end/panels/network/NetworkConfigView.ts +1 -71
  53. package/front_end/panels/network/networkConfigView.css +1 -2
  54. package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +3 -3
  55. package/front_end/panels/profiler/HeapDetachedElementsView.ts +5 -5
  56. package/front_end/panels/profiler/HeapProfileView.ts +32 -32
  57. package/front_end/panels/profiler/HeapProfilerPanel.ts +2 -2
  58. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +33 -37
  59. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +26 -27
  60. package/front_end/panels/profiler/HeapSnapshotView.ts +48 -48
  61. package/front_end/panels/profiler/IsolateSelector.ts +10 -10
  62. package/front_end/panels/profiler/ModuleUIStrings.ts +25 -25
  63. package/front_end/panels/profiler/ProfileLauncherView.ts +6 -6
  64. package/front_end/panels/profiler/ProfilesPanel.ts +6 -6
  65. package/front_end/panels/profiler/WritableProfileHeader.ts +6 -6
  66. package/front_end/panels/profiler/profiler-meta.ts +7 -7
  67. package/front_end/panels/recorder/RecorderPanel.ts +1 -1
  68. package/front_end/panels/settings/AISettingsTab.ts +27 -23
  69. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +12 -17
  70. package/front_end/panels/timeline/TimelinePanel.ts +20 -35
  71. package/front_end/panels/timeline/components/LiveMetricsView.ts +27 -6
  72. package/front_end/panels/timeline/components/NetworkTrackWidget.ts +1 -1
  73. package/front_end/panels/timeline/components/components.ts +0 -4
  74. package/front_end/panels/timeline/components/liveMetricsView.css +7 -0
  75. package/front_end/third_party/chromium/README.chromium +1 -1
  76. package/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -0
  77. package/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -0
  78. package/front_end/third_party/source-map-scopes-codec/package/README.md +0 -0
  79. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -0
  80. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
  81. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -0
  82. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -0
  83. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -0
  84. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -0
  85. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -0
  86. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -0
  87. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -0
  88. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -0
  89. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +0 -0
  90. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +0 -0
  91. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  92. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  93. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +2 -0
  94. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +1 -1
  95. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +2 -0
  96. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -0
  97. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -0
  98. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -0
  99. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -0
  100. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -0
  101. package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -0
  102. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -0
  103. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -0
  104. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -0
  105. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -0
  106. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -0
  107. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -0
  108. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -0
  109. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -0
  110. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -0
  111. package/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -0
  112. package/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -0
  113. package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -0
  114. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +0 -0
  115. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +0 -0
  116. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.ts +0 -0
  117. package/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -0
  118. package/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -0
  119. package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -0
  120. package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -0
  121. package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -0
  122. package/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -0
  123. package/front_end/ui/components/dialogs/ShortcutDialog.ts +2 -0
  124. package/front_end/ui/components/settings/SettingCheckbox.ts +4 -12
  125. package/front_end/ui/components/settings/settingCheckbox.css +0 -7
  126. package/front_end/ui/legacy/Treeoutline.ts +14 -14
  127. package/front_end/ui/legacy/UIUtils.ts +2 -47
  128. package/front_end/ui/legacy/Widget.ts +10 -2
  129. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +1 -1
  130. package/front_end/ui/lit/Directives.ts +80 -0
  131. package/front_end/ui/lit/lit.ts +1 -0
  132. package/front_end/ui/lit/render.ts +8 -0
  133. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  134. package/mcp/mcp.ts +1 -0
  135. package/package.json +1 -1
  136. package/front_end/panels/common/ThrottlingUtils.ts +0 -51
  137. package/front_end/panels/emulation/DeviceModeWrapper.ts +0 -248
  138. package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +0 -235
  139. package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +0 -245
  140. package/front_end/panels/timeline/components/cpuThrottlingSelector.css +0 -30
  141. package/front_end/panels/timeline/components/networkThrottlingSelector.css +0 -24
@@ -4,7 +4,6 @@
4
4
 
5
5
  import * as i18n from '../i18n/i18n.js';
6
6
  import type * as Platform from '../platform/platform.js';
7
- import * as Root from '../root/root.js';
8
7
 
9
8
  import type {SettingStorageType} from './Settings.js';
10
9
 
@@ -78,10 +77,6 @@ const UIStrings = {
78
77
  * section allows users to see their signed-in account and configure which DevTools data is synced via Chrome Sync.
79
78
  */
80
79
  account: 'Account',
81
- /**
82
- * @description Title of the Privacy setting category.
83
- */
84
- privacy: 'Privacy',
85
80
  } as const;
86
81
  const str_ = i18n.i18n.registerUIStrings('core/common/SettingRegistration.ts', UIStrings);
87
82
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -98,7 +93,7 @@ export function registerSettingExtension(registration: SettingRegistration): voi
98
93
  }
99
94
 
100
95
  export function getRegisteredSettings(): SettingRegistration[] {
101
- return registeredSettings.filter(setting => Root.Runtime.Runtime.isDescriptorEnabled(setting));
96
+ return registeredSettings;
102
97
  }
103
98
 
104
99
  export function registerSettingsForTest(settings: SettingRegistration[], forceReset = false): void {
@@ -149,7 +144,6 @@ export const enum SettingCategory {
149
144
  EXTENSIONS = 'EXTENSIONS',
150
145
  ADORNER = 'ADORNER',
151
146
  ACCOUNT = 'ACCOUNT',
152
- PRIVACY = 'PRIVACY',
153
147
  }
154
148
 
155
149
  export function getLocalizedSettingsCategory(category: SettingCategory): Platform.UIString.LocalizedString {
@@ -192,8 +186,6 @@ export function getLocalizedSettingsCategory(category: SettingCategory): Platfor
192
186
  return i18n.i18n.lockedString('');
193
187
  case SettingCategory.ACCOUNT:
194
188
  return i18nString(UIStrings.account);
195
- case SettingCategory.PRIVACY:
196
- return i18nString(UIStrings.privacy);
197
189
  }
198
190
  }
199
191
 
@@ -268,19 +260,6 @@ export interface SettingRegistration {
268
260
  * Determines if the setting value is stored in the global, local or session storage.
269
261
  */
270
262
  storageType?: SettingStorageType;
271
- /**
272
- * A condition is a function that will make the setting available if it
273
- * returns true, and not available, otherwise. Make sure that objects you
274
- * access from inside the condition function are ready at the time when the
275
- * setting conditions are checked.
276
- */
277
- condition?: Root.Runtime.Condition;
278
-
279
- /**
280
- * A function that returns true if the setting should be disabled, along with
281
- * the reason why.
282
- */
283
- disabledCondition?: (config?: Root.Runtime.HostConfig) => DisabledConditionResult;
284
263
 
285
264
  /**
286
265
  * See {@link LearnMore} for more info.
@@ -319,7 +298,3 @@ interface RawSettingExtensionOption {
319
298
  raw: true;
320
299
  }
321
300
  export type SettingExtensionOption = LocalizedSettingExtensionOption|RawSettingExtensionOption;
322
- export type DisabledConditionResult = {
323
- disabled: true,
324
- reasons: Platform.UIString.LocalizedString[],
325
- }|{disabled: false};
@@ -499,10 +499,7 @@ export class Setting<V> {
499
499
  #type: SettingType|null = null;
500
500
  #requiresUserAction?: boolean;
501
501
  #value?: V;
502
- // TODO(crbug.com/1172300) Type cannot be inferred without changes to consumers. See above.
503
- #serializer: Serializer<unknown, V> = JSON;
504
502
  #hadUserAction?: boolean;
505
- #disabled?: boolean;
506
503
  #loggedInitialAccess = false;
507
504
  #logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
508
505
  readonly #console: Console;
@@ -515,10 +512,6 @@ export class Setting<V> {
515
512
  this.#logSettingAccess = logSettingAccess;
516
513
  }
517
514
 
518
- setSerializer(serializer: Serializer<unknown, V>): void {
519
- this.#serializer = serializer;
520
- }
521
-
522
515
  descriptor(): SettingDescriptor<V> {
523
516
  return {
524
517
  name: this.name,
@@ -547,38 +540,11 @@ export class Setting<V> {
547
540
  this.#requiresUserAction = requiresUserAction;
548
541
  }
549
542
 
550
- disabled(): boolean {
551
- if (this.#registration?.disabledCondition) {
552
- const {disabled} = this.#registration.disabledCondition(Root.Runtime.hostConfig);
553
- // If registration does not disable it, pass through to #disabled
554
- // attribute check.
555
- if (disabled) {
556
- return true;
557
- }
558
- }
559
- return this.#disabled || false;
560
- }
561
-
562
- disabledReasons(): Platform.UIString.LocalizedString[] {
563
- if (this.#registration?.disabledCondition) {
564
- const result = this.#registration.disabledCondition(Root.Runtime.hostConfig);
565
- if (result.disabled) {
566
- return result.reasons;
567
- }
568
- }
569
- return [];
570
- }
571
-
572
- setDisabled(disabled: boolean): void {
573
- this.#disabled = disabled;
574
- this.eventSupport.dispatchEventToListeners(this.name);
575
- }
576
-
577
543
  #maybeLogAccess(value: V): void {
578
544
  try {
579
545
  const valueToLog = typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ?
580
546
  value :
581
- this.#serializer?.stringify(value);
547
+ JSON.stringify(value);
582
548
  if (valueToLog !== undefined && this.#logSettingAccess) {
583
549
  void this.#logSettingAccess(this.name, valueToLog);
584
550
  }
@@ -607,7 +573,7 @@ export class Setting<V> {
607
573
  this.#value = this.defaultValue;
608
574
  if (this.storage.has(this.name)) {
609
575
  try {
610
- this.#value = this.#serializer.parse(this.storage.get(this.name));
576
+ this.#value = JSON.parse(this.storage.get(this.name)) as V;
611
577
  } catch {
612
578
  this.storage.remove(this.name);
613
579
  }
@@ -616,16 +582,6 @@ export class Setting<V> {
616
582
  return this.#value;
617
583
  }
618
584
 
619
- // Prefer this getter for settings which are "disableable". The plain getter returns `this.#value`,
620
- // even if the setting is disabled, which means the callsite has to explicitly call the `disabled()`
621
- // getter and add its own logic for the disabled state.
622
- getIfNotDisabled(): V|undefined {
623
- if (this.disabled()) {
624
- return;
625
- }
626
- return this.get();
627
- }
628
-
629
585
  async forceGet(): Promise<V> {
630
586
  const name = this.name;
631
587
  const oldValue = this.storage.get(name);
@@ -633,7 +589,7 @@ export class Setting<V> {
633
589
  this.#value = this.defaultValue;
634
590
  if (value) {
635
591
  try {
636
- this.#value = this.#serializer.parse(value);
592
+ this.#value = JSON.parse(value) as V;
637
593
  } catch {
638
594
  this.storage.remove(this.name);
639
595
  }
@@ -652,7 +608,7 @@ export class Setting<V> {
652
608
  this.#hadUserAction = true;
653
609
  this.#value = value;
654
610
  try {
655
- const settingString = this.#serializer.stringify(value);
611
+ const settingString = JSON.stringify(value);
656
612
  try {
657
613
  this.storage.set(this.name, settingString);
658
614
  } catch (e) {
@@ -822,11 +778,6 @@ export {
822
778
  SettingType,
823
779
  };
824
780
 
825
- export interface Serializer<I, O> {
826
- stringify: (value: I) => string;
827
- parse: (value: string) => O;
828
- }
829
-
830
781
  export interface SimpleSettingOption {
831
782
  value: string|boolean;
832
783
  title: string;