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
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import '../../../../ui/components/report_view/report_view.js';
|
|
7
7
|
import '../../../../ui/components/request_link_icon/request_link_icon.js';
|
|
8
|
-
import '../../../../ui/legacy/components/utils/utils.js';
|
|
9
8
|
|
|
10
9
|
import * as Common from '../../../../core/common/common.js';
|
|
11
10
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
@@ -15,6 +14,8 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
15
14
|
import * as Protocol from '../../../../generated/protocol.js';
|
|
16
15
|
import * as Logs from '../../../../models/logs/logs.js';
|
|
17
16
|
import * as Buttons from '../../../../ui/components/buttons/buttons.js';
|
|
17
|
+
import * as LegacyWrapper from '../../../../ui/components/legacy_wrapper/legacy_wrapper.js';
|
|
18
|
+
import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';
|
|
18
19
|
import * as UI from '../../../../ui/legacy/legacy.js';
|
|
19
20
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
20
21
|
import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
|
|
@@ -155,278 +156,284 @@ interface PreloadingDetailsReportViewDataInternal {
|
|
|
155
156
|
requestResolver?: Logs.RequestResolver.RequestResolver;
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
export
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
export class PreloadingDetailsReportView extends LegacyWrapper.LegacyWrapper.WrappableComponent<UI.Widget.VBox> {
|
|
160
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
161
|
+
#data: PreloadingDetailsReportViewData = null;
|
|
162
|
+
|
|
163
|
+
set data(data: PreloadingDetailsReportViewData) {
|
|
164
|
+
this.#data = data;
|
|
165
|
+
void this.#render();
|
|
166
|
+
}
|
|
164
167
|
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
async #render(): Promise<void> {
|
|
169
|
+
await RenderCoordinator.write('PreloadingDetailsReportView render', () => {
|
|
170
|
+
if (this.#data === null) {
|
|
171
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
172
|
+
// clang-format off
|
|
173
|
+
Lit.render(html`
|
|
174
|
+
<style>${preloadingDetailsReportViewStyles}</style>
|
|
175
|
+
<style>${UI.inspectorCommonStyles}</style>
|
|
176
|
+
<div class="empty-state">
|
|
177
|
+
<span class="empty-state-header">${i18nString(UIStrings.noElementSelected)}</span>
|
|
178
|
+
<span class="empty-state-description">${i18nString(UIStrings.selectAnElementForMoreDetails)}</span>
|
|
179
|
+
</div>
|
|
180
|
+
`, this.#shadow, {host: this});
|
|
181
|
+
// clang-format on
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
167
184
|
|
|
168
|
-
|
|
185
|
+
const pipeline = this.#data.pipeline;
|
|
186
|
+
const pageURL = this.#data.pageURL;
|
|
187
|
+
const isFallbackToPrefetch = pipeline.getPrerender()?.status === SDK.PreloadingModel.PreloadingStatus.FAILURE &&
|
|
188
|
+
(pipeline.getPrefetch()?.status === SDK.PreloadingModel.PreloadingStatus.READY ||
|
|
189
|
+
pipeline.getPrefetch()?.status === SDK.PreloadingModel.PreloadingStatus.SUCCESS);
|
|
190
|
+
|
|
191
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
192
|
+
// clang-format off
|
|
193
|
+
Lit.render(html`
|
|
194
|
+
<style>${preloadingDetailsReportViewStyles}</style>
|
|
195
|
+
<style>${UI.inspectorCommonStyles}</style>
|
|
196
|
+
<devtools-report
|
|
197
|
+
.data=${{reportTitle: 'Speculative Loading Attempt'}}
|
|
198
|
+
jslog=${VisualLogging.section('preloading-details')}>
|
|
199
|
+
<devtools-report-section-header>${i18nString(UIStrings.detailsDetailedInformation)}</devtools-report-section-header>
|
|
200
|
+
|
|
201
|
+
${this.#url()}
|
|
202
|
+
${this.#action(isFallbackToPrefetch)}
|
|
203
|
+
${this.#status(isFallbackToPrefetch)}
|
|
204
|
+
${this.#targetHint()}
|
|
205
|
+
${this.#maybePrefetchFailureReason()}
|
|
206
|
+
${this.#maybePrerenderFailureReason()}
|
|
207
|
+
|
|
208
|
+
${this.#data.ruleSets.map(ruleSet => this.#renderRuleSet(ruleSet, pageURL))}
|
|
209
|
+
</devtools-report>
|
|
210
|
+
`, this.#shadow, {host: this});
|
|
211
|
+
// clang-format on
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
#url(): Lit.LitTemplate {
|
|
216
|
+
assertNotNullOrUndefined(this.#data);
|
|
217
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
218
|
+
|
|
219
|
+
const prefetchStatus = this.#data.pipeline.getPrefetch()?.status;
|
|
220
|
+
|
|
221
|
+
let value;
|
|
222
|
+
if (attempt.action === Protocol.Preload.SpeculationAction.Prefetch && attempt.requestId !== undefined &&
|
|
223
|
+
prefetchStatus !== SDK.PreloadingModel.PreloadingStatus.NOT_TRIGGERED) {
|
|
224
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
225
|
+
// clang-format off
|
|
226
|
+
const {requestId, key: {url}} = attempt;
|
|
227
|
+
const affectedRequest: {requestId?: Protocol.Network.RequestId, url?: string} = {requestId, url};
|
|
228
|
+
value = html`
|
|
229
|
+
<devtools-request-link-icon
|
|
230
|
+
.data=${
|
|
231
|
+
{
|
|
232
|
+
affectedRequest,
|
|
233
|
+
requestResolver: this.#data.requestResolver || new Logs.RequestResolver.RequestResolver(),
|
|
234
|
+
displayURL: true,
|
|
235
|
+
urlToDisplay: url,
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
>
|
|
239
|
+
</devtools-request-link-icon>
|
|
240
|
+
`;
|
|
241
|
+
} else {
|
|
242
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
243
|
+
// clang-format off
|
|
244
|
+
value = html`
|
|
245
|
+
<div class="text-ellipsis" title=${attempt.key.url}>${attempt.key.url}</div>
|
|
246
|
+
`;
|
|
247
|
+
// clang-format on
|
|
248
|
+
}
|
|
169
249
|
|
|
170
|
-
let value;
|
|
171
|
-
if (attempt.action === Protocol.Preload.SpeculationAction.Prefetch && attempt.requestId !== undefined &&
|
|
172
|
-
prefetchStatus !== SDK.PreloadingModel.PreloadingStatus.NOT_TRIGGERED) {
|
|
173
250
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
174
251
|
// clang-format off
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
affectedRequest,
|
|
182
|
-
requestResolver: data.requestResolver || new Logs.RequestResolver.RequestResolver(),
|
|
183
|
-
displayURL: true,
|
|
184
|
-
urlToDisplay: url,
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
>
|
|
188
|
-
</devtools-request-link-icon>
|
|
252
|
+
return html`
|
|
253
|
+
<devtools-report-key>${i18n.i18n.lockedString('URL')}</devtools-report-key>
|
|
254
|
+
<devtools-report-value>
|
|
255
|
+
${value}
|
|
256
|
+
</devtools-report-value>
|
|
189
257
|
`;
|
|
190
|
-
|
|
191
|
-
value = html`<div class="text-ellipsis" title=${attempt.key.url}>${attempt.key.url}</div>`;
|
|
258
|
+
// clang-format on
|
|
192
259
|
}
|
|
193
260
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
<devtools-report-value>
|
|
199
|
-
${value}
|
|
200
|
-
</devtools-report-value>
|
|
201
|
-
`;
|
|
202
|
-
// clang-format on
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function isPrerenderLike(speculationAction: Protocol.Preload.SpeculationAction): boolean {
|
|
206
|
-
return [
|
|
207
|
-
Protocol.Preload.SpeculationAction.Prerender, Protocol.Preload.SpeculationAction.PrerenderUntilScript
|
|
208
|
-
].includes(speculationAction);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function action(data: PreloadingDetailsReportViewDataInternal, isFallbackToPrefetch: boolean): Lit.LitTemplate {
|
|
212
|
-
const attempt = data.pipeline.getOriginallyTriggered();
|
|
213
|
-
|
|
214
|
-
const action = PreloadingString.capitalizedAction(attempt.action);
|
|
215
|
-
|
|
216
|
-
let maybeFallback: Lit.LitTemplate = Lit.nothing;
|
|
217
|
-
if (isFallbackToPrefetch) {
|
|
218
|
-
maybeFallback = html`${i18nString(UIStrings.automaticallyFellBackToPrefetch)}`;
|
|
261
|
+
#isPrerenderLike(speculationAction: Protocol.Preload.SpeculationAction): boolean {
|
|
262
|
+
return [
|
|
263
|
+
Protocol.Preload.SpeculationAction.Prerender, Protocol.Preload.SpeculationAction.PrerenderUntilScript
|
|
264
|
+
].includes(speculationAction);
|
|
219
265
|
}
|
|
220
266
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
267
|
+
#action(isFallbackToPrefetch: boolean): Lit.LitTemplate {
|
|
268
|
+
assertNotNullOrUndefined(this.#data);
|
|
269
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
270
|
+
|
|
271
|
+
const action = PreloadingString.capitalizedAction(attempt.action);
|
|
226
272
|
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
|
|
273
|
+
let maybeFallback: Lit.LitTemplate = Lit.nothing;
|
|
274
|
+
if (isFallbackToPrefetch) {
|
|
275
|
+
maybeFallback = html`${i18nString(UIStrings.automaticallyFellBackToPrefetch)}`;
|
|
230
276
|
}
|
|
231
277
|
|
|
232
|
-
|
|
233
|
-
|
|
278
|
+
let maybeInspectButton: Lit.LitTemplate = Lit.nothing;
|
|
279
|
+
(() => {
|
|
280
|
+
if (!this.#isPrerenderLike(attempt.action)) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
234
283
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (prerenderTarget === undefined) {
|
|
284
|
+
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
285
|
+
if (target === null) {
|
|
238
286
|
return;
|
|
239
287
|
}
|
|
240
|
-
|
|
241
|
-
|
|
288
|
+
|
|
289
|
+
const prerenderTarget = SDK.TargetManager.TargetManager.instance().targets().find(
|
|
290
|
+
child => child.targetInfo()?.subtype === 'prerender' && child.inspectedURL() === attempt.key.url);
|
|
291
|
+
|
|
292
|
+
const disabled = (prerenderTarget === undefined);
|
|
293
|
+
const inspect = (): void => {
|
|
294
|
+
if (prerenderTarget === undefined) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
UI.Context.Context.instance().setFlavor(SDK.Target.Target, prerenderTarget);
|
|
298
|
+
};
|
|
299
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
300
|
+
// clang-format off
|
|
301
|
+
maybeInspectButton = html`
|
|
302
|
+
<devtools-button
|
|
303
|
+
@click=${inspect}
|
|
304
|
+
.title=${i18nString(UIStrings.buttonClickToInspect)}
|
|
305
|
+
.size=${Buttons.Button.Size.SMALL}
|
|
306
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
307
|
+
.disabled=${disabled}
|
|
308
|
+
jslog=${VisualLogging.action('inspect-prerendered-page').track({click: true})}
|
|
309
|
+
>
|
|
310
|
+
${i18nString(UIStrings.buttonInspect)}
|
|
311
|
+
</devtools-button>
|
|
312
|
+
`;
|
|
313
|
+
// clang-format on
|
|
314
|
+
})();
|
|
315
|
+
|
|
242
316
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
243
317
|
// clang-format off
|
|
244
|
-
|
|
245
|
-
<devtools-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
jslog=${VisualLogging.action('inspect-prerendered-page').track({click: true})}
|
|
252
|
-
>
|
|
253
|
-
${i18nString(UIStrings.buttonInspect)}
|
|
254
|
-
</devtools-button>
|
|
318
|
+
return html`
|
|
319
|
+
<devtools-report-key>${i18nString(UIStrings.detailsAction)}</devtools-report-key>
|
|
320
|
+
<devtools-report-value>
|
|
321
|
+
<div class="text-ellipsis" title="">
|
|
322
|
+
${action} ${maybeFallback} ${maybeInspectButton}
|
|
323
|
+
</div>
|
|
324
|
+
</devtools-report-value>
|
|
255
325
|
`;
|
|
256
326
|
// clang-format on
|
|
257
|
-
}
|
|
327
|
+
}
|
|
258
328
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
<devtools-report-key>${i18nString(UIStrings.detailsAction)}</devtools-report-key>
|
|
263
|
-
<devtools-report-value>
|
|
264
|
-
<div class="text-ellipsis" title="">
|
|
265
|
-
${action} ${maybeFallback} ${maybeInspectButton}
|
|
266
|
-
</div>
|
|
267
|
-
</devtools-report-value>
|
|
268
|
-
`;
|
|
269
|
-
// clang-format on
|
|
270
|
-
}
|
|
329
|
+
#status(isFallbackToPrefetch: boolean): Lit.LitTemplate {
|
|
330
|
+
assertNotNullOrUndefined(this.#data);
|
|
331
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
271
332
|
|
|
272
|
-
|
|
273
|
-
|
|
333
|
+
const detailedStatus = isFallbackToPrefetch ? i18nString(UIStrings.detailedStatusFallbackToPrefetch) :
|
|
334
|
+
PreloadingUIUtils.detailedStatus(attempt);
|
|
274
335
|
|
|
275
|
-
|
|
276
|
-
|
|
336
|
+
return html`
|
|
337
|
+
<devtools-report-key>${i18nString(UIStrings.detailsStatus)}</devtools-report-key>
|
|
338
|
+
<devtools-report-value>
|
|
339
|
+
${detailedStatus}
|
|
340
|
+
</devtools-report-value>
|
|
341
|
+
`;
|
|
342
|
+
}
|
|
277
343
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
${detailedStatus}
|
|
282
|
-
</devtools-report-value>
|
|
283
|
-
`;
|
|
284
|
-
}
|
|
344
|
+
#maybePrefetchFailureReason(): Lit.LitTemplate {
|
|
345
|
+
assertNotNullOrUndefined(this.#data);
|
|
346
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
285
347
|
|
|
286
|
-
|
|
287
|
-
|
|
348
|
+
if (attempt.action !== Protocol.Preload.SpeculationAction.Prefetch) {
|
|
349
|
+
return Lit.nothing;
|
|
350
|
+
}
|
|
288
351
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
352
|
+
const failureDescription = prefetchFailureReason(attempt);
|
|
353
|
+
if (failureDescription === null) {
|
|
354
|
+
return Lit.nothing;
|
|
355
|
+
}
|
|
292
356
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
357
|
+
return html`
|
|
358
|
+
<devtools-report-key>${i18nString(UIStrings.detailsFailureReason)}</devtools-report-key>
|
|
359
|
+
<devtools-report-value>
|
|
360
|
+
${failureDescription}
|
|
361
|
+
</devtools-report-value>
|
|
362
|
+
`;
|
|
296
363
|
}
|
|
297
364
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
365
|
+
#targetHint(): Lit.LitTemplate {
|
|
366
|
+
assertNotNullOrUndefined(this.#data);
|
|
367
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
368
|
+
const hasTargetHint = this.#isPrerenderLike(attempt.action) && attempt.key.targetHint !== undefined;
|
|
369
|
+
if (!hasTargetHint) {
|
|
370
|
+
return Lit.nothing;
|
|
371
|
+
}
|
|
305
372
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
373
|
+
return html`
|
|
374
|
+
<devtools-report-key>${i18nString(UIStrings.detailsTargetHint)}</devtools-report-key>
|
|
375
|
+
<devtools-report-value>
|
|
376
|
+
${PreloadingUIUtils.detailedTargetHint(attempt.key)}
|
|
377
|
+
</devtools-report-value>
|
|
378
|
+
`;
|
|
311
379
|
}
|
|
312
380
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
${PreloadingUIUtils.detailedTargetHint(attempt.key)}
|
|
317
|
-
</devtools-report-value>
|
|
318
|
-
`;
|
|
319
|
-
}
|
|
381
|
+
#maybePrerenderFailureReason(): Lit.LitTemplate {
|
|
382
|
+
assertNotNullOrUndefined(this.#data);
|
|
383
|
+
const attempt = this.#data.pipeline.getOriginallyTriggered();
|
|
320
384
|
|
|
321
|
-
|
|
322
|
-
|
|
385
|
+
if (!this.#isPrerenderLike(attempt.action)) {
|
|
386
|
+
return Lit.nothing;
|
|
387
|
+
}
|
|
323
388
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
389
|
+
const failureReason = prerenderFailureReason(
|
|
390
|
+
attempt as SDK.PreloadingModel.PrerenderAttempt | SDK.PreloadingModel.PrerenderUntilScriptAttempt);
|
|
391
|
+
if (failureReason === null) {
|
|
392
|
+
return Lit.nothing;
|
|
393
|
+
}
|
|
327
394
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
395
|
+
return html`
|
|
396
|
+
<devtools-report-key>${i18nString(UIStrings.detailsFailureReason)}</devtools-report-key>
|
|
397
|
+
<devtools-report-value>
|
|
398
|
+
${failureReason}
|
|
399
|
+
</devtools-report-value>
|
|
400
|
+
`;
|
|
332
401
|
}
|
|
333
402
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
`;
|
|
340
|
-
}
|
|
403
|
+
#renderRuleSet(ruleSet: Protocol.Preload.RuleSet, pageURL: Platform.DevToolsPath.UrlString): Lit.LitTemplate {
|
|
404
|
+
const revealRuleSetView = (): void => {
|
|
405
|
+
void Common.Revealer.reveal(new PreloadingHelper.PreloadingForward.RuleSetView(ruleSet.id));
|
|
406
|
+
};
|
|
407
|
+
const location = ruleSetLocationShort(ruleSet, pageURL);
|
|
341
408
|
|
|
342
|
-
const DEFAULT_VIEW: View = ({data, onRevealRuleSet}, _, target) => {
|
|
343
|
-
if (data === null) {
|
|
344
409
|
// Disabled until https://crbug.com/1079231 is fixed.
|
|
345
410
|
// clang-format off
|
|
346
|
-
|
|
347
|
-
<
|
|
348
|
-
<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
411
|
+
return html`
|
|
412
|
+
<devtools-report-key>${i18nString(UIStrings.detailsRuleSet)}</devtools-report-key>
|
|
413
|
+
<devtools-report-value>
|
|
414
|
+
<div class="text-ellipsis" title="">
|
|
415
|
+
<button class="link" role="link"
|
|
416
|
+
@click=${revealRuleSetView}
|
|
417
|
+
title=${i18nString(UIStrings.buttonClickToRevealRuleSet)}
|
|
418
|
+
style=${Lit.Directives.styleMap({
|
|
419
|
+
color: 'var(--sys-color-primary)',
|
|
420
|
+
'text-decoration': 'underline',
|
|
421
|
+
})}
|
|
422
|
+
jslog=${VisualLogging.action('reveal-rule-set').track({click: true})}
|
|
423
|
+
>
|
|
424
|
+
${location}
|
|
425
|
+
</button>
|
|
426
|
+
</div>
|
|
427
|
+
</devtools-report-value>
|
|
428
|
+
`;
|
|
354
429
|
// clang-format on
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
const pipeline = data.pipeline;
|
|
359
|
-
const pageURL = data.pageURL;
|
|
360
|
-
const isFallbackToPrefetch = pipeline.getPrerender()?.status === SDK.PreloadingModel.PreloadingStatus.FAILURE &&
|
|
361
|
-
(pipeline.getPrefetch()?.status === SDK.PreloadingModel.PreloadingStatus.READY ||
|
|
362
|
-
pipeline.getPrefetch()?.status === SDK.PreloadingModel.PreloadingStatus.SUCCESS);
|
|
363
|
-
|
|
364
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
365
|
-
// clang-format off
|
|
366
|
-
Lit.render(html`
|
|
367
|
-
<style>${preloadingDetailsReportViewStyles}</style>
|
|
368
|
-
<style>${UI.inspectorCommonStyles}</style>
|
|
369
|
-
<devtools-report
|
|
370
|
-
.data=${{reportTitle: 'Speculative Loading Attempt'}}
|
|
371
|
-
jslog=${VisualLogging.section('preloading-details')}>
|
|
372
|
-
<devtools-report-section-header>${i18nString(UIStrings.detailsDetailedInformation)}</devtools-report-section-header>
|
|
373
|
-
|
|
374
|
-
${url(data)}
|
|
375
|
-
${action(data, isFallbackToPrefetch)}
|
|
376
|
-
${status(data, isFallbackToPrefetch)}
|
|
377
|
-
${targetHint(data)}
|
|
378
|
-
${maybePrefetchFailureReason(data)}
|
|
379
|
-
${maybePrerenderFailureReason(data)}
|
|
380
|
-
|
|
381
|
-
${data.ruleSets.map(ruleSet => {
|
|
382
|
-
const location = ruleSetLocationShort(ruleSet, pageURL);
|
|
383
|
-
return html`
|
|
384
|
-
<devtools-report-key>${i18nString(UIStrings.detailsRuleSet)}</devtools-report-key>
|
|
385
|
-
<devtools-report-value>
|
|
386
|
-
<div class="text-ellipsis" title="">
|
|
387
|
-
<button class="link" role="link"
|
|
388
|
-
@click=${() => onRevealRuleSet(ruleSet)}
|
|
389
|
-
title=${i18nString(UIStrings.buttonClickToRevealRuleSet)}
|
|
390
|
-
style=${Lit.Directives.styleMap({
|
|
391
|
-
color: 'var(--sys-color-primary)',
|
|
392
|
-
'text-decoration': 'underline',
|
|
393
|
-
})}
|
|
394
|
-
jslog=${VisualLogging.action('reveal-rule-set').track({click: true})}
|
|
395
|
-
>
|
|
396
|
-
${location}
|
|
397
|
-
</button>
|
|
398
|
-
</div>
|
|
399
|
-
</devtools-report-value>
|
|
400
|
-
`;
|
|
401
|
-
})}
|
|
402
|
-
</devtools-report>
|
|
403
|
-
`, target, {host: target});
|
|
404
|
-
// clang-format on
|
|
405
|
-
};
|
|
406
|
-
export class PreloadingDetailsReportView extends UI.Widget.VBox {
|
|
407
|
-
#view: View;
|
|
408
|
-
#data: PreloadingDetailsReportViewData = null;
|
|
409
|
-
|
|
410
|
-
constructor(view: View = DEFAULT_VIEW) {
|
|
411
|
-
super();
|
|
412
|
-
this.#view = view;
|
|
413
430
|
}
|
|
431
|
+
}
|
|
414
432
|
|
|
415
|
-
|
|
416
|
-
this.#data = data;
|
|
417
|
-
this.requestUpdate();
|
|
418
|
-
}
|
|
433
|
+
customElements.define('devtools-resources-preloading-details-report-view', PreloadingDetailsReportView);
|
|
419
434
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
data: this.#data,
|
|
424
|
-
onRevealRuleSet: (ruleSet: Protocol.Preload.RuleSet) => {
|
|
425
|
-
void Common.Revealer.reveal(new PreloadingHelper.PreloadingForward.RuleSetView(ruleSet.id));
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
undefined,
|
|
429
|
-
this.contentElement,
|
|
430
|
-
);
|
|
435
|
+
declare global {
|
|
436
|
+
interface HTMLElementTagNameMap {
|
|
437
|
+
'devtools-resources-preloading-details-report-view': PreloadingDetailsReportView;
|
|
431
438
|
}
|
|
432
439
|
}
|
|
@@ -62,7 +62,7 @@ export interface ViewInput {
|
|
|
62
62
|
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
63
63
|
|
|
64
64
|
export const PRELOADING_GRID_DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
65
|
-
if (!input.rows || input.pageURL
|
|
65
|
+
if (!input.rows || !input.pageURL) {
|
|
66
66
|
render(nothing, target);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
@@ -116,7 +116,8 @@ export const PRELOADING_GRID_DEFAULT_VIEW: View = (input, _output, target): void
|
|
|
116
116
|
</devtools-data-grid>
|
|
117
117
|
</div>
|
|
118
118
|
`, target);
|
|
119
|
-
|
|
119
|
+
// clang-format on
|
|
120
|
+
};
|
|
120
121
|
|
|
121
122
|
/** Grid component to show prerendering attempts. **/
|
|
122
123
|
export class PreloadingGrid extends UI.Widget.VBox {
|
|
@@ -259,13 +259,11 @@ function renderMismatchedSections(data: MismatchedData): LitTemplate {
|
|
|
259
259
|
${i18nString(UIStrings.currentURL)}
|
|
260
260
|
</devtools-report-section-header>
|
|
261
261
|
<devtools-report-section>
|
|
262
|
-
<
|
|
262
|
+
<devtools-link
|
|
263
263
|
class="link devtools-link"
|
|
264
264
|
href=${data.pageURL}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
.context('current-url')}
|
|
268
|
-
>${data.pageURL}</x-link>
|
|
265
|
+
.jslogContext=${'current-url'}
|
|
266
|
+
>${data.pageURL}</devtools-link>
|
|
269
267
|
</devtools-report-section>
|
|
270
268
|
|
|
271
269
|
<devtools-report-section-header>
|
|
@@ -411,13 +409,11 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
411
409
|
<devtools-report-divider></devtools-report-divider>
|
|
412
410
|
|
|
413
411
|
<devtools-report-section>
|
|
414
|
-
<
|
|
412
|
+
<devtools-link
|
|
415
413
|
class="link devtools-link"
|
|
416
414
|
href=${'https://developer.chrome.com/blog/prerender-pages/'}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
.context('learn-more')}
|
|
420
|
-
>${i18nString(UIStrings.learnMore)}</x-link>
|
|
415
|
+
.jslogContext=${'learn-more'}
|
|
416
|
+
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
421
417
|
</devtools-report-section>
|
|
422
418
|
</devtools-report>`, target);
|
|
423
419
|
// clang-format on
|
|
@@ -56,3 +56,11 @@ devtools-icon.navigator-font-tree-item {
|
|
|
56
56
|
.window-closed .tree-element-title {
|
|
57
57
|
text-decoration: line-through;
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
.device-bound-session-terminated {
|
|
61
|
+
text-decoration: line-through;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.no-device-bound-session {
|
|
65
|
+
font-style: italic;
|
|
66
|
+
}
|
|
@@ -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/adorners/adorners.js';
|
|
6
7
|
import '../../ui/legacy/components/data_grid/data_grid.js';
|
|
7
8
|
|
|
@@ -237,14 +238,14 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
|
|
|
237
238
|
jslog=${VisualLogging.toggle(input.autoOpenViewSetting.name).track({ change: true })}>
|
|
238
239
|
${i18nString(UIStrings.autoShow)}
|
|
239
240
|
</devtools-checkbox>
|
|
240
|
-
<
|
|
241
|
+
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" .jslogContext=${'feedback'}>${i18nString(UIStrings.sendFeedback)}</devtools-link>
|
|
241
242
|
</div>
|
|
242
243
|
<div class="placeholder-container" jslog=${VisualLogging.pane('autofill-empty')}>
|
|
243
244
|
<div class="empty-state">
|
|
244
245
|
<span class="empty-state-header">${i18nString(UIStrings.noAutofill)}</span>
|
|
245
246
|
<div class="empty-state-description">
|
|
246
247
|
<span>${i18nString(UIStrings.toStartDebugging)}</span>
|
|
247
|
-
<
|
|
248
|
+
<devtools-link href=${AUTOFILL_INFO_URL} class="link" .jslogContext=${'learn-more'}>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
248
249
|
</div>
|
|
249
250
|
</div>
|
|
250
251
|
</div>
|
|
@@ -279,7 +280,7 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
|
|
|
279
280
|
${i18nString(UIStrings.autoShow)}
|
|
280
281
|
</devtools-checkbox>
|
|
281
282
|
</div>
|
|
282
|
-
<
|
|
283
|
+
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" .jslogContext=${'feedback'}>${i18nString(UIStrings.sendFeedback)}</devtools-link>
|
|
283
284
|
</div>
|
|
284
285
|
${renderAddress()}
|
|
285
286
|
</div>
|