chrome-devtools-frontend 1.0.1571573 → 1.0.1573331
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/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/Images/src/database-off.svg +1 -0
- package/front_end/Images/src/lock-person.svg +1 -1
- package/front_end/core/common/Debouncer.ts +10 -1
- package/front_end/core/common/SettingRegistration.ts +1 -1
- package/front_end/core/host/AidaClient.ts +8 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -6
- package/front_end/core/host/UserMetrics.ts +0 -30
- package/front_end/core/root/ExperimentNames.ts +30 -0
- package/front_end/core/root/Runtime.ts +12 -27
- package/front_end/core/root/root.ts +2 -0
- package/front_end/core/sdk/CSSModel.ts +36 -13
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +9 -0
- package/front_end/core/sdk/CookieModel.ts +2 -1
- package/front_end/core/sdk/DOMModel.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/IsolateManager.ts +0 -7
- package/front_end/core/sdk/OverlayModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/devtools_compatibility.js +0 -6
- package/front_end/entrypoints/main/MainImpl.ts +34 -25
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +4 -8
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -180
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +7 -7
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +4 -4
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +2 -2
- package/front_end/models/source_map_scopes/NamesResolver.ts +1 -1
- package/front_end/models/trace/EventsSerializer.ts +5 -1
- package/front_end/models/trace/types/TraceEvents.ts +4 -0
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -1
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +8 -63
- package/front_end/panels/ai_assistance/PatchWidget.ts +3 -4
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +1 -1
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +0 -16
- package/front_end/panels/ai_assistance/ai_assistance.ts +0 -1
- package/front_end/panels/ai_assistance/components/ChatView.ts +123 -108
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -145
- package/front_end/panels/application/AppManifestView.ts +5 -5
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +55 -4
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +46 -1
- package/front_end/panels/application/FrameDetailsView.ts +10 -10
- package/front_end/panels/application/components/BackForwardCacheView.ts +6 -8
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -3
- package/front_end/panels/application/components/ProtocolHandlersView.ts +5 -6
- package/front_end/panels/application/components/ReportsGrid.ts +8 -9
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -4
- package/front_end/panels/application/components/TrustTokensView.ts +4 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +9 -8
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +237 -230
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +6 -10
- package/front_end/panels/application/resourcesSidebar.css +8 -0
- package/front_end/panels/autofill/AutofillView.ts +4 -3
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +35 -4
- package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +18 -14
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -6
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +192 -0
- package/front_end/panels/common/aiCodeGenerationTeaser.css +16 -1
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/common/geminiRebrandPromoDialog.css +47 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +3 -3
- package/front_end/panels/console/ErrorStackParser.ts +11 -16
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +7 -54
- package/front_end/panels/elements/ElementsPanel.ts +33 -6
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +16 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +67 -32
- package/front_end/panels/elements/StylesSidebarPane.ts +28 -11
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +3 -2
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +3 -2
- package/front_end/panels/elements/elements-meta.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +7 -7
- package/front_end/panels/issues/IssueView.ts +6 -6
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -7
- package/front_end/panels/network/RequestCookiesView.ts +3 -4
- package/front_end/panels/network/RequestTimingView.ts +3 -8
- package/front_end/panels/network/components/HeaderSectionRow.ts +3 -2
- package/front_end/panels/network/components/RequestHeaderSection.ts +3 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
- package/front_end/panels/profiler/IsolateSelector.ts +1 -2
- package/front_end/panels/profiler/profiler-meta.ts +3 -3
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +4 -9
- package/front_end/panels/recorder/components/CreateRecordingView.ts +6 -6
- package/front_end/panels/recorder/components/RecordingView.ts +0 -38
- package/front_end/panels/recorder/components/ReplaySection.ts +0 -14
- package/front_end/panels/recorder/components/StepEditor.ts +2 -40
- package/front_end/panels/recorder/recorderController.css +3 -3
- package/front_end/panels/security/CookieReportView.ts +17 -17
- package/front_end/panels/security/cookieControlsView.css +1 -1
- package/front_end/panels/security/cookieReportView.css +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +8 -10
- package/front_end/panels/settings/components/SyncSection.ts +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +4 -12
- package/front_end/panels/settings/settings-meta.ts +1 -1
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +4 -4
- package/front_end/panels/sources/SourcesPanel.ts +5 -4
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -2
- package/front_end/panels/timeline/ThreadAppender.ts +2 -1
- package/front_end/panels/timeline/TimelineController.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +6 -4
- package/front_end/panels/timeline/TimelineUIUtils.ts +2 -2
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +4 -4
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +13 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +13 -9
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -19
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +3 -4
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -5
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -1
- package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/button.css +4 -0
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +5 -5
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationParser.ts +27 -8
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +36 -6
- package/front_end/ui/components/text_editor/AutocompleteHistory.ts +33 -1
- package/front_end/ui/legacy/ActionRegistration.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/EmptyWidget.ts +3 -3
- package/front_end/ui/legacy/LinkContextMenuProvider.ts +42 -0
- package/front_end/ui/legacy/ViewRegistration.ts +1 -1
- package/front_end/ui/legacy/XLink.ts +0 -27
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +4 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -2
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -1
- package/front_end/ui/legacy/legacy.ts +3 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -0
- package/package.json +1 -1
- package/front_end/models/ai_assistance/ArtifactsManager.ts +0 -67
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +0 -183
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +0 -89
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +0 -133
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +0 -15
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +0 -32
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
import '../../ui/kit/kit.js';
|
|
6
|
+
|
|
5
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
8
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
9
|
import {Directives, html, render} from '../lit/lit.js';
|
|
@@ -10,7 +12,6 @@ import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
|
10
12
|
import emptyWidgetStyles from './emptyWidget.css.js';
|
|
11
13
|
import inspectorCommonStyles from './inspectorCommon.css.js';
|
|
12
14
|
import {VBox} from './Widget.js';
|
|
13
|
-
import {XLink} from './XLink.js';
|
|
14
15
|
|
|
15
16
|
const UIStrings = {
|
|
16
17
|
/**
|
|
@@ -45,8 +46,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
45
46
|
<div class="empty-state-header">${input.header}</div>
|
|
46
47
|
<div class="empty-state-description">
|
|
47
48
|
<span>${input.text}</span>
|
|
48
|
-
${input.link ?
|
|
49
|
-
input.link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more') : ''}
|
|
49
|
+
${input.link ? html`<devtools-link href=${input.link} jslogContext=${'learn-more'}>${i18nString(UIStrings.learnMore)}</devtools-link>` : ''}
|
|
50
50
|
</div>
|
|
51
51
|
${input.extraElements}
|
|
52
52
|
</div>`, target);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright 2017 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
|
+
|
|
5
|
+
import * as Host from '../../core/host/host.js';
|
|
6
|
+
import * as UIHelpers from '../helpers/helpers.js';
|
|
7
|
+
import {Link} from '../kit/kit.js';
|
|
8
|
+
|
|
9
|
+
import type {ContextMenu, Provider} from './ContextMenu.js';
|
|
10
|
+
import {
|
|
11
|
+
copyLinkAddressLabel,
|
|
12
|
+
openLinkExternallyLabel,
|
|
13
|
+
} from './UIUtils.js';
|
|
14
|
+
import {XLink} from './XLink.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* We can move this next to the Link after
|
|
18
|
+
* the x-link is removed and the context menu
|
|
19
|
+
* is decoupled from the legacy bundle
|
|
20
|
+
*/
|
|
21
|
+
export class LinkContextMenuProvider implements Provider<Node> {
|
|
22
|
+
appendApplicableItems(_event: Event, contextMenu: ContextMenu, target: Node): void {
|
|
23
|
+
let targetNode: Node|null = target;
|
|
24
|
+
while (targetNode && !(targetNode instanceof XLink || targetNode instanceof Link)) {
|
|
25
|
+
targetNode = targetNode.parentNodeOrShadowHost();
|
|
26
|
+
}
|
|
27
|
+
if (!targetNode?.href) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const node: XLink|Link = targetNode;
|
|
31
|
+
contextMenu.revealSection().appendItem(openLinkExternallyLabel(), () => {
|
|
32
|
+
if (node.href) {
|
|
33
|
+
UIHelpers.openInNewTab(node.href);
|
|
34
|
+
}
|
|
35
|
+
}, {jslogContext: 'open-in-new-tab'});
|
|
36
|
+
contextMenu.revealSection().appendItem(copyLinkAddressLabel(), () => {
|
|
37
|
+
if (node.href) {
|
|
38
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(node.href);
|
|
39
|
+
}
|
|
40
|
+
}, {jslogContext: 'copy-link-address'});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -67,7 +67,7 @@ export interface ViewRegistration {
|
|
|
67
67
|
* The name of the experiment a view is associated with. Enabling and disabling the declared
|
|
68
68
|
* experiment will enable and disable the view respectively.
|
|
69
69
|
*/
|
|
70
|
-
experiment?: Root.
|
|
70
|
+
experiment?: Root.ExperimentNames.ExperimentName;
|
|
71
71
|
/**
|
|
72
72
|
* A condition is a function that will make the view available if it
|
|
73
73
|
* returns true, and not available, otherwise. Make sure that objects you
|
|
@@ -2,19 +2,15 @@
|
|
|
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
|
-
import * as Host from '../../core/host/host.js';
|
|
6
5
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
6
|
import * as UIHelpers from '../helpers/helpers.js';
|
|
8
7
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
9
8
|
|
|
10
9
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
11
|
-
import type {ContextMenu, Provider} from './ContextMenu.js';
|
|
12
10
|
import {html as xhtml} from './Fragment.js';
|
|
13
11
|
import {Tooltip} from './Tooltip.js';
|
|
14
12
|
import {
|
|
15
|
-
copyLinkAddressLabel,
|
|
16
13
|
MaxLengthForDisplayedURLs,
|
|
17
|
-
openLinkExternallyLabel,
|
|
18
14
|
} from './UIUtils.js';
|
|
19
15
|
import {XElement} from './XElement.js';
|
|
20
16
|
|
|
@@ -128,28 +124,5 @@ export class XLink extends XElement {
|
|
|
128
124
|
}
|
|
129
125
|
}
|
|
130
126
|
|
|
131
|
-
export class ContextMenuProvider implements Provider<Node> {
|
|
132
|
-
appendApplicableItems(_event: Event, contextMenu: ContextMenu, target: Node): void {
|
|
133
|
-
let targetNode: Node|null = target;
|
|
134
|
-
while (targetNode && !(targetNode instanceof XLink)) {
|
|
135
|
-
targetNode = targetNode.parentNodeOrShadowHost();
|
|
136
|
-
}
|
|
137
|
-
if (!targetNode?.href) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const node: XLink = targetNode;
|
|
141
|
-
contextMenu.revealSection().appendItem(openLinkExternallyLabel(), () => {
|
|
142
|
-
if (node.href) {
|
|
143
|
-
UIHelpers.openInNewTab(node.href);
|
|
144
|
-
}
|
|
145
|
-
}, {jslogContext: 'open-in-new-tab'});
|
|
146
|
-
contextMenu.revealSection().appendItem(copyLinkAddressLabel(), () => {
|
|
147
|
-
if (node.href) {
|
|
148
|
-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(node.href);
|
|
149
|
-
}
|
|
150
|
-
}, {jslogContext: 'copy-link-address'});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
127
|
// eslint-disable-next-line @devtools/enforce-custom-element-prefix
|
|
155
128
|
customElements.define('x-link', XLink);
|
|
@@ -242,7 +242,7 @@ export class ContrastDetails extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
242
242
|
this.setVisible(true);
|
|
243
243
|
this.hideNoContrastInfoAvailableMessage();
|
|
244
244
|
|
|
245
|
-
const isAPCAEnabled = Root.Runtime.experiments.isEnabled(Root.
|
|
245
|
+
const isAPCAEnabled = Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA);
|
|
246
246
|
|
|
247
247
|
const fgColor = this.contrastInfo.color();
|
|
248
248
|
const bgColor = this.contrastInfo.bgColor();
|
|
@@ -25,7 +25,7 @@ export class ContrastOverlay {
|
|
|
25
25
|
|
|
26
26
|
this.contrastRatioSVG = UI.UIUtils.createSVGChild(colorElement, 'svg', 'spectrum-contrast-container fill');
|
|
27
27
|
this.contrastRatioLines = new Map();
|
|
28
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
28
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA)) {
|
|
29
29
|
this.contrastRatioLines.set(
|
|
30
30
|
'APCA', UI.UIUtils.createSVGChild(this.contrastRatioSVG, 'path', 'spectrum-contrast-line'));
|
|
31
31
|
} else {
|
|
@@ -50,7 +50,7 @@ export class ContrastOverlay {
|
|
|
50
50
|
if (!this.visible || this.contrastInfo.isNull()) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
53
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA) &&
|
|
54
54
|
this.contrastInfo.contrastRatioAPCA() === null) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -91,7 +91,7 @@ export class ContrastRatioLineBuilder {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
drawContrastRatioLine(width: number, height: number, level: string): string|null {
|
|
94
|
-
const isAPCA = Root.Runtime.experiments.isEnabled(Root.
|
|
94
|
+
const isAPCA = Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA);
|
|
95
95
|
const requiredContrast =
|
|
96
96
|
isAPCA ? this.contrastInfo.contrastRatioAPCAThreshold() : this.contrastInfo.contrastRatioThreshold(level);
|
|
97
97
|
if (!width || !height || requiredContrast === null) {
|
|
@@ -140,7 +140,7 @@ export class ContrastRatioLineBuilder {
|
|
|
140
140
|
Common.ColorUtils.blendColors(Common.Color.Legacy.fromHSVA(candidateHSVA).rgba(), bgRGBA));
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
if (Root.Runtime.experiments.isEnabled(Root.
|
|
143
|
+
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.APCA)) {
|
|
144
144
|
candidateLuminance = (candidateHSVA: Common.ColorUtils.Color4D) => {
|
|
145
145
|
return Common.ColorUtils.luminanceAPCA(
|
|
146
146
|
Common.ColorUtils.blendColors(Common.Color.Legacy.fromHSVA(candidateHSVA).rgba(), bgRGBA));
|
|
@@ -1252,8 +1252,8 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1252
1252
|
if (this.property.object) {
|
|
1253
1253
|
contextMenu.appendApplicableItems(this.property.object);
|
|
1254
1254
|
if (this.property.parent?.object instanceof SDK.RemoteObject.LocalJSONObject) {
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1255
|
+
const {object: {value}} = this.property;
|
|
1256
|
+
const propertyValue = typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
|
|
1257
1257
|
const copyValueHandler = (): void => {
|
|
1258
1258
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue);
|
|
1259
1259
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText((propertyValue as string | undefined));
|
|
@@ -91,7 +91,7 @@ Common.Settings.registerSettingExtension({
|
|
|
91
91
|
|
|
92
92
|
Common.Settings.registerSettingExtension({
|
|
93
93
|
category: Common.Settings.SettingCategory.MEMORY,
|
|
94
|
-
experiment: Root.
|
|
94
|
+
experiment: Root.ExperimentNames.ExperimentName.LIVE_HEAP_PROFILE,
|
|
95
95
|
title: i18nLazyString(UIStrings.liveMemoryAllocationAnnotations),
|
|
96
96
|
settingName: 'memory-live-heap-profile',
|
|
97
97
|
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
@@ -24,6 +24,7 @@ import * as InplaceEditor from './InplaceEditor.js';
|
|
|
24
24
|
import inspectorCommonStyles from './inspectorCommon.css.js';
|
|
25
25
|
import * as InspectorView from './InspectorView.js';
|
|
26
26
|
import * as KeyboardShortcut from './KeyboardShortcut.js';
|
|
27
|
+
import * as LinkContextMenuProvider from './LinkContextMenuProvider.js';
|
|
27
28
|
import * as ListControl from './ListControl.js';
|
|
28
29
|
import * as ListModel from './ListModel.js';
|
|
29
30
|
import * as ListWidget from './ListWidget.js';
|
|
@@ -77,6 +78,7 @@ export {
|
|
|
77
78
|
inspectorCommonStyles,
|
|
78
79
|
InspectorView,
|
|
79
80
|
KeyboardShortcut,
|
|
81
|
+
LinkContextMenuProvider,
|
|
80
82
|
ListControl,
|
|
81
83
|
ListModel,
|
|
82
84
|
ListWidget,
|
|
@@ -105,5 +107,5 @@ export {
|
|
|
105
107
|
Widget,
|
|
106
108
|
XElement,
|
|
107
109
|
XLink,
|
|
108
|
-
ZoomManager
|
|
110
|
+
ZoomManager
|
|
109
111
|
};
|
|
@@ -354,6 +354,7 @@ export const knownContextValues = new Set([
|
|
|
354
354
|
'ai-code-completion-teaser.fre',
|
|
355
355
|
'ai-code-generation-disclaimer',
|
|
356
356
|
'ai-code-generation-teaser.info-button',
|
|
357
|
+
'ai-code-generation-teaser.show-disclaimer-info-tooltip',
|
|
357
358
|
'ai-code-generation-upgrade-dialog.continue',
|
|
358
359
|
'ai-code-generation-upgrade-dialog.manage-in-settings',
|
|
359
360
|
'ai-explorer',
|
|
@@ -1740,6 +1741,7 @@ export const knownContextValues = new Set([
|
|
|
1740
1741
|
'gdp-profile',
|
|
1741
1742
|
'gdp-sign-up-dialog',
|
|
1742
1743
|
'gdp.ai-conversation-count',
|
|
1744
|
+
'gemini-rebranding-dialog-shown',
|
|
1743
1745
|
'gen-ai-settings-panel',
|
|
1744
1746
|
'general',
|
|
1745
1747
|
'generative-ai-terms-of-service',
|
|
@@ -266,6 +266,9 @@ export async function process(): Promise<void> {
|
|
|
266
266
|
const root = nonDomRoots[i];
|
|
267
267
|
for (const {loggable, config, parent, size} of getNonDomLoggables(root)) {
|
|
268
268
|
const loggingState = getOrCreateLoggingState(loggable, config, parent);
|
|
269
|
+
if (loggingState.impressionLogged) {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
269
272
|
if (size) {
|
|
270
273
|
loggingState.size = size;
|
|
271
274
|
}
|
package/package.json
CHANGED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
|
|
5
|
-
import type * as SDK from '../../core/sdk/sdk.js';
|
|
6
|
-
import type * as Trace from '../../models/trace/trace.js';
|
|
7
|
-
import type {InsightKeys} from '../trace/insights/types.js';
|
|
8
|
-
|
|
9
|
-
export interface InsightArtifact {
|
|
10
|
-
type: 'insight';
|
|
11
|
-
insightType: InsightKeys;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NetworkRequestArtifact {
|
|
15
|
-
type: 'network-request';
|
|
16
|
-
request: SDK.NetworkRequest.NetworkRequest|Trace.Types.Events.SyntheticNetworkRequest;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface FlameChartArtifact {
|
|
20
|
-
type: 'flamechart';
|
|
21
|
-
start: Trace.Types.Timing.Micro;
|
|
22
|
-
end: Trace.Types.Timing.Micro;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export type Artifact = InsightArtifact|NetworkRequestArtifact|FlameChartArtifact;
|
|
26
|
-
|
|
27
|
-
export class ArtifactAddedEvent extends Event {
|
|
28
|
-
static readonly eventName = 'artifactadded';
|
|
29
|
-
|
|
30
|
-
constructor(public artifact: Artifact) {
|
|
31
|
-
super(ArtifactAddedEvent.eventName);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let instance: ArtifactsManager|null = null;
|
|
36
|
-
|
|
37
|
-
export class ArtifactsManager extends EventTarget {
|
|
38
|
-
#artifacts: Artifact[] = [];
|
|
39
|
-
|
|
40
|
-
static instance(): ArtifactsManager {
|
|
41
|
-
if (!instance) {
|
|
42
|
-
instance = new ArtifactsManager();
|
|
43
|
-
}
|
|
44
|
-
return instance;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static removeInstance(): void {
|
|
48
|
-
instance = null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private constructor() {
|
|
52
|
-
super();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
get artifacts(): Artifact[] {
|
|
56
|
-
return this.#artifacts;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
addArtifact(artifact: Artifact): void {
|
|
60
|
-
this.#artifacts.push(artifact);
|
|
61
|
-
this.dispatchEvent(new ArtifactAddedEvent(artifact));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
clear(): void {
|
|
65
|
-
this.#artifacts = [];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
|
|
5
|
-
import './CollapsibleAssistanceContentWidget.js';
|
|
6
|
-
import './PerformanceAgentFlameChart.js';
|
|
7
|
-
|
|
8
|
-
import * as Common from '../../../core/common/common.js';
|
|
9
|
-
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
10
|
-
import * as Logs from '../../../models/logs/logs.js';
|
|
11
|
-
import * as NetworkTimeCalculator from '../../../models/network_time_calculator/network_time_calculator.js';
|
|
12
|
-
import * as Trace from '../../../models/trace/trace.js';
|
|
13
|
-
import * as UI from '../../../ui/legacy/legacy.js';
|
|
14
|
-
import * as Lit from '../../../ui/lit/lit.js';
|
|
15
|
-
import * as NetworkForward from '../../network/forward/forward.js';
|
|
16
|
-
import * as Network from '../../network/network.js';
|
|
17
|
-
import * as Insights from '../../timeline/components/insights/insights.js';
|
|
18
|
-
import * as Timeline from '../../timeline/timeline.js';
|
|
19
|
-
|
|
20
|
-
import artifactsViewerStyles from './artifactsViewer.css.js';
|
|
21
|
-
import type * as PerformanceAgentFlameChart from './PerformanceAgentFlameChart.js';
|
|
22
|
-
|
|
23
|
-
const {html, render} = Lit;
|
|
24
|
-
|
|
25
|
-
export interface ViewInput {
|
|
26
|
-
artifacts: AiAssistanceModel.ArtifactsManager.Artifact[];
|
|
27
|
-
parsedTrace: Trace.TraceModel.ParsedTrace;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function renderArtifact(
|
|
31
|
-
artifact: AiAssistanceModel.ArtifactsManager.Artifact, parsedTrace: Trace.TraceModel.ParsedTrace): Lit.LitTemplate {
|
|
32
|
-
switch (artifact.type) {
|
|
33
|
-
// clang-format off
|
|
34
|
-
case 'insight': {
|
|
35
|
-
const insightRenderer = new Insights.InsightRenderer.InsightRenderer();
|
|
36
|
-
const componentName = artifact.insightType;
|
|
37
|
-
const insightSet = parsedTrace.insights?.values().next().value;
|
|
38
|
-
const insightModel = insightSet?.model[componentName as Trace.Insights.Types.InsightKeys];
|
|
39
|
-
|
|
40
|
-
if (!insightModel) {
|
|
41
|
-
return Lit.nothing;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return html`
|
|
45
|
-
<devtools-collapsible-assistance-content-widget .data=${{
|
|
46
|
-
headerText: `Insight - ${componentName}`,
|
|
47
|
-
onReveal: () => {
|
|
48
|
-
void UI.InspectorView.InspectorView.instance().showPanel('timeline').then(() => {
|
|
49
|
-
Timeline.TimelinePanel.TimelinePanel.instance().revealInsight(insightModel);
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
}}>
|
|
53
|
-
${insightRenderer.renderInsightToWidgetElement(parsedTrace, insightSet, insightModel, componentName, {
|
|
54
|
-
selected: true,
|
|
55
|
-
isAIAssistanceContext: true,
|
|
56
|
-
})}
|
|
57
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
58
|
-
}
|
|
59
|
-
case 'network-request': {
|
|
60
|
-
const networkRequest = artifact.request;
|
|
61
|
-
if ('args' in networkRequest && Trace.Types.Events.isSyntheticNetworkRequest(networkRequest)) {
|
|
62
|
-
const calculator = new NetworkTimeCalculator.NetworkTimeCalculator(true);
|
|
63
|
-
const sdkRequest = Logs.NetworkLog.NetworkLog.instance()
|
|
64
|
-
.requestsForId(networkRequest.args.data.requestId)
|
|
65
|
-
.find(r => r.url() === networkRequest.args.data.url) ??
|
|
66
|
-
null;
|
|
67
|
-
if (!sdkRequest) {
|
|
68
|
-
return Lit.nothing;
|
|
69
|
-
}
|
|
70
|
-
return html`
|
|
71
|
-
<devtools-collapsible-assistance-content-widget
|
|
72
|
-
.data=${{
|
|
73
|
-
headerText: `Network Request: ${
|
|
74
|
-
sdkRequest.url().length > 80 ? sdkRequest.url().slice(0, 80) + '...' : sdkRequest.url()}`,
|
|
75
|
-
onReveal: () => {
|
|
76
|
-
void UI.InspectorView.InspectorView.instance().showPanel('network').then(() => {
|
|
77
|
-
void Common.Revealer.reveal(NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
78
|
-
sdkRequest, NetworkForward.UIRequestLocation.UIRequestTabs.TIMING));
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
}}>
|
|
82
|
-
<devtools-widget class="actions" .widgetConfig=${UI.Widget.widgetConfig(Network.RequestTimingView.RequestTimingView, {
|
|
83
|
-
request: sdkRequest,
|
|
84
|
-
calculator,
|
|
85
|
-
})}></devtools-widget>
|
|
86
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
87
|
-
}
|
|
88
|
-
return Lit.nothing;
|
|
89
|
-
}
|
|
90
|
-
case 'flamechart': {
|
|
91
|
-
return html`
|
|
92
|
-
<devtools-collapsible-assistance-content-widget .data=${{
|
|
93
|
-
headerText: `Flamechart`,
|
|
94
|
-
onReveal: () => {
|
|
95
|
-
// eslint-disable-next-line no-console
|
|
96
|
-
console.log('Reveal flamechart', artifact.start, artifact.end);
|
|
97
|
-
},
|
|
98
|
-
}}>
|
|
99
|
-
<devtools-performance-agent-flame-chart .data=${{
|
|
100
|
-
parsedTrace,
|
|
101
|
-
start: artifact.start,
|
|
102
|
-
end: artifact.end,
|
|
103
|
-
} as PerformanceAgentFlameChart.PerformanceAgentFlameChartData}>
|
|
104
|
-
</devtools-performance-agent-flame-chart>
|
|
105
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
106
|
-
}
|
|
107
|
-
default:
|
|
108
|
-
return Lit.nothing;
|
|
109
|
-
// clang-format on
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const DEFAULT_VIEW = (
|
|
114
|
-
input: ViewInput,
|
|
115
|
-
_output: Record<string, unknown>,
|
|
116
|
-
target: HTMLElement,
|
|
117
|
-
): void => {
|
|
118
|
-
// clang-format off
|
|
119
|
-
render(
|
|
120
|
-
html`
|
|
121
|
-
<style>${artifactsViewerStyles}</style>
|
|
122
|
-
<div class="artifacts-viewer">
|
|
123
|
-
${input.artifacts.map(artifact => renderArtifact(artifact, input.parsedTrace))}
|
|
124
|
-
</div>
|
|
125
|
-
`,
|
|
126
|
-
target
|
|
127
|
-
);
|
|
128
|
-
// clang-format on
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export type View = typeof DEFAULT_VIEW;
|
|
132
|
-
|
|
133
|
-
export class ArtifactsViewer extends UI.Widget.Widget {
|
|
134
|
-
#view: View;
|
|
135
|
-
#parsedTrace: Trace.TraceModel.ParsedTrace|null;
|
|
136
|
-
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
137
|
-
super(element);
|
|
138
|
-
this.#view = view;
|
|
139
|
-
this.#parsedTrace = null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
override wasShown(): void {
|
|
143
|
-
super.wasShown();
|
|
144
|
-
AiAssistanceModel.ArtifactsManager.ArtifactsManager.instance().addEventListener(
|
|
145
|
-
AiAssistanceModel.ArtifactsManager.ArtifactAddedEvent.eventName,
|
|
146
|
-
() => {
|
|
147
|
-
if (this.#parsedTrace) {
|
|
148
|
-
this.performUpdate();
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
UI.Context.Context.instance().addFlavorChangeListener(
|
|
154
|
-
AiAssistanceModel.AIContext.AgentFocus,
|
|
155
|
-
({data}) => {
|
|
156
|
-
this.#parsedTrace = data.parsedTrace;
|
|
157
|
-
if (this.#parsedTrace) {
|
|
158
|
-
this.performUpdate();
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
const focus = UI.Context.Context.instance().flavor(AiAssistanceModel.AIContext.AgentFocus);
|
|
164
|
-
if (focus) {
|
|
165
|
-
this.#parsedTrace = focus.parsedTrace;
|
|
166
|
-
this.performUpdate();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
override performUpdate(): void {
|
|
171
|
-
if (!this.#parsedTrace) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
this.#view(
|
|
175
|
-
{
|
|
176
|
-
artifacts: AiAssistanceModel.ArtifactsManager.ArtifactsManager.instance().artifacts,
|
|
177
|
-
parsedTrace: this.#parsedTrace,
|
|
178
|
-
},
|
|
179
|
-
{},
|
|
180
|
-
this.contentElement,
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 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
|
-
|
|
5
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
|
-
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
7
|
-
import * as Lit from '../../../ui/lit/lit.js';
|
|
8
|
-
|
|
9
|
-
import styles from './collapsibleAssistanceContentWidget.css.js';
|
|
10
|
-
|
|
11
|
-
const {render, html} = Lit;
|
|
12
|
-
|
|
13
|
-
export interface CollapsibleAssistanceContentWidgetData {
|
|
14
|
-
headerText: string;
|
|
15
|
-
onReveal?: () => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class CollapsibleAssistanceContentWidget extends HTMLElement {
|
|
19
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
20
|
-
#isCollapsed = false;
|
|
21
|
-
#headerText = 'Details';
|
|
22
|
-
#onReveal?: () => void;
|
|
23
|
-
|
|
24
|
-
set data(data: CollapsibleAssistanceContentWidgetData) {
|
|
25
|
-
this.#headerText = data.headerText;
|
|
26
|
-
this.#onReveal = data.onReveal;
|
|
27
|
-
this.#render();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
connectedCallback(): void {
|
|
31
|
-
this.#render();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
#toggleCollapse(): void {
|
|
35
|
-
this.#isCollapsed = !this.#isCollapsed;
|
|
36
|
-
this.#render();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#render(): void {
|
|
40
|
-
// clang-format off
|
|
41
|
-
const output = html`
|
|
42
|
-
<style>${styles}</style>
|
|
43
|
-
<details ?open=${!this.#isCollapsed}>
|
|
44
|
-
<summary class="header" @click=${(event: Event) => {
|
|
45
|
-
event.preventDefault();
|
|
46
|
-
this.#toggleCollapse();
|
|
47
|
-
}}>
|
|
48
|
-
${this.#headerText}
|
|
49
|
-
<div>
|
|
50
|
-
<devtools-button .data=${{
|
|
51
|
-
variant: Buttons.Button.Variant.ICON,
|
|
52
|
-
iconName: 'select-element',
|
|
53
|
-
color: 'var(--sys-color-on-surface)',
|
|
54
|
-
width: '14px',
|
|
55
|
-
height: '14px',
|
|
56
|
-
title: 'reveal',
|
|
57
|
-
} as Buttons.Button.ButtonData}
|
|
58
|
-
@click=${(event: Event) => {
|
|
59
|
-
event.stopPropagation();
|
|
60
|
-
this.#onReveal?.();
|
|
61
|
-
}}
|
|
62
|
-
></devtools-button>
|
|
63
|
-
<devtools-button .data=${{
|
|
64
|
-
variant: Buttons.Button.Variant.ICON,
|
|
65
|
-
iconName: this.#isCollapsed ? 'triangle-right' : 'triangle-down',
|
|
66
|
-
color: 'var(--sys-color-on-surface)',
|
|
67
|
-
width: '14px',
|
|
68
|
-
height: '14px',
|
|
69
|
-
title: 'expand',
|
|
70
|
-
} as Buttons.Button.ButtonData}
|
|
71
|
-
></devtools-button>
|
|
72
|
-
</div>
|
|
73
|
-
</summary>
|
|
74
|
-
<div class="content">
|
|
75
|
-
<slot></slot>
|
|
76
|
-
</div>
|
|
77
|
-
</details>
|
|
78
|
-
`;
|
|
79
|
-
render(output, this.#shadow, {host: this});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
customElements.define('devtools-collapsible-assistance-content-widget', CollapsibleAssistanceContentWidget);
|
|
84
|
-
|
|
85
|
-
declare global {
|
|
86
|
-
interface HTMLElementTagNameMap {
|
|
87
|
-
'devtools-collapsible-assistance-content-widget': CollapsibleAssistanceContentWidget;
|
|
88
|
-
}
|
|
89
|
-
}
|