chrome-devtools-frontend 1.0.1571007 → 1.0.1572937
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/agents/prompts/README.md +18 -0
- package/agents/prompts/devtools-imports.md +47 -0
- package/agents/prompts/verification.md +27 -0
- 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 +1 -31
- package/front_end/core/root/ExperimentNames.ts +30 -0
- package/front_end/core/root/Runtime.ts +47 -48
- 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/OverlayModel.ts +3 -2
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/devtools_compatibility.js +0 -6
- package/front_end/entrypoints/main/MainImpl.ts +44 -24
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +6 -14
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +0 -180
- 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/javascript_metadata/NativeFunctions.js +8 -0
- 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/ModelImpl.ts +0 -4
- 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 +10 -15
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +5 -4
- 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/ChatMessage.ts +3 -2
- 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/DeviceBoundSessionsModel.ts +23 -1
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +23 -0
- package/front_end/panels/application/FrameDetailsView.ts +12 -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 +9 -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 +3 -5
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +5 -5
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +35 -4
- package/front_end/panels/common/BadgeNotification.ts +17 -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 +10 -11
- 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 +16 -65
- package/front_end/panels/elements/ComputedStyleWidget.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +35 -5
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/PlatformFontsWidget.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/emulation/DeviceModeWrapper.ts +101 -62
- package/front_end/panels/explain/components/ConsoleInsight.ts +27 -23
- package/front_end/panels/explain/components/consoleInsight.css +1 -1
- package/front_end/panels/issues/IssueView.ts +6 -6
- package/front_end/panels/network/RequestConditionsDrawer.ts +4 -3
- package/front_end/panels/network/RequestCookiesView.ts +3 -4
- package/front_end/panels/network/RequestTimingView.ts +6 -10
- 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.css +2 -2
- package/front_end/panels/network/components/RequestHeadersView.ts +7 -6
- package/front_end/panels/profiler/HeapProfileView.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +2 -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 +7 -13
- 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 +4 -4
- package/front_end/panels/security/CookieControlsView.ts +2 -2
- package/front_end/panels/security/CookieReportView.ts +21 -21
- 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 +13 -15
- package/front_end/panels/settings/components/SyncSection.ts +4 -3
- 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/CallStackSidebarPane.ts +4 -1
- 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 +7 -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 +4 -3
- package/front_end/panels/timeline/TimelinePanel.ts +7 -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 +4 -3
- 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 +3 -6
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +3 -4
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +3 -4
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +10 -7
- package/front_end/ui/components/panel_feedback/panelFeedback.css +2 -2
- 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/kit/link/Link.ts +1 -14
- 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 +5 -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 +4 -1
- 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,171 +2,27 @@
|
|
|
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 '../../../models/trace/insights/insights.js';
|
|
6
|
-
import '../../../panels/timeline/components/components.js';
|
|
7
|
-
import './PerformanceAgentFlameChart.js';
|
|
8
|
-
import './CollapsibleAssistanceContentWidget.js';
|
|
9
|
-
|
|
10
5
|
import * as Common from '../../../core/common/common.js';
|
|
11
6
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
12
7
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
13
|
-
import * as GreenDev from '../../../models/greendev/greendev.js';
|
|
14
|
-
import * as Logs from '../../../models/logs/logs.js';
|
|
15
|
-
import * as NetworkTimeCalculator from '../../../models/network_time_calculator/network_time_calculator.js';
|
|
16
|
-
import * as Helpers from '../../../models/trace/helpers/helpers.js';
|
|
17
8
|
import * as Trace from '../../../models/trace/trace.js';
|
|
18
9
|
import type * as Marked from '../../../third_party/marked/marked.js';
|
|
19
|
-
import * as UI from '../../../ui/legacy/legacy.js';
|
|
20
10
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
21
11
|
import * as PanelsCommon from '../../common/common.js';
|
|
22
|
-
import * as NetworkForward from '../../network/forward/forward.js';
|
|
23
|
-
import * as Network from '../../network/network.js';
|
|
24
|
-
import * as TimelineComponents from '../../timeline/components/components.js';
|
|
25
|
-
import * as Insights from '../../timeline/components/insights/insights.js';
|
|
26
|
-
import * as Timeline from '../../timeline/timeline.js';
|
|
27
12
|
|
|
28
13
|
import {MarkdownRendererWithCodeBlock} from './MarkdownRendererWithCodeBlock.js';
|
|
29
|
-
import type * as PerformanceAgentFlameChart from './PerformanceAgentFlameChart.js';
|
|
30
14
|
|
|
31
15
|
const {html} = Lit.StaticHtml;
|
|
32
16
|
const {ref, createRef} = Lit.Directives;
|
|
33
|
-
const {widgetConfig} = UI.Widget;
|
|
34
17
|
|
|
35
18
|
export class PerformanceAgentMarkdownRenderer extends MarkdownRendererWithCodeBlock {
|
|
36
|
-
#insightRenderer = new Insights.InsightRenderer.InsightRenderer();
|
|
37
|
-
|
|
38
19
|
constructor(
|
|
39
20
|
private mainFrameId = '',
|
|
40
|
-
private lookupEvent: (key: Trace.Types.File.SerializableKey) => Trace.Types.Events.Event | null = () => null
|
|
41
|
-
private parsedTrace: Trace.TraceModel.ParsedTrace|null = null) {
|
|
21
|
+
private lookupEvent: (key: Trace.Types.File.SerializableKey) => Trace.Types.Events.Event | null = () => null) {
|
|
42
22
|
super();
|
|
43
23
|
}
|
|
44
24
|
|
|
45
25
|
override templateForToken(token: Marked.Marked.MarkedToken): Lit.LitTemplate|null {
|
|
46
|
-
if (!this.parsedTrace) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// NOTE: The custom tag handling below (e.g., <ai-insight>, <network-request-widget>)
|
|
51
|
-
// is part of a prototype for the GreenDev project and is only rendered when the GreenDev
|
|
52
|
-
// feature is enabled.
|
|
53
|
-
if (token.type === 'html' && GreenDev.Prototypes.instance().isEnabled('inlineWidgets')) {
|
|
54
|
-
if (token.text.includes('<flame-chart-widget')) {
|
|
55
|
-
const startMatch = token.text.match(/start="?(\d+)"?/);
|
|
56
|
-
const endMatch = token.text.match(/end="?(\d+)"?/);
|
|
57
|
-
const start = startMatch ? Number(startMatch[1]) : this.parsedTrace.data.Meta.traceBounds.min;
|
|
58
|
-
const end = endMatch ? Number(endMatch[1]) : this.parsedTrace.data.Meta.traceBounds.max;
|
|
59
|
-
return html`<devtools-performance-agent-flame-chart .data=${{
|
|
60
|
-
parsedTrace: this.parsedTrace,
|
|
61
|
-
start,
|
|
62
|
-
end,
|
|
63
|
-
} as PerformanceAgentFlameChart.PerformanceAgentFlameChartData}
|
|
64
|
-
}></devtools-performance-agent-flame-chart>`;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Flexible regex to match the tag name and a value a.
|
|
68
|
-
// match[1]: tagName (e.g., 'ai-insight', 'network-request-widget')
|
|
69
|
-
// match[2]: value (value needed to display the widget)
|
|
70
|
-
const regex = /<([a-z-]+)\s+value="([^"]+)">/;
|
|
71
|
-
const match = token.text.match(regex);
|
|
72
|
-
|
|
73
|
-
if (!match) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const tagName = match[1];
|
|
78
|
-
const value = match[2];
|
|
79
|
-
|
|
80
|
-
if (tagName === 'ai-insight' && value) {
|
|
81
|
-
const componentName = value;
|
|
82
|
-
|
|
83
|
-
const insightSet = this.parsedTrace.insights?.values().next().value;
|
|
84
|
-
const insightM = insightSet?.model[componentName as Trace.Insights.Types.InsightKeys];
|
|
85
|
-
|
|
86
|
-
if (!insightM) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return html`<devtools-collapsible-assistance-content-widget .data=${{
|
|
91
|
-
headerText: `Insight - ${componentName}`, onReveal: () => {
|
|
92
|
-
void UI.InspectorView.InspectorView.instance().showPanel('timeline').then(() => {
|
|
93
|
-
Timeline.TimelinePanel.TimelinePanel.instance().revealInsight(insightM);
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
}
|
|
97
|
-
}>
|
|
98
|
-
${this.#insightRenderer.renderInsightToWidgetElement(this.parsedTrace, insightSet, insightM, componentName, {
|
|
99
|
-
selected: true,
|
|
100
|
-
isAIAssistanceContext: true
|
|
101
|
-
})}
|
|
102
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
103
|
-
}
|
|
104
|
-
if (tagName === 'network-request-widget' && value) {
|
|
105
|
-
const rawTraceEvent =
|
|
106
|
-
Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().getRawTraceEvents().at(Number(value));
|
|
107
|
-
|
|
108
|
-
// Rendering RequestTimingView widget only works for fresh traces where the network log is in sync.
|
|
109
|
-
// If the trace is uploaded, we need to use the synthetic events and
|
|
110
|
-
// render the network request tooltip that uses the synthetic events.
|
|
111
|
-
if (rawTraceEvent && Trace.Types.Events.isSyntheticNetworkRequest(rawTraceEvent)) {
|
|
112
|
-
const rawTraceEventId = rawTraceEvent?.args?.data?.requestId;
|
|
113
|
-
const rawTraceEventUrl = rawTraceEvent?.args?.data?.url;
|
|
114
|
-
const networkRequest = rawTraceEvent ? Logs.NetworkLog.NetworkLog.instance()
|
|
115
|
-
.requestsForId(rawTraceEventId)
|
|
116
|
-
.find(r => r.url() === rawTraceEventUrl) :
|
|
117
|
-
null;
|
|
118
|
-
|
|
119
|
-
if (networkRequest) {
|
|
120
|
-
const calculator = new NetworkTimeCalculator.NetworkTimeCalculator(true);
|
|
121
|
-
return html`<devtools-collapsible-assistance-content-widget
|
|
122
|
-
.data=${{
|
|
123
|
-
headerText: `Network Request: ${
|
|
124
|
-
networkRequest.url().length > 80 ? networkRequest.url().slice(0, 80) + '...' : networkRequest.url()}`,
|
|
125
|
-
onReveal: () => {
|
|
126
|
-
void UI.InspectorView.InspectorView.instance().showPanel('network').then(() => {
|
|
127
|
-
void Common.Revealer.reveal(NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
128
|
-
networkRequest, NetworkForward.UIRequestLocation.UIRequestTabs.TIMING));
|
|
129
|
-
});
|
|
130
|
-
},
|
|
131
|
-
}
|
|
132
|
-
}>
|
|
133
|
-
<devtools-widget class="actions" .widgetConfig=${
|
|
134
|
-
UI.Widget.widgetConfig(Network.RequestTimingView.RequestTimingView, {
|
|
135
|
-
request: networkRequest,
|
|
136
|
-
calculator,
|
|
137
|
-
})}></devtools-widget>
|
|
138
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const syntheticRequest =
|
|
143
|
-
Helpers.SyntheticEvents.SyntheticEventsManager.getActiveManager().syntheticEventForRawEventIndex(
|
|
144
|
-
Number(value));
|
|
145
|
-
|
|
146
|
-
let networkTooltip = null;
|
|
147
|
-
if (syntheticRequest && Trace.Types.Events.isSyntheticNetworkRequest(syntheticRequest)) {
|
|
148
|
-
// clang-format off
|
|
149
|
-
networkTooltip = html`<devtools-widget .widgetConfig=${widgetConfig(TimelineComponents.NetworkRequestTooltip.NetworkRequestTooltip, {
|
|
150
|
-
networkRequest: syntheticRequest,
|
|
151
|
-
})}></devtools-widget>`;
|
|
152
|
-
// clang-format on
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return html`<devtools-collapsible-assistance-content-widget
|
|
156
|
-
.data=${{
|
|
157
|
-
headerText: 'Network Request', onReveal: () => {
|
|
158
|
-
// eslint-disable-next-line no-console
|
|
159
|
-
console.log('Reveal network request', value);
|
|
160
|
-
},
|
|
161
|
-
}
|
|
162
|
-
}>
|
|
163
|
-
${networkTooltip}
|
|
164
|
-
</devtools-collapsible-assistance-content-widget>`;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
26
|
if (token.type === 'link' && token.href.startsWith('#')) {
|
|
171
27
|
if (token.href.startsWith('#node-')) {
|
|
172
28
|
const nodeId = Number(token.href.replace('#node-', '')) as Protocol.DOM.BackendNodeId;
|
|
@@ -12,6 +12,7 @@ interface EventWithTimestamp {
|
|
|
12
12
|
}
|
|
13
13
|
export interface SessionAndEvents {
|
|
14
14
|
session?: Protocol.Network.DeviceBoundSession;
|
|
15
|
+
isSessionTerminated: boolean;
|
|
15
16
|
eventsById: Map<string, EventWithTimestamp>;
|
|
16
17
|
}
|
|
17
18
|
type SessionIdToSessionMap = Map<string|undefined, SessionAndEvents>;
|
|
@@ -91,6 +92,14 @@ export class DeviceBoundSessionsModel extends Common.ObjectWrapper.ObjectWrapper
|
|
|
91
92
|
return this.#visibleSites.has(site);
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
isSessionTerminated(site: string, sessionId?: string): boolean {
|
|
96
|
+
const session = this.getSession(site, sessionId);
|
|
97
|
+
if (session === undefined) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return session.isSessionTerminated;
|
|
101
|
+
}
|
|
102
|
+
|
|
94
103
|
getSession(site: string, sessionId?: string): SessionAndEvents|undefined {
|
|
95
104
|
return this.#siteSessions.get(site)?.get(sessionId);
|
|
96
105
|
}
|
|
@@ -116,7 +125,11 @@ export class DeviceBoundSessionsModel extends Common.ObjectWrapper.ObjectWrapper
|
|
|
116
125
|
|
|
117
126
|
let sessionAndEvent = sessionIdToSessionMap.get(sessionId);
|
|
118
127
|
if (!sessionAndEvent) {
|
|
119
|
-
sessionAndEvent = {
|
|
128
|
+
sessionAndEvent = {
|
|
129
|
+
session: undefined,
|
|
130
|
+
isSessionTerminated: false,
|
|
131
|
+
eventsById: new Map<string, EventWithTimestamp>()
|
|
132
|
+
};
|
|
120
133
|
sessionIdToSessionMap.set(sessionId, sessionAndEvent);
|
|
121
134
|
}
|
|
122
135
|
return sessionAndEvent;
|
|
@@ -145,6 +158,15 @@ export class DeviceBoundSessionsModel extends Common.ObjectWrapper.ObjectWrapper
|
|
|
145
158
|
sessionAndEvent.session.cachedChallenge = event.challengeEventDetails.challenge;
|
|
146
159
|
}
|
|
147
160
|
|
|
161
|
+
// Set the session's terminated status based on the event.
|
|
162
|
+
if (event.succeeded) {
|
|
163
|
+
if (event.terminationEventDetails) {
|
|
164
|
+
sessionAndEvent.isSessionTerminated = true;
|
|
165
|
+
} else if (event.creationEventDetails) {
|
|
166
|
+
sessionAndEvent.isSessionTerminated = false;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
148
170
|
this.dispatchEventToListeners(
|
|
149
171
|
DeviceBoundSessionModelEvents.EVENT_OCCURRED,
|
|
150
172
|
{site: eventWithTimestamp.event.site, sessionId: eventWithTimestamp.event.sessionId});
|
|
@@ -120,6 +120,25 @@ export class RootTreeElement extends ApplicationPanelTreeElement {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
#updateTerminatedSessionDisplay(site: string, sessionId: string|undefined): void {
|
|
124
|
+
const isSessionTerminated = this.#model.isSessionTerminated(site, sessionId);
|
|
125
|
+
const siteMapEntry = this.#sites.get(site);
|
|
126
|
+
if (!siteMapEntry) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const sessionElement = siteMapEntry.sessions.get(sessionId);
|
|
130
|
+
if (!sessionElement) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (isSessionTerminated) {
|
|
134
|
+
sessionElement.listItemElement.classList.add('device-bound-session-terminated');
|
|
135
|
+
sessionElement.setLeadingIcons([createIcon('database-off')]);
|
|
136
|
+
} else {
|
|
137
|
+
sessionElement.listItemElement.classList.remove('device-bound-session-terminated');
|
|
138
|
+
sessionElement.setLeadingIcons([createIcon('database')]);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
123
142
|
#addSiteSessionIfMissing(site: string, sessionId: string|undefined): void {
|
|
124
143
|
let siteMapEntry = this.#sites.get(site);
|
|
125
144
|
if (!siteMapEntry) {
|
|
@@ -144,6 +163,9 @@ export class RootTreeElement extends ApplicationPanelTreeElement {
|
|
|
144
163
|
if (!siteMapEntry.sessions.has(sessionId)) {
|
|
145
164
|
const sessionElement = new ApplicationPanelTreeElement(
|
|
146
165
|
this.resourcesPanel, sessionId ?? i18nString(UIStrings.noSession), false, 'device-bound-sessions-session');
|
|
166
|
+
if (sessionId === undefined) {
|
|
167
|
+
sessionElement.listItemElement.classList.add('no-device-bound-session');
|
|
168
|
+
}
|
|
147
169
|
sessionElement.setLeadingIcons([createIcon('database')]);
|
|
148
170
|
sessionElement.itemURL = `device-bound-sessions://${site}/${sessionId || ''}` as Platform.DevToolsPath.UrlString;
|
|
149
171
|
const defaultOnSelect = sessionElement.onselect.bind(sessionElement);
|
|
@@ -209,6 +231,7 @@ export class RootTreeElement extends ApplicationPanelTreeElement {
|
|
|
209
231
|
{data: {site, sessionId}}: Common.EventTarget
|
|
210
232
|
.EventTargetEvent<DeviceBoundSessionModelEventTypes[DeviceBoundSessionModelEvents.EVENT_OCCURRED]>): void {
|
|
211
233
|
this.#addSiteSessionIfMissing(site, sessionId);
|
|
234
|
+
this.#updateTerminatedSessionDisplay(site, sessionId);
|
|
212
235
|
}
|
|
213
236
|
|
|
214
237
|
#onClearEvents({data: {emptySessions, emptySites}}: Common.EventTarget
|
|
@@ -2,6 +2,7 @@
|
|
|
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';
|
|
5
6
|
import '../../ui/components/expandable_list/expandable_list.js';
|
|
6
7
|
import '../../ui/components/report_view/report_view.js';
|
|
7
8
|
|
|
@@ -322,10 +323,10 @@ function renderOriginTrial(trials: Protocol.Page.OriginTrial[]|null): LitTemplat
|
|
|
322
323
|
<devtools-report-section>
|
|
323
324
|
<span class="report-section">
|
|
324
325
|
${i18nString(UIStrings.originTrialsExplanation)}
|
|
325
|
-
<
|
|
326
|
-
|
|
326
|
+
<devtools-link href="https://developer.chrome.com/docs/web-platform/origin-trials/" class="link"
|
|
327
|
+
.jslogContext=${'learn-more.origin-trials'}>
|
|
327
328
|
${i18nString(UIStrings.learnMore)}
|
|
328
|
-
</
|
|
329
|
+
</devtools-link>
|
|
329
330
|
</span>
|
|
330
331
|
</devtools-report-section>
|
|
331
332
|
<devtools-widget class="span-cols" .widgetConfig=${widgetConfig(OriginTrialTreeView, {data})}>
|
|
@@ -735,11 +736,11 @@ function renderApiAvailabilitySection(frame: SDK.ResourceTreeModel.ResourceTreeF
|
|
|
735
736
|
<devtools-report-section>
|
|
736
737
|
<span class="report-section">
|
|
737
738
|
${i18nString(UIStrings.availabilityOfCertainApisDepends)}
|
|
738
|
-
<
|
|
739
|
+
<devtools-link
|
|
739
740
|
href="https://web.dev/why-coop-coep/" class="link"
|
|
740
|
-
|
|
741
|
+
.jslogContext=${'learn-more.coop-coep'}>
|
|
741
742
|
${i18nString(UIStrings.learnMore)}
|
|
742
|
-
</
|
|
743
|
+
</devtools-link>
|
|
743
744
|
</span>
|
|
744
745
|
</devtools-report-section>
|
|
745
746
|
${renderSharedArrayBufferAvailability(frame)}
|
|
@@ -814,9 +815,9 @@ function renderMeasureMemoryAvailability(frame: SDK.ResourceTreeModel.ResourceTr
|
|
|
814
815
|
<devtools-report-key>${i18nString(UIStrings.measureMemory)}</devtools-report-key>
|
|
815
816
|
<devtools-report-value>
|
|
816
817
|
<span title=${tooltipText}>${
|
|
817
|
-
availabilityText}</span>\xA0<
|
|
818
|
-
|
|
819
|
-
i18nString(UIStrings.learnMore)}</
|
|
818
|
+
availabilityText}</span>\xA0<devtools-link class="link" href="https://web.dev/monitor-total-page-memory-usage/" .jslogContext=${
|
|
819
|
+
'learn-more.monitor-memory-usage'}>${
|
|
820
|
+
i18nString(UIStrings.learnMore)}</devtools-link>
|
|
820
821
|
</devtools-report-value>
|
|
821
822
|
`;
|
|
822
823
|
}
|
|
@@ -856,7 +857,8 @@ export class FrameDetailsReportView extends UI.Widget.Widget {
|
|
|
856
857
|
|
|
857
858
|
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
858
859
|
super(element, {useShadowDom: true});
|
|
859
|
-
this.#protocolMonitorExperimentEnabled =
|
|
860
|
+
this.#protocolMonitorExperimentEnabled =
|
|
861
|
+
Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.PROTOCOL_MONITOR);
|
|
860
862
|
this.#view = view;
|
|
861
863
|
}
|
|
862
864
|
|
|
@@ -199,10 +199,10 @@ function renderMainFrameInformation(
|
|
|
199
199
|
frame.backForwardCacheDetails.explanationsTree,
|
|
200
200
|
reasonToFramesMap)}
|
|
201
201
|
<devtools-report-section>
|
|
202
|
-
<
|
|
203
|
-
|
|
202
|
+
<devtools-link href="https://web.dev/bfcache/" class="link"
|
|
203
|
+
jslogcontext="learn-more.eligibility">
|
|
204
204
|
${i18nString(UIStrings.learnMore)}
|
|
205
|
-
</
|
|
205
|
+
</devtools-link>
|
|
206
206
|
</devtools-report-section>`;
|
|
207
207
|
// clang-format on
|
|
208
208
|
}
|
|
@@ -370,12 +370,10 @@ function maybeRenderDeepLinkToUnload(explanation: Protocol.Page.BackForwardCache
|
|
|
370
370
|
if (explanation.reason === Protocol.Page.BackForwardCacheNotRestoredReason.UnloadHandlerExistsInMainFrame ||
|
|
371
371
|
explanation.reason === Protocol.Page.BackForwardCacheNotRestoredReason.UnloadHandlerExistsInSubFrame) {
|
|
372
372
|
return html`
|
|
373
|
-
<
|
|
374
|
-
|
|
375
|
-
click: true,
|
|
376
|
-
})}>
|
|
373
|
+
<devtools-link href="https://web.dev/bfcache/#never-use-the-unload-event" class="link"
|
|
374
|
+
jslogContext=${'learn-more.never-use-unload'}>
|
|
377
375
|
${i18nString(UIStrings.neverUseUnload)}
|
|
378
|
-
</
|
|
376
|
+
</devtools-link>`;
|
|
379
377
|
}
|
|
380
378
|
return nothing;
|
|
381
379
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '../../../ui/components/report_view/report_view.js';
|
|
6
6
|
import '../../../ui/legacy/components/data_grid/data_grid.js';
|
|
7
|
+
import '../../../ui/kit/kit.js';
|
|
7
8
|
|
|
8
9
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
10
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
@@ -157,10 +158,10 @@ const renderMainFrameInformation = (input: ViewInput): Lit.LitTemplate => {
|
|
|
157
158
|
<devtools-report-divider>
|
|
158
159
|
</devtools-report-divider>
|
|
159
160
|
<devtools-report-section>
|
|
160
|
-
<
|
|
161
|
-
|
|
161
|
+
<devtools-link href="https://privacycg.github.io/nav-tracking-mitigations/#bounce-tracking-mitigations" class="link"
|
|
162
|
+
.jslogContext=${'learn-more'}>
|
|
162
163
|
${i18nString(UIStrings.learnMore)}
|
|
163
|
-
</
|
|
164
|
+
</devtools-link>
|
|
164
165
|
</devtools-report-section>
|
|
165
166
|
`;
|
|
166
167
|
// clang-format on
|
|
@@ -74,8 +74,6 @@ const i18nTemplate = unboundI18nTemplate.bind(undefined, str_);
|
|
|
74
74
|
|
|
75
75
|
function renderStatusMessage(
|
|
76
76
|
protocolHandlers: readonly ProtocolHandler[], manifestLink: Platform.DevToolsPath.UrlString): TemplateResult {
|
|
77
|
-
const manifestInTextLink =
|
|
78
|
-
UI.XLink.XLink.create(manifestLink, i18nString(UIStrings.manifest), undefined, undefined, 'manifest');
|
|
79
77
|
const statusString = protocolHandlers.length > 0 ? UIStrings.protocolDetected : UIStrings.protocolNotDetected;
|
|
80
78
|
// clang-format off
|
|
81
79
|
return html`
|
|
@@ -83,7 +81,9 @@ function renderStatusMessage(
|
|
|
83
81
|
<devtools-icon class="inline-icon"
|
|
84
82
|
name=${protocolHandlers.length > 0 ? 'check-circle' : 'info'}>
|
|
85
83
|
</devtools-icon>
|
|
86
|
-
${uiI18n.
|
|
84
|
+
${uiI18n.getFormatLocalizedStringTemplate(str_, statusString, {PH1: html`
|
|
85
|
+
<devtools-link href=${manifestLink} .jslogContext=${'manifest'}>${i18nString(UIStrings.manifest)}</devtools-link>
|
|
86
|
+
` })}
|
|
87
87
|
</div>`;
|
|
88
88
|
// clang-format on
|
|
89
89
|
}
|
|
@@ -144,10 +144,9 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
144
144
|
${renderStatusMessage(input.protocolHandler, input.manifestLink)}
|
|
145
145
|
<div class="protocol-handlers-row">
|
|
146
146
|
${i18nTemplate(UIStrings.needHelpReadOur, {PH1: html`
|
|
147
|
-
<
|
|
148
|
-
VisualLogging.link('learn-more').track({click: true, keydown: 'Enter|Space'})}>
|
|
147
|
+
<devtools-link href=${PROTOCOL_DOCUMENT_URL} class="devtools-link" autofocus .jslogContext=${'learn-more'}>
|
|
149
148
|
${i18nString(UIStrings.protocolHandlerRegistrations)}
|
|
150
|
-
</
|
|
149
|
+
</devtools-link>`})}
|
|
151
150
|
</div>
|
|
152
151
|
${renderProtocolTest(input.protocolHandler, input.queryInputState, input.protocolSelectHandler,
|
|
153
152
|
input.queryInputChangeHandler, input.testProtocolClickHandler)}
|
|
@@ -2,6 +2,7 @@
|
|
|
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';
|
|
5
6
|
import '../../../ui/legacy/components/data_grid/data_grid.js';
|
|
6
7
|
|
|
7
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
@@ -80,11 +81,11 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
80
81
|
<th id="status" weight="20">
|
|
81
82
|
<style>${reportsGridStyles}</style>
|
|
82
83
|
<span class="status-header">${i18nString(UIStrings.status)}</span>
|
|
83
|
-
<
|
|
84
|
-
|
|
84
|
+
<devtools-link href="https://web.dev/reporting-api/#report-status"
|
|
85
|
+
.jslogContext=${'report-status'}>
|
|
85
86
|
<devtools-icon class="inline-icon medium" name="help" style="color: var(--icon-link);"
|
|
86
87
|
></devtools-icon>
|
|
87
|
-
</
|
|
88
|
+
</devtools-link>
|
|
88
89
|
</th>
|
|
89
90
|
<th id="destination" weight="20">${i18nString(UIStrings.destination)}</th>
|
|
90
91
|
<th id="timestamp" weight="20">${i18nString(UIStrings.generatedAt)}</th>
|
|
@@ -108,13 +109,11 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
108
109
|
<span class="empty-state-header">${i18nString(UIStrings.noReportsToDisplay)}</span>
|
|
109
110
|
<div class="empty-state-description">
|
|
110
111
|
<span>${i18nString(UIStrings.reportingApiDescription)}</span>
|
|
111
|
-
<
|
|
112
|
+
<devtools-link
|
|
112
113
|
class="devtools-link"
|
|
113
114
|
href=${REPORTING_API_EXPLANATION_URL}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
.context('learn-more')}
|
|
117
|
-
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
115
|
+
.jslogContext=${'learn-more'}
|
|
116
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
118
117
|
</div>
|
|
119
118
|
</div>
|
|
120
119
|
`}
|
|
@@ -134,7 +133,8 @@ export class ReportsGrid extends UI.Widget.Widget {
|
|
|
134
133
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
135
134
|
super(element);
|
|
136
135
|
this.#view = view;
|
|
137
|
-
this.#protocolMonitorExperimentEnabled =
|
|
136
|
+
this.#protocolMonitorExperimentEnabled =
|
|
137
|
+
Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.PROTOCOL_MONITOR);
|
|
138
138
|
this.requestUpdate();
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -2,6 +2,7 @@
|
|
|
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';
|
|
5
6
|
import '../../../ui/legacy/components/data_grid/data_grid.js';
|
|
6
7
|
|
|
7
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
@@ -97,11 +98,11 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
97
98
|
<div class="empty-state-header">${i18nString(UIStrings.noEvents)}</div>
|
|
98
99
|
<div class="empty-state-description">
|
|
99
100
|
<span>${i18nString(UIStrings.sharedStorageDescription)}</span>
|
|
100
|
-
<
|
|
101
|
-
class="
|
|
101
|
+
<devtools-link
|
|
102
|
+
class="devtools-link"
|
|
102
103
|
href=${SHARED_STORAGE_EXPLANATION_URL}
|
|
103
|
-
|
|
104
|
-
>${i18nString(UIStrings.learnMore)}</
|
|
104
|
+
.jslogContext=${'learn-more'}
|
|
105
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
105
106
|
</div>
|
|
106
107
|
</div>`
|
|
107
108
|
: html`
|
|
@@ -78,13 +78,11 @@ function renderGridOrNoDataMessage(input: TrustTokensViewInput): Lit.TemplateRes
|
|
|
78
78
|
<div class="empty-state-header">${i18nString(UIStrings.noTrustTokens)}</div>
|
|
79
79
|
<div class="empty-state-description">
|
|
80
80
|
<span>${i18nString(UIStrings.trustTokensDescription)}</span>
|
|
81
|
-
<
|
|
82
|
-
class="
|
|
81
|
+
<devtools-link
|
|
82
|
+
class="devtools-link"
|
|
83
83
|
href=${PRIVATE_STATE_TOKENS_EXPLANATION_URL}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.context('learn-more')}
|
|
87
|
-
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
84
|
+
.jslogContext=${'learn-more'}
|
|
85
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
88
86
|
</div>
|
|
89
87
|
</div>
|
|
90
88
|
</div>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
5
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
6
|
|
|
7
|
+
import '../../../ui/kit/kit.js';
|
|
7
8
|
import '../../../ui/legacy/legacy.js';
|
|
8
9
|
|
|
9
10
|
import * as Common from '../../../core/common/common.js';
|
|
@@ -253,11 +254,11 @@ export class PreloadingRuleSetView extends UI.Widget.VBox {
|
|
|
253
254
|
<span class="empty-state-header">${i18nString(UIStrings.noRulesDetected)}</span>
|
|
254
255
|
<div class="empty-state-description">
|
|
255
256
|
<span>${i18nString(UIStrings.rulesDescription)}</span>
|
|
256
|
-
<
|
|
257
|
-
class="
|
|
257
|
+
<devtools-link
|
|
258
|
+
class="devtools-link"
|
|
258
259
|
href=${SPECULATION_EXPLANATION_URL}
|
|
259
|
-
|
|
260
|
-
>${i18nString(UIStrings.learnMore)}</
|
|
260
|
+
.jslogContext=${'learn-more'}
|
|
261
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
261
262
|
</div>
|
|
262
263
|
</div>
|
|
263
264
|
<devtools-split-view sidebar-position="second">
|
|
@@ -430,11 +431,11 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
430
431
|
<span class="empty-state-header">${i18nString(UIStrings.noPrefetchAttempts)}</span>
|
|
431
432
|
<div class="empty-state-description">
|
|
432
433
|
<span>${i18nString(UIStrings.prefetchDescription)}</span>
|
|
433
|
-
<
|
|
434
|
-
class="
|
|
434
|
+
<devtools-link
|
|
435
|
+
class="devtools-link"
|
|
435
436
|
href=${SPECULATION_EXPLANATION_URL}
|
|
436
|
-
|
|
437
|
-
>${i18nString(UIStrings.learnMore)}</
|
|
437
|
+
.jslogContext=${'learn-more'}
|
|
438
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
438
439
|
</div>
|
|
439
440
|
</div>
|
|
440
441
|
<devtools-split-view sidebar-position="second">
|