chrome-devtools-frontend 1.0.1516909 → 1.0.1519267
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.
- package/config/owner/COMMON_OWNERS +2 -2
- package/docs/checklist/README.md +2 -2
- package/docs/checklist/javascript.md +1 -1
- package/docs/contributing/README.md +1 -1
- package/docs/contributing/settings-experiments-features.md +9 -8
- package/docs/cookbook/devtools_on_devtools.md +2 -2
- package/docs/cookbook/localization.md +10 -10
- package/docs/devtools-protocol.md +9 -8
- package/docs/ecosystem/automatic_workspace_folders.md +3 -3
- package/docs/get_the_code.md +0 -2
- package/docs/styleguide/ux/components.md +166 -85
- package/docs/styleguide/ux/numbers.md +3 -4
- package/eslint.config.mjs +1 -0
- package/front_end/core/common/README.md +13 -12
- package/front_end/core/host/GdpClient.ts +16 -1
- package/front_end/core/host/UserMetrics.ts +4 -2
- package/front_end/core/root/Runtime.ts +13 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +5 -1
- package/front_end/core/sdk/EnhancedTracesParser.ts +5 -5
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +211 -0
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +6 -3
- package/front_end/generated/InspectorBackendCommands.js +10 -7
- package/front_end/generated/SupportedCSSProperties.js +40 -11
- package/front_end/generated/protocol-mapping.d.ts +16 -1
- package/front_end/generated/protocol-proxy-api.d.ts +13 -1
- package/front_end/generated/protocol.ts +95 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +57 -10
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +119 -51
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -31
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +14 -181
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +19 -315
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +224 -50
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +310 -11
- package/front_end/models/ai_assistance/performance/AIContext.ts +15 -2
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +22 -11
- package/front_end/models/badges/AiExplorerBadge.ts +19 -3
- package/front_end/models/badges/Badge.ts +10 -3
- package/front_end/models/badges/CodeWhispererBadge.ts +3 -4
- package/front_end/models/badges/DOMDetectiveBadge.ts +1 -0
- package/front_end/models/badges/SpeedsterBadge.ts +1 -0
- package/front_end/models/badges/StarterBadge.ts +3 -2
- package/front_end/models/badges/UserBadges.ts +21 -3
- package/front_end/models/badges/badges.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/trace/EventsSerializer.ts +4 -3
- package/front_end/models/trace/README.md +28 -1
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +101 -73
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +1 -1
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/models/trace/helpers/Trace.ts +99 -43
- package/front_end/models/trace/types/TraceEvents.ts +9 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +113 -191
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +9 -9
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +6 -4
- package/front_end/panels/accessibility/accessibilityProperties.css +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +20 -3
- package/front_end/panels/ai_assistance/components/ChatView.ts +9 -10
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +44 -0
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +32 -9
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +7 -1
- package/front_end/panels/common/BadgeNotification.ts +21 -5
- package/front_end/panels/common/GdpSignUpDialog.ts +20 -12
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +6 -2
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
- package/front_end/panels/elements/ElementsPanel.ts +4 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +18 -0
- package/front_end/panels/elements/ElementsTreeOutline.ts +13 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +21 -6
- package/front_end/panels/media/TickingFlameChart.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +34 -19
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/search/SearchResultsPane.ts +167 -152
- package/front_end/panels/search/SearchView.ts +36 -26
- package/front_end/panels/search/searchResultsPane.css +9 -0
- package/front_end/panels/security/CookieControlsView.ts +2 -1
- package/front_end/panels/settings/AISettingsTab.ts +6 -3
- package/front_end/panels/settings/components/SyncSection.ts +39 -17
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +1 -1
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +9 -1
- package/front_end/panels/sources/SourcesPanel.ts +4 -1
- package/front_end/panels/sources/sourcesView.css +6 -1
- package/front_end/panels/timeline/AppenderUtils.ts +2 -2
- package/front_end/panels/timeline/ExtensionTrackAppender.ts +13 -4
- package/front_end/panels/timeline/GPUTrackAppender.ts +2 -1
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -1
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +2 -1
- package/front_end/panels/timeline/ThreadAppender.ts +12 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +9 -4
- package/front_end/panels/timeline/TimelinePanel.ts +3 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -4
- package/front_end/panels/timeline/TimingsTrackAppender.ts +6 -1
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +95 -82
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +1 -1
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +1 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/cpuThrottlingSelector.css +17 -15
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +3 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +6 -9
- package/front_end/third_party/codemirror.next/package.json +2 -1
- package/front_end/third_party/diff/README.chromium +1 -0
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +19 -28
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js +16 -25
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Function.js.map +1 -1
- package/front_end/third_party/puppeteer/package/package.json +10 -3
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/Function.ts +22 -30
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -5
- package/front_end/ui/components/switch/SwitchImpl.ts +12 -1
- package/front_end/ui/components/text_editor/config.ts +22 -9
- package/front_end/ui/components/tooltips/Tooltip.ts +70 -31
- package/front_end/ui/legacy/README.md +33 -24
- package/front_end/ui/legacy/SearchableView.ts +19 -26
- package/front_end/ui/legacy/TextPrompt.ts +166 -1
- package/front_end/ui/legacy/Treeoutline.ts +19 -3
- package/front_end/ui/legacy/UIUtils.ts +15 -2
- package/front_end/ui/legacy/XElement.ts +0 -43
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +20 -4
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +12 -11
- package/front_end/ui/lit/i18n-template.ts +5 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +23 -6
- package/front_end/ui/visual_logging/README.md +43 -27
- package/package.json +1 -1
@@ -76,7 +76,7 @@ space.
|
|
76
76
|
|
77
77
|
Usage with lit-html:
|
78
78
|
|
79
|
-
```
|
79
|
+
```ts
|
80
80
|
html`<devtools-button class="some-class"
|
81
81
|
.variant=${Buttons.Button.Variant.PRIMARY}
|
82
82
|
.title=${i18nString(UIStrings.someString)}
|
@@ -86,13 +86,13 @@ html`<devtools-button class="some-class"
|
|
86
86
|
|
87
87
|
Usage with the imperative API:
|
88
88
|
|
89
|
-
```
|
89
|
+
```ts
|
90
90
|
const button = new Buttons.Button.Button();
|
91
91
|
button.data = {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
variant: Buttons.Button.Variant.PRIMARY,
|
93
|
+
title: i18nString(UIStrings.someString),
|
94
|
+
jslogContext: 'some-context',
|
95
|
+
};
|
96
96
|
button.classList.add('some-class');
|
97
97
|
button.addEventListener('click', event => onClick(event));
|
98
98
|
```
|
@@ -164,28 +164,36 @@ button.addEventListener('click', event => onClick(event));
|
|
164
164
|
|
165
165
|
Usage with lit-html:
|
166
166
|
|
167
|
-
```
|
168
|
-
html`<select aria-label="Choose your champion"
|
169
|
-
@onchange=${onChange}>
|
167
|
+
```ts
|
168
|
+
html`<select aria-label="Choose your champion" @onchange=${onChange}>
|
170
169
|
<option hidden value="Choose your champion"></option>
|
171
|
-
<option
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
170
|
+
<option
|
171
|
+
jslog=${VisualLogging.item('hamster').track({ click: true })}
|
172
|
+
value="Hamster"
|
173
|
+
>
|
174
|
+
Hamster
|
175
|
+
</option>
|
176
|
+
<option
|
177
|
+
jslog=${VisualLogging.item('mouse').track({ click: true })}
|
178
|
+
value="Mouse"
|
179
|
+
>
|
180
|
+
Mouse
|
181
|
+
</option>
|
182
|
+
<option jslog=${VisualLogging.item('cat').track({ click: true })} value="Cat">
|
183
|
+
Cat
|
184
|
+
</option>
|
185
|
+
</select>`;
|
178
186
|
```
|
179
187
|
|
180
188
|
Usage with the imperative API:
|
181
189
|
|
182
|
-
```
|
190
|
+
```ts
|
183
191
|
const select = UI.UIUtils.createSelect('Choose your champion', [
|
184
192
|
'Hamster',
|
185
193
|
'Mouse',
|
186
194
|
'Cat',
|
187
195
|
]);
|
188
|
-
select.addEventListener('change', event => onChange(event))
|
196
|
+
select.addEventListener('change', event => onChange(event));
|
189
197
|
```
|
190
198
|
|
191
199
|
## Radio Buttons
|
@@ -212,16 +220,22 @@ select.addEventListener('change', event => onChange(event))
|
|
212
220
|
|
213
221
|
Usage with lit-html:
|
214
222
|
|
215
|
-
```
|
216
|
-
const jslog = VisualLogging.toggle()
|
217
|
-
|
223
|
+
```ts
|
224
|
+
const jslog = VisualLogging.toggle()
|
225
|
+
.track({ change: true })
|
226
|
+
.context(jslogContext);
|
227
|
+
html`<label><input type="radio" name=${name} jslog=${jslog} />${title}</label>`;
|
218
228
|
```
|
219
229
|
|
220
230
|
Usage with the imperative API:
|
221
231
|
|
222
|
-
```
|
223
|
-
const {label, radio} = UI.UIUtils.createRadioButton(
|
224
|
-
|
232
|
+
```ts
|
233
|
+
const { label, radio } = UI.UIUtils.createRadioButton(
|
234
|
+
name,
|
235
|
+
title,
|
236
|
+
jslogContext,
|
237
|
+
);
|
238
|
+
radio.addEventListener('change', event => onChange(event));
|
225
239
|
```
|
226
240
|
|
227
241
|
## Sliders
|
@@ -247,19 +261,21 @@ radio.addEventListener('change', event => onChange(event))
|
|
247
261
|
|
248
262
|
Usage with lit-html:
|
249
263
|
|
250
|
-
```
|
251
|
-
html`<input
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
264
|
+
```ts
|
265
|
+
html`<input
|
266
|
+
type="range"
|
267
|
+
min=${min}
|
268
|
+
max=${max}
|
269
|
+
tabindex=${tabIndex}
|
270
|
+
@change=${onChange}
|
271
|
+
/>`;
|
256
272
|
```
|
257
273
|
|
258
274
|
Usage with the imperative API:
|
259
275
|
|
260
|
-
```
|
276
|
+
```ts
|
261
277
|
const slider = UI.UIUtils.createSlider(min, max, tabIndex);
|
262
|
-
slider.addEventListener('change', event => onChange(event))
|
278
|
+
slider.addEventListener('change', event => onChange(event));
|
263
279
|
```
|
264
280
|
|
265
281
|
## Icons
|
@@ -293,13 +309,13 @@ For some frequently used icons e.g. cross-circle, warning-filled etc. colors are
|
|
293
309
|
|
294
310
|
Usage with lit-html:
|
295
311
|
|
296
|
-
```
|
297
|
-
html`<devtools-icon name=${'some-icon-name'}></devtools-icon
|
312
|
+
```ts
|
313
|
+
html`<devtools-icon name=${'some-icon-name'}></devtools-icon>`;
|
298
314
|
```
|
299
315
|
|
300
316
|
Usage with the imperative API:
|
301
317
|
|
302
|
-
```
|
318
|
+
```ts
|
303
319
|
const someIcon = IconButton.Icon.create('some-icon-name', 'some-class');
|
304
320
|
```
|
305
321
|
|
@@ -379,53 +395,71 @@ Generally, we do not recommend using shortcuts in context menus since this goes
|
|
379
395
|
|
380
396
|
Usage with lit-html (left-click on a `<devtools-menu-button>` opens a menu):
|
381
397
|
|
382
|
-
```
|
398
|
+
```ts
|
383
399
|
html`
|
384
|
-
<devtools-menu-button
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
400
|
+
<devtools-menu-button
|
401
|
+
icon-name="some-icon-name"
|
402
|
+
.populateMenuCall=${(menu: UI.ContextMenu.ContextMenu) => {
|
403
|
+
menu.defaultSection().appendItem(
|
404
|
+
'Item',
|
405
|
+
() => {
|
406
|
+
console.log('Item clicked');
|
407
|
+
},
|
408
|
+
{ jslogContext: 'item' },
|
409
|
+
);
|
410
|
+
}}
|
411
|
+
jslogContext="my-menu-button"
|
412
|
+
></devtools-menu-button>
|
413
|
+
`;
|
394
414
|
```
|
395
415
|
|
396
416
|
Usage with the imperative API (menu shows on a right-click)
|
397
417
|
|
398
418
|
Various simple menu items:
|
399
419
|
|
400
|
-
```
|
420
|
+
```ts
|
401
421
|
const element = this.shadowRoot.querySelector('.element-to-add-menu-to');
|
402
422
|
element.addEventListener('contextmenu', (event: MouseEvent) => {
|
403
423
|
const contextMenu = new UI.ContextMenu.ContextMenu(event);
|
404
424
|
|
405
|
-
// Regular item
|
406
|
-
contextMenu.defaultSection().appendItem(
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
425
|
+
// Regular item
|
426
|
+
contextMenu.defaultSection().appendItem(
|
427
|
+
'Regular item',
|
428
|
+
() => {
|
429
|
+
console.log('Regular item clicked ');
|
430
|
+
},
|
431
|
+
{ jslogContext: 'regular-item' },
|
432
|
+
);
|
433
|
+
|
434
|
+
// Disabled item
|
435
|
+
contextMenu.defaultSection().appendItem(
|
436
|
+
'Disabled item',
|
437
|
+
() => {
|
438
|
+
console.log('Will not be printed');
|
439
|
+
},
|
440
|
+
{ jslogContext: 'disabled-item', disabled: true },
|
441
|
+
);
|
442
|
+
|
443
|
+
// Experimental item
|
444
|
+
const item = contextMenu.defaultSection().appendItem(
|
445
|
+
'Experimental item',
|
446
|
+
() => {
|
447
|
+
console.log('Experimental item clicked');
|
448
|
+
},
|
449
|
+
{ jslogContext: 'experimental-item', isPreviewFeature: true },
|
450
|
+
);
|
451
|
+
|
452
|
+
// Separator
|
423
453
|
contextMenu.defaultSection().appendSeparator();
|
424
454
|
|
425
|
-
// Checkbox item
|
426
|
-
contextMenu.defaultSection().appendCheckboxItem(
|
427
|
-
|
428
|
-
|
455
|
+
// Checkbox item
|
456
|
+
contextMenu.defaultSection().appendCheckboxItem(
|
457
|
+
'Checkbox item',
|
458
|
+
() => {
|
459
|
+
console.log('Checkbox item clicked');
|
460
|
+
},
|
461
|
+
{ checked: true, jslogContext: 'checkbox-item' },
|
462
|
+
);
|
429
463
|
|
430
464
|
void contextMenu.show();
|
431
465
|
});
|
@@ -433,39 +467,85 @@ element.addEventListener('contextmenu', (event: MouseEvent) => {
|
|
433
467
|
|
434
468
|
Custom section:
|
435
469
|
|
436
|
-
```
|
437
|
-
|
438
|
-
|
470
|
+
```ts
|
471
|
+
const customSection = contextMenu.section('Custom section');
|
472
|
+
customSection.appendItem(
|
473
|
+
'Section inner item 1',
|
474
|
+
() => {
|
475
|
+
/* ... */
|
476
|
+
},
|
477
|
+
{ jslogContext: 'my-inner-item-1' },
|
478
|
+
);
|
439
479
|
|
440
|
-
|
480
|
+
customSection.appendItem(
|
481
|
+
'Section inner item 2',
|
482
|
+
() => {
|
483
|
+
/* ... */
|
484
|
+
},
|
485
|
+
{ jslogContext: 'my-inner-item-2' },
|
486
|
+
);
|
441
487
|
```
|
442
488
|
|
443
489
|
Sub menu:
|
444
490
|
|
445
|
-
```
|
446
|
-
const subMenu = contextMenu
|
447
|
-
|
448
|
-
|
491
|
+
```ts
|
492
|
+
const subMenu = contextMenu
|
493
|
+
.defaultSection()
|
494
|
+
.appendSubMenuItem(
|
495
|
+
'Item to open sub menu',
|
496
|
+
/* disabled */ false,
|
497
|
+
'my-sub-menu',
|
498
|
+
);
|
499
|
+
subMenu.defaultSection().appendItem(
|
500
|
+
'Sub menu inner item 1',
|
501
|
+
() => {
|
502
|
+
/* ... */
|
503
|
+
},
|
504
|
+
{ jslogContext: 'my-inner-item-1' },
|
505
|
+
);
|
506
|
+
subMenu.defaultSection().appendItem(
|
507
|
+
'Sub menu inner item 2',
|
508
|
+
() => {
|
509
|
+
/* ... */
|
510
|
+
},
|
511
|
+
{ jslogContext: 'my-inner-item-2' },
|
512
|
+
);
|
449
513
|
```
|
450
514
|
|
451
515
|
Context menu provider registration (adds items dynamically based on the context menu’s target):
|
452
516
|
|
453
517
|
```js
|
454
518
|
// Define provider
|
455
|
-
class MyCustomNodeProvider
|
456
|
-
|
519
|
+
class MyCustomNodeProvider
|
520
|
+
implements UI.ContextMenu.Provider<SomeTarget | SomeOtherTarget>
|
521
|
+
{
|
522
|
+
appendApplicableItems(
|
523
|
+
event: Event,
|
524
|
+
contextMenu: UI.ContextMenu.ContextMenu,
|
525
|
+
target: SomeTarget | SomeOtherTarget,
|
526
|
+
) {
|
457
527
|
if (target instanceof SomeTarget) {
|
458
|
-
contextMenu.defaultSection().appendItem(
|
459
|
-
|
528
|
+
contextMenu.defaultSection().appendItem(
|
529
|
+
'Item 1',
|
530
|
+
() => {
|
531
|
+
console.log('Item 1 clicked');
|
532
|
+
},
|
533
|
+
{ jsLogContext: 'my-item-1' },
|
534
|
+
);
|
460
535
|
} else {
|
461
|
-
contextMenu.defaultSection().appendItem(
|
462
|
-
|
536
|
+
contextMenu.defaultSection().appendItem(
|
537
|
+
'Item 2',
|
538
|
+
() => {
|
539
|
+
console.log('Item 2 clicked');
|
540
|
+
},
|
541
|
+
{ jsLogContext: 'my-item-2' },
|
542
|
+
);
|
463
543
|
}
|
464
544
|
}
|
465
545
|
}
|
466
546
|
```
|
467
547
|
|
468
|
-
```
|
548
|
+
```ts
|
469
549
|
// Register provider
|
470
550
|
UI.ContextMenu.registerProvider<SDK.DOMModel.DOMNode>({
|
471
551
|
contextTypes: () => [SomeTarget, SomeOtherTarget],
|
@@ -479,11 +559,12 @@ UI.ContextMenu.registerProvider<SDK.DOMModel.DOMNode>({
|
|
479
559
|
|
480
560
|
Static menu item registration via ItemLocation (adds an action to a predefined menu location):
|
481
561
|
|
482
|
-
```
|
562
|
+
```ts
|
483
563
|
UI.ContextMenu.registerItem({
|
484
564
|
location: UI.ContextMenu.ItemLocation.NAVIGATOR_MENU_DEFAULT,
|
485
565
|
actionId: 'quick-open.show',
|
486
566
|
order: undefined,
|
487
567
|
});
|
488
568
|
```
|
569
|
+
|
489
570
|
This will automatically add the "Open file" action to the context menu that appears when clicking the Elements panel's 3-dot button.
|
@@ -52,7 +52,7 @@ initialized.
|
|
52
52
|
Prefer the helper exported by [ByteUtilities.ts] when formatting byte values.
|
53
53
|
For example:
|
54
54
|
|
55
|
-
```
|
55
|
+
```ts
|
56
56
|
// Formatting bytes
|
57
57
|
i18n.ByteUtilities.bytesToString(99);
|
58
58
|
|
@@ -68,7 +68,7 @@ i18n.ByteUtilities.bytesToString(1500 * 1000);
|
|
68
68
|
Prefer the helpers exported by [time-utilities.ts] when formatting time values.
|
69
69
|
For example:
|
70
70
|
|
71
|
-
```
|
71
|
+
```ts
|
72
72
|
// Formatting precise milliseconds
|
73
73
|
i18n.TimeUtilities.preciseMillisToString(6.12345);
|
74
74
|
|
@@ -90,7 +90,7 @@ invocation of `format()` or `formatToParts()` methods, and therefore it's safe
|
|
90
90
|
to define the formatters this way without running into the issue that the
|
91
91
|
`DevToolsLocale` isn't initialized yet:
|
92
92
|
|
93
|
-
```
|
93
|
+
```ts
|
94
94
|
import * as i18n from 'path/to/i18n/i18n.js';
|
95
95
|
|
96
96
|
const percentageFormatter = i18n.NumberFormatter.defineFormatter({
|
@@ -99,7 +99,6 @@ const percentageFormatter = i18n.NumberFormatter.defineFormatter({
|
|
99
99
|
});
|
100
100
|
```
|
101
101
|
|
102
|
-
|
103
102
|
[Intl.NumberFormat]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
|
104
103
|
[ByteUtilities.ts]: ../../../front_end/core/i18n/ByteUtilities.ts
|
105
104
|
[NumberFormatter.ts]: ../../../front_end/core/i18n/NumberFormatter.ts
|
package/eslint.config.mjs
CHANGED
@@ -720,6 +720,7 @@ export default defineConfig([
|
|
720
720
|
'rulesdir/no-assert-deep-strict-equal': 'error',
|
721
721
|
'rulesdir/no-assert-equal': 'error',
|
722
722
|
'rulesdir/no-assert-equal-boolean-null-undefined': 'error',
|
723
|
+
'rulesdir/no-capture-screenshot': 'error',
|
723
724
|
'rulesdir/no-imperative-dom-api': 'off',
|
724
725
|
'rulesdir/no-lit-render-outside-of-view': 'off',
|
725
726
|
'rulesdir/prefer-assert-instance-of': 'error',
|
@@ -6,23 +6,24 @@ A settings registration is represented by the `SettingRegistration` interface, d
|
|
6
6
|
|
7
7
|
All settings have to be registered using the function `Common.Settings.registerSettingExtension` which expects an object of type `SettingRegistration` as parameter.
|
8
8
|
|
9
|
-
As an example, take the registration of the `showHTMLComments`
|
10
|
-
|
9
|
+
As an example, take the registration of the `showHTMLComments` setting, which allows users to determine if HTML comments are shown in the Elements tree:
|
10
|
+
|
11
|
+
```ts
|
11
12
|
Common.Settings.registerSettingExtension({
|
12
|
-
category:
|
13
|
-
order:
|
14
|
-
title:
|
15
|
-
settingName:
|
16
|
-
settingType:
|
17
|
-
defaultValue:
|
13
|
+
category: Common.Settings.SettingCategory.ELEMENTS,
|
14
|
+
order: 3,
|
15
|
+
title: ls`Show HTML comments`,
|
16
|
+
settingName: 'showHTMLComments',
|
17
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
18
|
+
defaultValue: true,
|
18
19
|
options: [
|
19
20
|
{
|
20
|
-
value:
|
21
|
-
title:
|
21
|
+
value: true,
|
22
|
+
title: ls`Show HTML comments`,
|
22
23
|
},
|
23
24
|
{
|
24
|
-
value:
|
25
|
-
title:
|
25
|
+
value: false,
|
26
|
+
title: ls`Hide HTML comments`,
|
26
27
|
},
|
27
28
|
],
|
28
29
|
});
|
@@ -80,7 +80,7 @@ function normalizeBadgeName(name: string): string {
|
|
80
80
|
export const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.google.com/profile/u/me';
|
81
81
|
|
82
82
|
async function makeHttpRequest<R extends object>(request: DispatchHttpRequestRequest): Promise<R|null> {
|
83
|
-
if (!
|
83
|
+
if (!isGdpProfilesAvailable()) {
|
84
84
|
return null;
|
85
85
|
}
|
86
86
|
|
@@ -224,5 +224,20 @@ function setDebugGdpIntegrationEnabled(enabled: boolean): void {
|
|
224
224
|
}
|
225
225
|
}
|
226
226
|
|
227
|
+
export function isGdpProfilesAvailable(): boolean {
|
228
|
+
const isBaseFeatureEnabled = Boolean(Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled);
|
229
|
+
const isBrandedBuild = Boolean(Root.Runtime.hostConfig.devToolsGdpProfilesAvailability?.enabled);
|
230
|
+
const isOffTheRecordProfile = Root.Runtime.hostConfig.isOffTheRecord;
|
231
|
+
const isDisabledByEnterprisePolicy =
|
232
|
+
getGdpProfilesEnterprisePolicy() === Root.Runtime.GdpProfilesEnterprisePolicyValue.DISABLED;
|
233
|
+
return isBaseFeatureEnabled && isBrandedBuild && !isOffTheRecordProfile && !isDisabledByEnterprisePolicy;
|
234
|
+
}
|
235
|
+
|
236
|
+
export function getGdpProfilesEnterprisePolicy(): Root.Runtime.GdpProfilesEnterprisePolicyValue {
|
237
|
+
return (
|
238
|
+
Root.Runtime.hostConfig.devToolsGdpProfilesAvailability?.enterprisePolicyValue ??
|
239
|
+
Root.Runtime.GdpProfilesEnterprisePolicyValue.DISABLED);
|
240
|
+
}
|
241
|
+
|
227
242
|
// @ts-expect-error
|
228
243
|
globalThis.setDebugGdpIntegrationEnabled = setDebugGdpIntegrationEnabled;
|
@@ -511,7 +511,8 @@ export enum Action {
|
|
511
511
|
AiCodeCompletionSuggestionDisplayed = 186,
|
512
512
|
AiCodeCompletionSuggestionAccepted = 187,
|
513
513
|
AiCodeCompletionError = 188,
|
514
|
-
|
514
|
+
AttributeLinkClicked = 189,
|
515
|
+
MAX_VALUE = 190,
|
515
516
|
/* eslint-enable @typescript-eslint/naming-convention */
|
516
517
|
}
|
517
518
|
|
@@ -1194,7 +1195,8 @@ export const enum SwatchType {
|
|
1194
1195
|
ANGLE = 7,
|
1195
1196
|
LENGTH = 8,
|
1196
1197
|
POSITION_TRY_LINK = 10,
|
1197
|
-
|
1198
|
+
ATTR_LINK = 11,
|
1199
|
+
MAX_VALUE = 12,
|
1198
1200
|
}
|
1199
1201
|
|
1200
1202
|
export const enum BadgeType {
|
@@ -479,6 +479,18 @@ interface GdpProfiles {
|
|
479
479
|
starterBadgeEnabled: boolean;
|
480
480
|
}
|
481
481
|
|
482
|
+
export enum GdpProfilesEnterprisePolicyValue {
|
483
|
+
ENABLED = 0,
|
484
|
+
ENABLED_WITHOUT_BADGES = 1,
|
485
|
+
DISABLED = 2,
|
486
|
+
}
|
487
|
+
|
488
|
+
interface GdpProfilesAvailability {
|
489
|
+
// Whether GDP profiles can be enabled on this host (only possible on branded builds).
|
490
|
+
enabled: boolean;
|
491
|
+
enterprisePolicyValue: GdpProfilesEnterprisePolicyValue;
|
492
|
+
}
|
493
|
+
|
482
494
|
interface LiveEdit {
|
483
495
|
enabled: boolean;
|
484
496
|
}
|
@@ -529,6 +541,7 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
529
541
|
devToolsIpProtectionInDevTools: IpProtectionInDevTools,
|
530
542
|
devToolsGlobalAiButton: GlobalAiButton,
|
531
543
|
devToolsGdpProfiles: GdpProfiles,
|
544
|
+
devToolsGdpProfilesAvailability: GdpProfilesAvailability,
|
532
545
|
devToolsLiveEdit: LiveEdit,
|
533
546
|
devToolsFlexibleLayout: DevToolsFlexibleLayout,
|
534
547
|
}>;
|
@@ -869,14 +869,18 @@ export class CSSMatchedStyles {
|
|
869
869
|
return domCascade ? domCascade.computeAttribute(style, attributeName, type) : null;
|
870
870
|
}
|
871
871
|
|
872
|
-
|
872
|
+
originatingNodeForStyle(style: CSSStyleDeclaration): DOMNode|null {
|
873
873
|
let node: DOMNode|null = this.nodeForStyle(style) ?? this.node();
|
874
874
|
|
875
875
|
// If it's a pseudo-element, we need to find the originating element.
|
876
876
|
while (node?.pseudoType()) {
|
877
877
|
node = node.parentNode;
|
878
878
|
}
|
879
|
+
return node;
|
880
|
+
}
|
879
881
|
|
882
|
+
rawAttributeValueFromStyle(style: CSSStyleDeclaration, attributeName: string): string|null {
|
883
|
+
const node = this.originatingNodeForStyle(style);
|
880
884
|
if (!node) {
|
881
885
|
return null;
|
882
886
|
}
|
@@ -459,11 +459,11 @@ export class EnhancedTracesParser {
|
|
459
459
|
for (const orphanScript of orphanScripts) {
|
460
460
|
const orphanScriptExecutionContextIsolateId =
|
461
461
|
this.getExecutionContextIsolateId(orphanScript.isolate, orphanScript.executionContextId);
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
462
|
+
const frameId = executionContextIsolateToTarget.get(orphanScriptExecutionContextIsolateId);
|
463
|
+
|
464
|
+
if (frameId) {
|
465
|
+
// Found a link via execution context, use it.
|
466
|
+
targetToScripts.get(frameId)?.push(orphanScript);
|
467
467
|
} else if (orphanScript.pid) {
|
468
468
|
const target = targets.find(target => target.pid === orphanScript.pid);
|
469
469
|
if (target) {
|