chrome-devtools-frontend 1.0.1597624 → 1.0.1599001
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/README.md +13 -0
- package/{agents/prompts/creating-a-model.md → .agents/skills/creating-a-model/SKILL.md} +7 -1
- package/{agents/prompts/devtools-imports.md → .agents/skills/devtools-imports/SKILL.md} +10 -5
- package/{agents/prompts/merging-devtools-module.md → .agents/skills/merging-devtools-module/SKILL.md} +5 -0
- package/{agents/prompts/ui-widgets.md → .agents/skills/ui-widgets/SKILL.md} +5 -0
- package/{agents/prompts/verification.md → .agents/skills/verification/SKILL.md} +5 -0
- package/docs/ui_engineering.md +6 -6
- package/front_end/core/host/AidaClient.ts +2 -0
- package/front_end/core/host/GcaTypes.ts +518 -0
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/host/host.ts +2 -0
- package/front_end/core/root/ExperimentNames.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +2 -1
- package/front_end/models/ai_assistance/AiConversation.ts +28 -15
- package/front_end/models/ai_assistance/AiHistoryStorage.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +8 -2
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +3 -18
- package/front_end/models/ai_assistance/agents/AiAgent.ts +39 -5
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -0
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +108 -0
- package/front_end/models/ai_assistance/agents/FileAgent.ts +0 -15
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +0 -5
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +76 -13
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +0 -10
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -6
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -5
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/emulation/DeviceModeModel.ts +5 -1
- package/front_end/models/emulation/EmulatedDevices.ts +3 -2
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +15 -5
- package/front_end/models/issues_manager/descriptions/sharedDictionaryUseErrorNoCorpCrossOriginNoCorsRequest.md +3 -0
- package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNoCorpCossOriginNoCorsRequest.md +3 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/lighthouse/RunTypes.ts +41 -0
- package/front_end/models/lighthouse/lighthouse.ts +2 -0
- package/front_end/models/trace/ModelImpl.ts +4 -0
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -8
- package/front_end/models/trace/types/Configuration.ts +0 -5
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +90 -14
- package/front_end/panels/ai_assistance/PatchWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +153 -42
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/ai_assistance/components/chatMessage.css +61 -0
- package/front_end/panels/application/AppManifestView.ts +2 -2
- package/front_end/panels/application/CookieItemsView.ts +9 -15
- package/front_end/panels/application/DeviceBoundSessionsView.ts +3 -5
- package/front_end/panels/application/FrameDetailsView.ts +2 -2
- package/front_end/panels/application/ReportingApiView.ts +2 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +20 -7
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +6 -3
- package/front_end/panels/application/preloading/components/PreloadingString.ts +15 -2
- package/front_end/panels/application/preloading/helper/PreloadingForward.ts +31 -2
- package/front_end/panels/changes/ChangesView.ts +7 -11
- package/front_end/panels/coverage/CoverageView.ts +4 -4
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/elements/ElementsTreeOutline.ts +34 -8
- package/front_end/panels/elements/StylePropertiesSection.ts +129 -1
- package/front_end/panels/elements/StylePropertyHighlighter.ts +3 -0
- package/front_end/panels/elements/stylesSidebarPane.css +34 -0
- package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +3 -5
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +2 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +148 -162
- package/front_end/panels/lighthouse/LighthousePanel.ts +2 -7
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +3 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +7 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +4 -4
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +4 -4
- package/front_end/panels/network/RequestResponseView.ts +2 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/search/SearchView.ts +2 -2
- package/front_end/panels/sensors/SensorsView.ts +32 -22
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +18 -4
- package/front_end/panels/timeline/StatusDialog.ts +159 -83
- package/front_end/panels/timeline/TimelineController.ts +0 -4
- package/front_end/panels/timeline/TimelineDetailsView.ts +8 -6
- package/front_end/panels/timeline/TimelinePanel.ts +29 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +1 -1
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +1 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +62 -34
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +53 -28
- package/front_end/panels/timeline/components/insights/CharacterSet.ts +2 -6
- package/front_end/panels/timeline/components/insights/EventRef.ts +2 -2
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +7 -0
- package/front_end/panels/timeline/components/insights/insights.ts +0 -2
- package/front_end/panels/timeline/timeline-meta.ts +11 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +13 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/mitt/mitt.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/parsel-js/parsel-js.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/rxjs/rxjs.js +446 -446
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +166 -167
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt/mitt.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js/parsel-js.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs/rxjs.js +97 -97
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/util.ts +17 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +47 -9
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -1
- package/package.json +1 -1
- package/agents/prompts/README.md +0 -18
- package/front_end/models/issues_manager/descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -1
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -93
|
@@ -22,7 +22,7 @@ import * as ApplicationComponents from './components/components.js';
|
|
|
22
22
|
|
|
23
23
|
const {styleMap, classMap, ref} = Directives;
|
|
24
24
|
const {linkifyURL} = Components.Linkifier.Linkifier;
|
|
25
|
-
const {widget
|
|
25
|
+
const {widget} = UI.Widget;
|
|
26
26
|
|
|
27
27
|
const UIStrings = {
|
|
28
28
|
/**
|
|
@@ -719,7 +719,7 @@ function renderProtocolHandlers(data: ProtocolHandlersSectionData, output: ViewO
|
|
|
719
719
|
// clang-format off
|
|
720
720
|
return html`${renderSectionHeader(i18nString(UIStrings.protocolHandlers), output)}
|
|
721
721
|
<div class="report-row">
|
|
722
|
-
<devtools-widget
|
|
722
|
+
<devtools-widget ${widget(
|
|
723
723
|
ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView,
|
|
724
724
|
{protocolHandlers: data.protocolHandlers, manifestLink: data.manifestLink})}
|
|
725
725
|
${ref(setFocusOnSection(i18nString(UIStrings.protocolHandlers), output))}>
|
|
@@ -82,6 +82,7 @@ const UIStrings = {
|
|
|
82
82
|
const str_ = i18n.i18n.registerUIStrings('panels/application/CookieItemsView.ts', UIStrings);
|
|
83
83
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
84
84
|
const {Size} = Geometry;
|
|
85
|
+
const {widget} = UI.Widget;
|
|
85
86
|
|
|
86
87
|
interface CookiePreviewWidgetInput {
|
|
87
88
|
cookie: SDK.Cookie.Cookie|null;
|
|
@@ -184,10 +185,8 @@ type View = (input: CookieItemsViewInput, output: CookieItemsViewOutput, target:
|
|
|
184
185
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
185
186
|
// clang-format off
|
|
186
187
|
render(html`<style>${cookieItemsViewStyles}</style>
|
|
187
|
-
<devtools-widget class="storage-view"
|
|
188
|
-
|
|
189
|
-
<devtools-widget
|
|
190
|
-
.widgetConfig=${UI.Widget.widgetConfig(StorageItemsToolbar, {
|
|
188
|
+
<devtools-widget class="storage-view" ${widget(UI.Widget.VBox, {minimumSize: new Size(0, 50)})}>
|
|
189
|
+
<devtools-widget ${widget(StorageItemsToolbar, {
|
|
191
190
|
onDeleteSelectedCallback: input.onDeleteSelectedItems,
|
|
192
191
|
onDeleteAllCallback: input.onDeleteAllItems,
|
|
193
192
|
onRefreshCallback: input.onRefreshItems,
|
|
@@ -196,10 +195,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
196
195
|
${UI.Widget.widgetRef(StorageItemsToolbar, toolbar => { output.toolbar = toolbar; })}
|
|
197
196
|
></devtools-widget>
|
|
198
197
|
<devtools-split-view sidebar-position="second" name="cookie-items-split-view-state">
|
|
199
|
-
<devtools-widget
|
|
200
|
-
|
|
201
|
-
.widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox, {minimumSize: new Size(0, 50)})}>
|
|
202
|
-
<devtools-widget slot="main" .widgetConfig=${UI.Widget.widgetConfig(CookieTable.CookiesTable.CookiesTable, {
|
|
198
|
+
<devtools-widget slot="main" ${widget(UI.Widget.VBox, {minimumSize: new Size(0, 50)})}>
|
|
199
|
+
<devtools-widget slot="main" ${widget(CookieTable.CookiesTable.CookiesTable, {
|
|
203
200
|
cookieDomain: input.cookieDomain,
|
|
204
201
|
cookiesData: input.cookiesData,
|
|
205
202
|
saveCallback: input.onSaveCookie,
|
|
@@ -210,15 +207,12 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
210
207
|
})}
|
|
211
208
|
></devtools-widget>
|
|
212
209
|
</devtools-widget>
|
|
213
|
-
<devtools-widget
|
|
214
|
-
slot="sidebar"
|
|
215
|
-
.widgetConfig=${UI.Widget.widgetConfig(UI.Widget.VBox, {minimumSize: new Size(0, 50)})}
|
|
210
|
+
<devtools-widget slot="sidebar" ${widget(UI.Widget.VBox, {minimumSize: new Size(0, 50)})}
|
|
216
211
|
jslog=${VisualLogging.pane('preview').track({resize: true})}>
|
|
217
212
|
${input.selectedCookie ?
|
|
218
|
-
html`<devtools-widget
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
html`<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(UI.EmptyWidget.EmptyWidget, {
|
|
213
|
+
html`<devtools-widget ${widget(CookiePreviewWidget, {cookie: input.selectedCookie})}>
|
|
214
|
+
</devtools-widget>` :
|
|
215
|
+
html`<devtools-widget ${widget(UI.EmptyWidget.EmptyWidget, {
|
|
222
216
|
header: i18nString(UIStrings.noCookieSelected),
|
|
223
217
|
text: i18nString(UIStrings.selectACookieToPreviewItsValue)
|
|
224
218
|
})}></devtools-widget>`}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type SessionAndEvents
|
|
20
20
|
} from './DeviceBoundSessionsModel.js';
|
|
21
21
|
import deviceBoundSessionsViewStyles from './deviceBoundSessionsView.css.js';
|
|
22
|
-
const {widget
|
|
22
|
+
const {widget} = UI.Widget;
|
|
23
23
|
|
|
24
24
|
const UIStrings = {
|
|
25
25
|
/**
|
|
@@ -583,10 +583,8 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
583
583
|
<style>${UI.inspectorCommonStyles}</style>
|
|
584
584
|
<style>${deviceBoundSessionsViewStyles}</style>
|
|
585
585
|
${toolbarHtml}
|
|
586
|
-
<devtools-widget
|
|
587
|
-
|
|
588
|
-
text: defaultDescription
|
|
589
|
-
})} jslog=${VisualLogging.pane('device-bound-sessions-empty')}></devtools-widget>
|
|
586
|
+
<devtools-widget ${widget(UI.EmptyWidget.EmptyWidget, {header: defaultTitle, text: defaultDescription})} jslog=${
|
|
587
|
+
VisualLogging.pane('device-bound-sessions-empty')}></devtools-widget>
|
|
590
588
|
`,
|
|
591
589
|
target);
|
|
592
590
|
return;
|
|
@@ -30,7 +30,7 @@ import * as ApplicationComponents from './components/components.js';
|
|
|
30
30
|
import frameDetailsReportViewStyles from './frameDetailsReportView.css.js';
|
|
31
31
|
import {OriginTrialTreeView} from './OriginTrialTreeView.js';
|
|
32
32
|
|
|
33
|
-
const {widget
|
|
33
|
+
const {widget} = UI.Widget;
|
|
34
34
|
|
|
35
35
|
const UIStrings = {
|
|
36
36
|
/**
|
|
@@ -327,7 +327,7 @@ function renderOriginTrial(trials: Protocol.Page.OriginTrial[]|null): LitTemplat
|
|
|
327
327
|
</devtools-link>
|
|
328
328
|
</span>
|
|
329
329
|
</devtools-report-section>
|
|
330
|
-
<devtools-widget class="span-cols"
|
|
330
|
+
<devtools-widget class="span-cols" ${widget(OriginTrialTreeView, {data})}>
|
|
331
331
|
</devtools-widget>
|
|
332
332
|
<devtools-report-divider></devtools-report-divider>`;
|
|
333
333
|
// clang-format on
|
|
@@ -13,7 +13,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
|
13
13
|
|
|
14
14
|
import * as ApplicationComponents from './components/components.js';
|
|
15
15
|
|
|
16
|
-
const {widget
|
|
16
|
+
const {widget} = UI.Widget;
|
|
17
17
|
|
|
18
18
|
const UIStrings = {
|
|
19
19
|
/**
|
|
@@ -97,7 +97,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
97
97
|
} else {
|
|
98
98
|
// clang-format off
|
|
99
99
|
render(html`
|
|
100
|
-
<devtools-widget
|
|
100
|
+
<devtools-widget ${widget(UI.EmptyWidget.EmptyWidget, {
|
|
101
101
|
header: i18nString(UIStrings.noReportOrEndpoint),
|
|
102
102
|
text: i18nString(UIStrings.reportingApiDescription),
|
|
103
103
|
link: REPORTING_API_EXPLANATION_URL,
|
|
@@ -28,6 +28,7 @@ import preloadingViewStyles from './preloadingView.css.js';
|
|
|
28
28
|
import preloadingViewDropDownStyles from './preloadingViewDropDown.css.js';
|
|
29
29
|
|
|
30
30
|
const {createRef, ref} = Directives;
|
|
31
|
+
const {widget} = UI.Widget;
|
|
31
32
|
|
|
32
33
|
const UIStrings = {
|
|
33
34
|
/**
|
|
@@ -266,7 +267,7 @@ export class PreloadingRuleSetView extends UI.Widget.VBox {
|
|
|
266
267
|
<div slot="main" ${ref(this.ruleSetGridContainerRef)}>
|
|
267
268
|
</div>
|
|
268
269
|
<div slot="sidebar" jslog=${VisualLogging.section('rule-set-details')}>
|
|
269
|
-
<devtools-widget
|
|
270
|
+
<devtools-widget ${widget(PreloadingComponents.RuleSetDetailsView.RuleSetDetailsView, {
|
|
270
271
|
ruleSet: this.getRuleSet(),
|
|
271
272
|
shouldPrettyPrint: this.shouldPrettyPrint,
|
|
272
273
|
})} ${ref(this.ruleSetDetailsRef)}></devtools-widget>
|
|
@@ -448,6 +449,7 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
448
449
|
new PreloadingComponents.PreloadingDetailsReportView.PreloadingDetailsReportView();
|
|
449
450
|
private readonly ruleSetSelector: PreloadingRuleSetSelector;
|
|
450
451
|
private readonly textFilterUI: UI.Toolbar.ToolbarFilter;
|
|
452
|
+
private hsplit?: UI.SplitWidget.SplitWidget;
|
|
451
453
|
private clearButton: UI.Toolbar.ToolbarButton;
|
|
452
454
|
|
|
453
455
|
constructor(model: SDK.PreloadingModel.PreloadingModel) {
|
|
@@ -541,7 +543,12 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
541
543
|
>${i18nString(UIStrings.learnMore)}</devtools-link>
|
|
542
544
|
</div>
|
|
543
545
|
</div>
|
|
544
|
-
<devtools-split-view sidebar-position="second"
|
|
546
|
+
<devtools-split-view sidebar-position="second" ${
|
|
547
|
+
UI.Widget.widgetRef(
|
|
548
|
+
UI.SplitWidget.SplitWidget,
|
|
549
|
+
w => {
|
|
550
|
+
this.hsplit = w;
|
|
551
|
+
})}>
|
|
545
552
|
<div slot="main" class="overflow-auto" style="height: 100%">
|
|
546
553
|
${preloadingGridContainer}
|
|
547
554
|
</div>
|
|
@@ -613,10 +620,8 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
613
620
|
return ruleSet === null ? [] : [ruleSet];
|
|
614
621
|
});
|
|
615
622
|
|
|
616
|
-
// Lookup status code for
|
|
617
|
-
const statusCode =
|
|
618
|
-
PreloadingHelper.PreloadingForward.prefetchStatusCode(attempt.requestId) :
|
|
619
|
-
undefined;
|
|
623
|
+
// Lookup status code from the network log for display in the grid.
|
|
624
|
+
const statusCode = PreloadingHelper.PreloadingForward.preloadStatusCode(attempt);
|
|
620
625
|
|
|
621
626
|
return {
|
|
622
627
|
id,
|
|
@@ -632,7 +637,15 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
|
|
|
632
637
|
this.preloadingGrid.rows = filteredRows;
|
|
633
638
|
this.preloadingGrid.pageURL = pageURL();
|
|
634
639
|
// Only show empty state when there are truly no speculations (not when filter has no matches)
|
|
635
|
-
this.contentElement.classList.
|
|
640
|
+
const wasEmpty = this.contentElement.classList.contains('empty');
|
|
641
|
+
const isEmpty = rows.length === 0;
|
|
642
|
+
this.contentElement.classList.toggle('empty', isEmpty);
|
|
643
|
+
|
|
644
|
+
// When this view starts empty, the split view gets laid out while hidden and collapses
|
|
645
|
+
// its sidebar to 0. Re-layout once it becomes visible.
|
|
646
|
+
if (wasEmpty && !isEmpty) {
|
|
647
|
+
this.hsplit?.doLayout();
|
|
648
|
+
}
|
|
636
649
|
|
|
637
650
|
this.updatePreloadingDetails();
|
|
638
651
|
}
|
|
@@ -349,8 +349,8 @@ export class PreloadingDetailsReportView extends LegacyWrapper.LegacyWrapper.Wra
|
|
|
349
349
|
return Lit.nothing;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
// Lookup status code for Non2XX failures
|
|
353
|
-
const statusCode = PreloadingHelper.PreloadingForward.
|
|
352
|
+
// Lookup status code for Non2XX failures.
|
|
353
|
+
const statusCode = PreloadingHelper.PreloadingForward.preloadStatusCode(attempt);
|
|
354
354
|
|
|
355
355
|
const failureDescription = prefetchFailureReason(attempt, statusCode);
|
|
356
356
|
if (failureDescription === null) {
|
|
@@ -389,8 +389,11 @@ export class PreloadingDetailsReportView extends LegacyWrapper.LegacyWrapper.Wra
|
|
|
389
389
|
return Lit.nothing;
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
+
// Lookup status code from the network log for NavigationBadHttpStatus.
|
|
393
|
+
const statusCode = PreloadingHelper.PreloadingForward.preloadStatusCode(attempt);
|
|
394
|
+
|
|
392
395
|
const failureReason = prerenderFailureReason(
|
|
393
|
-
attempt as SDK.PreloadingModel.PrerenderAttempt | SDK.PreloadingModel.PrerenderUntilScriptAttempt);
|
|
396
|
+
attempt as SDK.PreloadingModel.PrerenderAttempt | SDK.PreloadingModel.PrerenderUntilScriptAttempt, statusCode);
|
|
394
397
|
if (failureReason === null) {
|
|
395
398
|
return Lit.nothing;
|
|
396
399
|
}
|
|
@@ -176,6 +176,12 @@ const UIStrings = {
|
|
|
176
176
|
*/
|
|
177
177
|
prerenderFinalStatusNavigationBadHttpStatus:
|
|
178
178
|
'The prerendering navigation failed because of a non-2xx HTTP response status code.',
|
|
179
|
+
/**
|
|
180
|
+
* @description Description text for PrerenderFinalStatus::kNavigationBadHttpStatus when the HTTP status code is known.
|
|
181
|
+
* @example {404} PH1
|
|
182
|
+
*/
|
|
183
|
+
prerenderFinalStatusNavigationBadHttpStatusWithStatusCode:
|
|
184
|
+
'The prerendering navigation failed because of a non-2xx HTTP response status code ({PH1}).',
|
|
179
185
|
/**
|
|
180
186
|
* Description text for PrerenderFinalStatus::kClientCertRequested.
|
|
181
187
|
*/
|
|
@@ -545,7 +551,8 @@ export function prefetchFailureReason(
|
|
|
545
551
|
|
|
546
552
|
/** Detailed failure reason for PrerenderFinalStatus. **/
|
|
547
553
|
export function prerenderFailureReason(
|
|
548
|
-
attempt: SDK.PreloadingModel.PrerenderAttempt|SDK.PreloadingModel.PrerenderUntilScriptAttempt
|
|
554
|
+
attempt: SDK.PreloadingModel.PrerenderAttempt|SDK.PreloadingModel.PrerenderUntilScriptAttempt,
|
|
555
|
+
statusCode?: number): string|null {
|
|
549
556
|
// If you face an error on rolling CDP changes, see
|
|
550
557
|
// https://docs.google.com/document/d/1PnrfowsZMt62PX1EvvTp2Nqs3ji1zrklrAEe1JYbkTk
|
|
551
558
|
switch (attempt.prerenderStatus) {
|
|
@@ -581,7 +588,12 @@ export function prerenderFailureReason(
|
|
|
581
588
|
// TODO(https://crbug.com/1410709): Fill it.
|
|
582
589
|
return i18n.i18n.lockedString('Internal error');
|
|
583
590
|
case Protocol.Preload.PrerenderFinalStatus.NavigationBadHttpStatus:
|
|
591
|
+
if (statusCode !== undefined) {
|
|
592
|
+
return i18nString(
|
|
593
|
+
UIStrings.prerenderFinalStatusNavigationBadHttpStatusWithStatusCode, {PH1: String(statusCode)});
|
|
594
|
+
}
|
|
584
595
|
return i18nString(UIStrings.prerenderFinalStatusNavigationBadHttpStatus);
|
|
596
|
+
|
|
585
597
|
case Protocol.Preload.PrerenderFinalStatus.ClientCertRequested:
|
|
586
598
|
return i18nString(UIStrings.prerenderFinalStatusClientCertRequested);
|
|
587
599
|
case Protocol.Preload.PrerenderFinalStatus.NavigationRequestNetworkError:
|
|
@@ -819,7 +831,8 @@ export function composedStatus(attempt: SDK.PreloadingModel.PreloadingAttempt, s
|
|
|
819
831
|
case Protocol.Preload.SpeculationAction.Prerender:
|
|
820
832
|
case Protocol.Preload.SpeculationAction.PrerenderUntilScript: {
|
|
821
833
|
const detail = prerenderFailureReason(
|
|
822
|
-
attempt as SDK.PreloadingModel.PrerenderAttempt | SDK.PreloadingModel.PrerenderUntilScriptAttempt
|
|
834
|
+
attempt as SDK.PreloadingModel.PrerenderAttempt | SDK.PreloadingModel.PrerenderUntilScriptAttempt,
|
|
835
|
+
statusCode);
|
|
823
836
|
assertNotNullOrUndefined(detail);
|
|
824
837
|
return short + ' - ' + detail;
|
|
825
838
|
}
|
|
@@ -2,7 +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
|
|
5
|
+
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
6
|
+
import * as Protocol from '../../../../generated/protocol.js';
|
|
6
7
|
import * as Logs from '../../../../models/logs/logs.js';
|
|
7
8
|
|
|
8
9
|
export class RuleSetView {
|
|
@@ -21,11 +22,26 @@ export class AttemptViewWithFilter {
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the HTTP status code for a preloading attempt.
|
|
27
|
+
*/
|
|
28
|
+
export function preloadStatusCode(attempt: SDK.PreloadingModel.PreloadingAttempt): number|undefined {
|
|
29
|
+
switch (attempt.action) {
|
|
30
|
+
case Protocol.Preload.SpeculationAction.Prefetch:
|
|
31
|
+
return prefetchStatusCode(attempt.requestId);
|
|
32
|
+
case Protocol.Preload.SpeculationAction.Prerender:
|
|
33
|
+
case Protocol.Preload.SpeculationAction.PrerenderUntilScript:
|
|
34
|
+
return prerenderStatusCode(attempt.key.loaderId);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
24
40
|
/**
|
|
25
41
|
* Retrieves the HTTP status code for a prefetch attempt by looking up its
|
|
26
42
|
* network request in the network log.
|
|
27
43
|
*/
|
|
28
|
-
|
|
44
|
+
function prefetchStatusCode(requestId: Protocol.Network.RequestId): number|undefined {
|
|
29
45
|
const networkLog = Logs.NetworkLog.NetworkLog.instance();
|
|
30
46
|
const requests = networkLog.requestsForId(requestId);
|
|
31
47
|
if (requests.length > 0) {
|
|
@@ -33,3 +49,16 @@ export function prefetchStatusCode(requestId: Protocol.Network.RequestId): numbe
|
|
|
33
49
|
}
|
|
34
50
|
return undefined;
|
|
35
51
|
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the HTTP status code for a prerender attempt.
|
|
55
|
+
*/
|
|
56
|
+
function prerenderStatusCode(loaderId: Protocol.Network.LoaderId): number|undefined {
|
|
57
|
+
const frame = SDK.ResourceTreeModel.ResourceTreeModel.frames().find(f => f.loaderId === loaderId);
|
|
58
|
+
if (!frame) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const networkManager = frame.resourceTreeModel().target().model(SDK.NetworkManager.NetworkManager);
|
|
62
|
+
const request = networkManager?.requestForLoaderId(loaderId);
|
|
63
|
+
return request?.statusCode === 0 ? undefined : request?.statusCode;
|
|
64
|
+
}
|
|
@@ -58,11 +58,11 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
58
58
|
<div class=vbox slot="main">
|
|
59
59
|
<devtools-widget
|
|
60
60
|
?hidden=${input.workspaceDiff.modifiedUISourceCodes().length > 0}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
${widget(UI.EmptyWidget.EmptyWidget, {
|
|
62
|
+
header: i18nString(UIStrings.noChanges),
|
|
63
|
+
text: i18nString(UIStrings.changesViewDescription),
|
|
64
|
+
link: CHANGES_VIEW_URL,
|
|
65
|
+
})}>
|
|
66
66
|
</devtools-widget>
|
|
67
67
|
<div class=diff-container role=tabpanel ?hidden=${input.workspaceDiff.modifiedUISourceCodes().length === 0}>
|
|
68
68
|
${widget(CombinedDiffView.CombinedDiffView, {
|
|
@@ -72,18 +72,14 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
72
72
|
</div>
|
|
73
73
|
${hasCopyToPrompt ? html`
|
|
74
74
|
<devtools-widget class="copy-to-prompt"
|
|
75
|
-
|
|
75
|
+
${widget(PanelsCommon.CopyChangesToPrompt, {
|
|
76
76
|
workspaceDiff: input.workspaceDiff,
|
|
77
77
|
patchAgentCSSChange: null,
|
|
78
78
|
})}
|
|
79
79
|
></devtools-widget>
|
|
80
80
|
` : Lit.nothing}
|
|
81
81
|
</div>
|
|
82
|
-
<devtools-widget
|
|
83
|
-
slot="sidebar"
|
|
84
|
-
.widgetConfig=${UI.Widget.widgetConfig(ChangesSidebar, {
|
|
85
|
-
workspaceDiff: input.workspaceDiff
|
|
86
|
-
})}
|
|
82
|
+
<devtools-widget slot="sidebar" ${widget(ChangesSidebar, {workspaceDiff: input.workspaceDiff})}
|
|
87
83
|
${UI.Widget.widgetRef(ChangesSidebar, onSidebar)}>
|
|
88
84
|
</devtools-widget>
|
|
89
85
|
</devtools-split-view>`,
|
|
@@ -127,7 +127,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
127
127
|
const i18nTemplate = unboundI18nTemplate.bind(undefined, str_);
|
|
128
128
|
const {ref} = Directives;
|
|
129
129
|
const {bindToAction, bindToSetting} = UI.UIUtils;
|
|
130
|
-
const {
|
|
130
|
+
const {widget} = UI.Widget;
|
|
131
131
|
|
|
132
132
|
let coverageViewInstance: CoverageView|undefined;
|
|
133
133
|
|
|
@@ -222,7 +222,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
222
222
|
i18nString(UIStrings.bfcacheNoCapture) : i18nString(UIStrings.activationNoCapture),
|
|
223
223
|
input.needsReload)
|
|
224
224
|
: input.coverageInfo ? html`
|
|
225
|
-
<devtools-widget autofocus class="results"
|
|
225
|
+
<devtools-widget autofocus class="results" ${widget(CoverageListView, {
|
|
226
226
|
coverageInfo: input.coverageInfo,
|
|
227
227
|
highlightRegExp: input.textFilter,
|
|
228
228
|
selectedUrl: input.selectedUrl,
|
|
@@ -242,7 +242,7 @@ function renderLandingPage(supportsRecordOnReload: boolean): TemplateResult {
|
|
|
242
242
|
if (supportsRecordOnReload) {
|
|
243
243
|
// clang-format off
|
|
244
244
|
return html`
|
|
245
|
-
<devtools-widget
|
|
245
|
+
<devtools-widget ${widget(UI.EmptyWidget.EmptyWidget,{
|
|
246
246
|
header: i18nString(UIStrings.noCoverageData),
|
|
247
247
|
link: 'https://developer.chrome.com/docs/devtools/coverage' as Platform.DevToolsPath.UrlString,
|
|
248
248
|
text: i18nString(UIStrings.clickTheReloadButtonSToReloadAnd, {PH1: i18nString(UIStrings.reloadPage)}),
|
|
@@ -256,7 +256,7 @@ function renderLandingPage(supportsRecordOnReload: boolean): TemplateResult {
|
|
|
256
256
|
}
|
|
257
257
|
// clang-format off
|
|
258
258
|
return html`
|
|
259
|
-
<devtools-widget
|
|
259
|
+
<devtools-widget ${widget(UI.EmptyWidget.EmptyWidget,{
|
|
260
260
|
header: i18nString(UIStrings.noCoverageData),
|
|
261
261
|
link: 'https://developer.chrome.com/docs/devtools/coverage' as Platform.DevToolsPath.UrlString,
|
|
262
262
|
text: i18nString(UIStrings.clickTheRecordButtonSToStart, {PH1: i18nString(UIStrings.startRecording)}),
|
|
@@ -25,7 +25,7 @@ import {CSSOverviewSidebarPanel} from './CSSOverviewSidebarPanel.js';
|
|
|
25
25
|
import type {UnusedDeclaration} from './CSSOverviewUnusedDeclarations.js';
|
|
26
26
|
|
|
27
27
|
const {styleMap, ref} = Directives;
|
|
28
|
-
const {
|
|
28
|
+
const {widget} = UI.Widget;
|
|
29
29
|
|
|
30
30
|
const UIStrings = {
|
|
31
31
|
/**
|
|
@@ -281,7 +281,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
281
281
|
render(html`
|
|
282
282
|
<style>${cssOverviewCompletedViewStyles}</style>
|
|
283
283
|
<devtools-split-view direction="column" sidebar-position="first" sidebar-initial-size="200">
|
|
284
|
-
<devtools-widget slot="sidebar"
|
|
284
|
+
<devtools-widget slot="sidebar" ${widget(CSSOverviewSidebarPanel, {
|
|
285
285
|
minimumSize: new Geometry.Size(100, 25),
|
|
286
286
|
items: [
|
|
287
287
|
{name: i18nString(UIStrings.overviewSummary), id: 'summary'},
|
|
@@ -325,7 +325,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
325
325
|
${renderMediaQueries(input.mediaQueries)}
|
|
326
326
|
</div>
|
|
327
327
|
</div>
|
|
328
|
-
<devtools-widget slot="sidebar"
|
|
328
|
+
<devtools-widget slot="sidebar" ${widget(e => {
|
|
329
329
|
const tabbedPane = new UI.TabbedPane.TabbedPane(e);
|
|
330
330
|
output.closeAllTabs = () => { tabbedPane.closeTabs(tabbedPane.tabIds()); };
|
|
331
331
|
output.addTab = (id: string, tabTitle: string, view: UI.Widget.Widget, jslogContext: string) => {
|
|
@@ -137,6 +137,13 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
137
137
|
target.appendChild(output.elementsTreeOutline.element);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
output.elementsTreeOutline.maxTreeDepth = input.maxTreeDepth;
|
|
141
|
+
output.elementsTreeOutline.enableContextMenu = input.enableContextMenu ?? true;
|
|
142
|
+
output.elementsTreeOutline.showComments = input.showComments ?? true;
|
|
143
|
+
output.elementsTreeOutline.showAIButton = input.showAIButton ?? true;
|
|
144
|
+
output.elementsTreeOutline.disableEdits = input.disableEdits ?? false;
|
|
145
|
+
output.elementsTreeOutline.expandRoot = input.expandRoot ?? false;
|
|
146
|
+
|
|
140
147
|
if (input.visibleWidth !== undefined) {
|
|
141
148
|
output.elementsTreeOutline.setVisibleWidth(input.visibleWidth);
|
|
142
149
|
}
|
|
@@ -223,6 +230,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
223
230
|
#showComments = true;
|
|
224
231
|
#showAIButton = true;
|
|
225
232
|
#disableEdits = false;
|
|
233
|
+
#expandRoot = false;
|
|
226
234
|
#visible = false;
|
|
227
235
|
#visibleWidth?: number;
|
|
228
236
|
#wrap = false;
|
|
@@ -291,6 +299,15 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
291
299
|
this.performUpdate();
|
|
292
300
|
}
|
|
293
301
|
|
|
302
|
+
get expandRoot(): boolean {
|
|
303
|
+
return this.#expandRoot;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
set expandRoot(expandRoot: boolean) {
|
|
307
|
+
this.#expandRoot = expandRoot;
|
|
308
|
+
this.performUpdate();
|
|
309
|
+
}
|
|
310
|
+
|
|
294
311
|
#currentHighlightedNode: SDK.DOMModel.DOMNode|null = null;
|
|
295
312
|
|
|
296
313
|
#view: View;
|
|
@@ -347,11 +364,19 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
347
364
|
this.#viewOutput?.elementsTreeOutline?.highlightNodeAttribute(node, attribute);
|
|
348
365
|
}
|
|
349
366
|
|
|
350
|
-
|
|
367
|
+
get wrap(): boolean {
|
|
368
|
+
return this.#wrap;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
set wrap(wrap: boolean) {
|
|
351
372
|
this.#wrap = wrap;
|
|
352
373
|
this.performUpdate();
|
|
353
374
|
}
|
|
354
375
|
|
|
376
|
+
setWordWrap(wrap: boolean): void {
|
|
377
|
+
this.wrap = wrap;
|
|
378
|
+
}
|
|
379
|
+
|
|
355
380
|
selectedDOMNode(): SDK.DOMModel.DOMNode|null {
|
|
356
381
|
return this.#viewOutput.elementsTreeOutline?.selectedDOMNode() ?? null;
|
|
357
382
|
}
|
|
@@ -387,6 +412,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
387
412
|
showComments: this.#showComments,
|
|
388
413
|
showAIButton: this.#showAIButton,
|
|
389
414
|
disableEdits: this.#disableEdits,
|
|
415
|
+
expandRoot: this.#expandRoot,
|
|
390
416
|
visibleWidth: this.#visibleWidth,
|
|
391
417
|
visible: this.#visible,
|
|
392
418
|
wrap: this.#wrap,
|
|
@@ -565,12 +591,12 @@ export class ElementsTreeOutline extends
|
|
|
565
591
|
#issuesManager?: IssuesManager.IssuesManager.IssuesManager;
|
|
566
592
|
#popupHelper?: UI.PopoverHelper.PopoverHelper;
|
|
567
593
|
#nodeElementToIssues = new Map<Element, IssuesManager.Issue.Issue[]>();
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
594
|
+
maxTreeDepth?: number;
|
|
595
|
+
enableContextMenu: boolean;
|
|
596
|
+
showComments: boolean;
|
|
597
|
+
showAIButton: boolean;
|
|
598
|
+
disableEdits: boolean;
|
|
599
|
+
expandRoot: boolean;
|
|
574
600
|
|
|
575
601
|
constructor(
|
|
576
602
|
omitRootDOMNode?: boolean, selectEnabled?: boolean, hideGutter?: boolean, maxTreeDepth?: number,
|
|
@@ -1388,7 +1414,7 @@ export class ElementsTreeOutline extends
|
|
|
1388
1414
|
}
|
|
1389
1415
|
|
|
1390
1416
|
async showContextMenu(treeElement: ElementsTreeElement, event: Event): Promise<void> {
|
|
1391
|
-
if (UI.UIUtils.isEditing()) {
|
|
1417
|
+
if (UI.UIUtils.isEditing() || !this.enableContextMenu) {
|
|
1392
1418
|
return;
|
|
1393
1419
|
}
|
|
1394
1420
|
|