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
@@ -1,245 +0,0 @@
1
- // Copyright 2024 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
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
-
6
- import '../../../ui/kit/kit.js';
7
- import '../../../ui/components/menus/menus.js';
8
-
9
- import * as Common from '../../../core/common/common.js';
10
- import * as i18n from '../../../core/i18n/i18n.js';
11
- import * as Platform from '../../../core/platform/platform.js';
12
- import * as SDK from '../../../core/sdk/sdk.js';
13
- import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
14
- import type * as Menus from '../../../ui/components/menus/menus.js';
15
- import * as Lit from '../../../ui/lit/lit.js';
16
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
17
- import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';
18
-
19
- import networkThrottlingSelectorStyles from './networkThrottlingSelector.css.js';
20
-
21
- const {html, nothing} = Lit;
22
-
23
- const UIStrings = {
24
- /**
25
- * @description Text label for a selection box showing which network throttling option is applied.
26
- * @example {No throttling} PH1
27
- */
28
- network: 'Network: {PH1}',
29
- /**
30
- * @description Text label for a selection box showing which network throttling option is applied.
31
- * @example {No throttling} PH1
32
- */
33
- networkThrottling: 'Network throttling: {PH1}',
34
- /**
35
- * @description Text label for a selection box showing that a specific option is recommended for network throttling.
36
- * @example {Fast 4G} PH1
37
- */
38
- recommendedThrottling: '{PH1} – recommended',
39
- /**
40
- * @description Text for why user should change a throttling setting.
41
- */
42
- recommendedThrottlingReason: 'Consider changing setting to simulate real user environments',
43
- /**
44
- * @description Text label for a menu group that disables network throttling.
45
- */
46
- disabled: 'Disabled',
47
- /**
48
- * @description Text label for a menu group that contains default presets for network throttling.
49
- */
50
- presets: 'Presets',
51
- /**
52
- * @description Text label for a menu group that contains custom presets for network throttling.
53
- */
54
- custom: 'Custom',
55
- /**
56
- * @description Text label for a menu option to add a new custom throttling preset.
57
- */
58
- add: 'Add…',
59
- } as const;
60
-
61
- const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/NetworkThrottlingSelector.ts', UIStrings);
62
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
63
-
64
- interface ConditionsGroup {
65
- name: string;
66
- items: SDK.NetworkManager.Conditions[];
67
- showCustomAddOption?: boolean;
68
- jslogContext?: string;
69
- }
70
-
71
- export class NetworkThrottlingSelector extends HTMLElement {
72
- readonly #shadow = this.attachShadow({mode: 'open'});
73
-
74
- #customNetworkConditionsSetting: Common.Settings.Setting<SDK.NetworkManager.Conditions[]>;
75
- #groups: ConditionsGroup[] = [];
76
- #currentConditions: SDK.NetworkManager.Conditions;
77
- #recommendedConditions: SDK.NetworkManager.Conditions|null = null;
78
-
79
- constructor() {
80
- super();
81
- this.#customNetworkConditionsSetting =
82
- Common.Settings.Settings.instance().moduleSetting('custom-network-conditions');
83
- this.#resetPresets();
84
- this.#currentConditions = SDK.NetworkManager.MultitargetNetworkManager.instance().networkConditions();
85
- this.#render();
86
- }
87
-
88
- set recommendedConditions(recommendedConditions: SDK.NetworkManager.Conditions|null) {
89
- this.#recommendedConditions = recommendedConditions;
90
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
91
- }
92
-
93
- connectedCallback(): void {
94
- SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(
95
- SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, this.#onConditionsChanged, this);
96
-
97
- // Also call onConditionsChanged immediately to make sure we get the
98
- // latest snapshot. Otherwise if another panel updated this value and this
99
- // component wasn't in the DOM, this component will not update itself
100
- // when it is put into the page
101
- this.#onConditionsChanged();
102
- this.#customNetworkConditionsSetting.addChangeListener(this.#onSettingChanged, this);
103
- }
104
-
105
- disconnectedCallback(): void {
106
- SDK.NetworkManager.MultitargetNetworkManager.instance().removeEventListener(
107
- SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, this.#onConditionsChanged, this);
108
- this.#customNetworkConditionsSetting.removeChangeListener(this.#onSettingChanged, this);
109
- }
110
-
111
- #resetPresets(): void {
112
- this.#groups = [
113
- {
114
- name: i18nString(UIStrings.disabled),
115
- items: [
116
- SDK.NetworkManager.NoThrottlingConditions,
117
- ],
118
- },
119
- {
120
- name: i18nString(UIStrings.presets),
121
- items: MobileThrottling.ThrottlingPresets.ThrottlingPresets.networkPresets,
122
- },
123
- {
124
- name: i18nString(UIStrings.custom),
125
- items: this.#customNetworkConditionsSetting.get(),
126
- showCustomAddOption: true,
127
- jslogContext: 'custom-network-throttling-item',
128
- },
129
- ];
130
- }
131
-
132
- #onConditionsChanged(): void {
133
- this.#currentConditions = SDK.NetworkManager.MultitargetNetworkManager.instance().networkConditions();
134
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
135
- }
136
-
137
- #onMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {
138
- const newConditions = this.#groups.flatMap(g => g.items).find(item => {
139
- const keyForItem = this.#keyForNetworkConditions(item);
140
- return keyForItem === event.itemValue;
141
- });
142
- if (newConditions) {
143
- SDK.NetworkManager.MultitargetNetworkManager.instance().setNetworkConditions(newConditions);
144
- }
145
- }
146
-
147
- #onSettingChanged(): void {
148
- this.#resetPresets();
149
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
150
- }
151
-
152
- #getConditionsTitle(conditions: SDK.NetworkManager.Conditions): string {
153
- return conditions.title instanceof Function ? conditions.title() : conditions.title;
154
- }
155
-
156
- #onAddClick(): void {
157
- void Common.Revealer.reveal(this.#customNetworkConditionsSetting);
158
- }
159
-
160
- /**
161
- * The key that uniquely identifies the condition setting. All the DevTools
162
- * presets have the i18nKey, so we rely on that, but for custom user added
163
- * ones we fallback to using the title (it wouldn't make sense for a user to
164
- * add presets with the same title)
165
- */
166
- #keyForNetworkConditions(conditions: SDK.NetworkManager.Conditions): string {
167
- return conditions.i18nTitleKey || this.#getConditionsTitle(conditions);
168
- }
169
-
170
- #render = (): void => {
171
- const selectionTitle = this.#getConditionsTitle(this.#currentConditions);
172
- const selectedConditionsKey = this.#keyForNetworkConditions(this.#currentConditions);
173
-
174
- let recommendedInfoEl;
175
- if (this.#recommendedConditions && this.#currentConditions === SDK.NetworkManager.NoThrottlingConditions) {
176
- recommendedInfoEl = html`<devtools-icon
177
- title=${i18nString(UIStrings.recommendedThrottlingReason)}
178
- name=info></devtools-icon>`;
179
- }
180
-
181
- // clang-format off
182
- /* eslint-disable @devtools/no-deprecated-component-usages */
183
- const output = html`
184
- <style>${networkThrottlingSelectorStyles}</style>
185
- <devtools-select-menu
186
- @selectmenuselected=${this.#onMenuItemSelected}
187
- .showDivider=${true}
188
- .showArrow=${true}
189
- .sideButton=${false}
190
- .showSelectedItem=${true}
191
- .jslogContext=${'network-conditions'}
192
- .buttonTitle=${i18nString(UIStrings.network, {PH1: selectionTitle})}
193
- .title=${i18nString(UIStrings.networkThrottling, {PH1: selectionTitle})}
194
- >
195
- ${this.#groups.map(group => {
196
- return html`
197
- <devtools-menu-group .name=${group.name} .title=${group.name}>
198
- ${group.items.map(conditions => {
199
- let title = this.#getConditionsTitle(conditions);
200
- if (conditions === this.#recommendedConditions) {
201
- title = i18nString(UIStrings.recommendedThrottling, {PH1: title});
202
- }
203
-
204
- const key = this.#keyForNetworkConditions(conditions);
205
- const jslogContext = group.jslogContext || Platform.StringUtilities.toKebabCase(conditions.i18nTitleKey || title);
206
- return html`
207
- <devtools-menu-item
208
- .value=${key}
209
- .selected=${selectedConditionsKey === key}
210
- .title=${title}
211
- jslog=${VisualLogging.item(jslogContext).track({click: true})}
212
- >
213
- ${title}
214
- </devtools-menu-item>
215
- `;
216
- })}
217
- ${group.showCustomAddOption ? html`
218
- <devtools-menu-item
219
- .value=${1 /* This won't be displayed unless it has some value. */}
220
- .title=${i18nString(UIStrings.add)}
221
- jslog=${VisualLogging.action('add').track({click: true})}
222
- @click=${this.#onAddClick}
223
- >
224
- ${i18nString(UIStrings.add)}
225
- </devtools-menu-item>
226
- ` : nothing}
227
- </devtools-menu-group>
228
- `;
229
- })}
230
- </devtools-select-menu>
231
- ${recommendedInfoEl}
232
- `;
233
- /* eslint-enable @devtools/no-deprecated-component-usages */
234
- // clang-format on
235
- Lit.render(output, this.#shadow, {host: this});
236
- };
237
- }
238
-
239
- customElements.define('devtools-network-throttling-selector', NetworkThrottlingSelector);
240
-
241
- declare global {
242
- interface HTMLElementTagNameMap {
243
- 'devtools-network-throttling-selector': NetworkThrottlingSelector;
244
- }
245
- }
@@ -1,30 +0,0 @@
1
- /*
2
- * Copyright 2024 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- @scope to (devtools-widget > *) {
8
- :scope {
9
- display: flex;
10
- align-items: center;
11
- max-width: 100%;
12
- height: 20px;
13
- }
14
-
15
- * {
16
- font-family: var(--default-font-family);
17
- }
18
-
19
- devtools-icon[name="info"] {
20
- margin-left: var(--sys-size-3);
21
- width: var(--sys-size-8);
22
- height: var(--sys-size-8);
23
- }
24
-
25
- devtools-select-menu {
26
- min-width: 160px;
27
- max-width: 100%;
28
- height: 20px;
29
- }
30
- }
@@ -1,24 +0,0 @@
1
- /*
2
- * Copyright 2024 The Chromium Authors
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- :host {
8
- display: flex;
9
- align-items: center;
10
- max-width: 100%;
11
- height: 20px;
12
- }
13
-
14
- devtools-icon[name="info"] {
15
- margin-left: var(--sys-size-3);
16
- width: var(--sys-size-8);
17
- height: var(--sys-size-8);
18
- }
19
-
20
- devtools-select-menu {
21
- min-width: 160px;
22
- max-width: 100%;
23
- height: 20px;
24
- }