chrome-devtools-frontend 1.0.1578486 → 1.0.1578729
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/common/Revealer.ts +0 -5
- package/front_end/core/sdk/ConsoleModel.ts +0 -3
- package/front_end/models/ai_assistance/AiConversation.ts +42 -22
- package/front_end/models/issues_manager/CookieIssue.ts +0 -1
- package/front_end/models/issues_manager/IssuesManager.ts +2 -15
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +17 -25
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +0 -5
- package/front_end/panels/console/ConsoleViewMessage.ts +0 -32
- package/front_end/panels/console/consoleView.css +0 -5
- package/front_end/panels/media/PlayerListView.ts +13 -1
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/network/NetworkItemView.ts +2 -1
- package/front_end/panels/network/NetworkLogViewColumns.ts +17 -6
- package/front_end/panels/network/RequestInitiatorView.ts +20 -4
- package/front_end/panels/network/RequestPayloadView.ts +253 -280
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +3 -3
- package/front_end/panels/network/requestPayloadTree.css +6 -3
- package/front_end/panels/network/requestPayloadView.css +1 -0
- package/front_end/panels/security/SecurityPanel.ts +0 -16
- package/front_end/panels/security/security-meta.ts +1 -15
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +6 -5
- package/front_end/ui/legacy/Treeoutline.ts +81 -22
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +2 -1
- package/front_end/ui/legacy/softDropDown.css +7 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/mcp/mcp.ts +2 -0
- package/package.json +1 -1
|
@@ -34,10 +34,6 @@ const UIStrings = {
|
|
|
34
34
|
* @description The UI destination when right clicking an item that can be revealed
|
|
35
35
|
*/
|
|
36
36
|
applicationPanel: 'Application panel',
|
|
37
|
-
/**
|
|
38
|
-
* @description The UI destination when right clicking an item that can be revealed
|
|
39
|
-
*/
|
|
40
|
-
securityPanel: 'Security panel',
|
|
41
37
|
/**
|
|
42
38
|
* @description The UI destination when right clicking an item that can be revealed
|
|
43
39
|
*/
|
|
@@ -189,7 +185,6 @@ export const RevealerDestination = {
|
|
|
189
185
|
TIMELINE_PANEL: i18nLazyString(UIStrings.timelinePanel),
|
|
190
186
|
APPLICATION_PANEL: i18nLazyString(UIStrings.applicationPanel),
|
|
191
187
|
SOURCES_PANEL: i18nLazyString(UIStrings.sourcesPanel),
|
|
192
|
-
SECURITY_PANEL: i18nLazyString(UIStrings.securityPanel),
|
|
193
188
|
MEMORY_INSPECTOR_PANEL: i18nLazyString(UIStrings.memoryInspectorPanel),
|
|
194
189
|
ANIMATIONS_PANEL: i18nLazyString(UIStrings.animationsPanel),
|
|
195
190
|
};
|
|
@@ -545,7 +545,6 @@ export interface ConsoleMessageDetails {
|
|
|
545
545
|
context?: string;
|
|
546
546
|
affectedResources?: AffectedResources;
|
|
547
547
|
category?: Protocol.Log.LogEntryCategory;
|
|
548
|
-
isCookieReportIssue?: boolean;
|
|
549
548
|
}
|
|
550
549
|
|
|
551
550
|
export class ConsoleMessage {
|
|
@@ -569,7 +568,6 @@ export class ConsoleMessage {
|
|
|
569
568
|
#exceptionId?: number = undefined;
|
|
570
569
|
#affectedResources?: AffectedResources;
|
|
571
570
|
category?: Protocol.Log.LogEntryCategory;
|
|
572
|
-
isCookieReportIssue = false;
|
|
573
571
|
|
|
574
572
|
/**
|
|
575
573
|
* The parent frame of the `console.log` call of logpoints or conditional breakpoints
|
|
@@ -600,7 +598,6 @@ export class ConsoleMessage {
|
|
|
600
598
|
this.workerId = details?.workerId;
|
|
601
599
|
this.#affectedResources = details?.affectedResources;
|
|
602
600
|
this.category = details?.category;
|
|
603
|
-
this.isCookieReportIssue = Boolean(details?.isCookieReportIssue);
|
|
604
601
|
|
|
605
602
|
if (!this.#executionContextId && this.#runtimeModel) {
|
|
606
603
|
if (this.scriptId) {
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
ResponseType
|
|
18
18
|
} from './agents/AiAgent.js';
|
|
19
19
|
import {ContextSelectionAgent} from './agents/ContextSelectionAgent.js';
|
|
20
|
-
import {FileAgent} from './agents/FileAgent.js';
|
|
21
|
-
import {NetworkAgent} from './agents/NetworkAgent.js';
|
|
22
|
-
import {PerformanceAgent} from './agents/PerformanceAgent.js';
|
|
23
|
-
import {StylingAgent} from './agents/StylingAgent.js';
|
|
20
|
+
import {FileAgent, FileContext} from './agents/FileAgent.js';
|
|
21
|
+
import {NetworkAgent, RequestContext} from './agents/NetworkAgent.js';
|
|
22
|
+
import {PerformanceAgent, PerformanceTraceContext} from './agents/PerformanceAgent.js';
|
|
23
|
+
import {NodeContext, StylingAgent} from './agents/StylingAgent.js';
|
|
24
24
|
import {AiHistoryStorage, ConversationType, type SerializedConversation} from './AiHistoryStorage.js';
|
|
25
25
|
import type {ChangeManager} from './ChangeManager.js';
|
|
26
26
|
import {NetworkRequestFormatter} from './data_formatters/NetworkRequestFormatter.js';
|
|
@@ -59,14 +59,17 @@ export class AiConversation {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
readonly id: string;
|
|
62
|
-
#
|
|
62
|
+
// Handled in #updateAgent
|
|
63
|
+
#type!: ConversationType;
|
|
64
|
+
// Handled in #updateAgent
|
|
65
|
+
#agent!: AiAgent<unknown>;
|
|
66
|
+
|
|
63
67
|
#isReadOnly: boolean;
|
|
64
68
|
readonly history: ResponseData[];
|
|
65
69
|
#isExternal: boolean;
|
|
66
70
|
|
|
67
71
|
#aidaClient: Host.AidaClient.AidaClient;
|
|
68
72
|
#changeManager: ChangeManager|undefined;
|
|
69
|
-
#agent: AiAgent<unknown>;
|
|
70
73
|
#origin?: string;
|
|
71
74
|
|
|
72
75
|
#contexts: Array<ConversationContext<unknown>> = [];
|
|
@@ -82,14 +85,13 @@ export class AiConversation {
|
|
|
82
85
|
) {
|
|
83
86
|
this.#changeManager = changeManager;
|
|
84
87
|
this.#aidaClient = aidaClient;
|
|
85
|
-
this.#type = type;
|
|
86
88
|
|
|
87
89
|
this.id = id;
|
|
88
90
|
this.#isReadOnly = isReadOnly;
|
|
89
91
|
this.#isExternal = isExternal;
|
|
90
92
|
this.history = this.#reconstructHistory(data);
|
|
91
93
|
// Needs to be last
|
|
92
|
-
this.#
|
|
94
|
+
this.#updateAgent(type);
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
get isReadOnly(): boolean {
|
|
@@ -123,10 +125,26 @@ export class AiConversation {
|
|
|
123
125
|
setContext(updateContext: ConversationContext<unknown>|null): void {
|
|
124
126
|
if (!updateContext) {
|
|
125
127
|
this.#contexts = [];
|
|
128
|
+
if (isAiAssistanceContextSelectionAgentEnabled()) {
|
|
129
|
+
this.#updateAgent(ConversationType.NONE);
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
return;
|
|
127
133
|
}
|
|
128
134
|
|
|
129
135
|
this.#contexts = [updateContext];
|
|
136
|
+
|
|
137
|
+
if (isAiAssistanceContextSelectionAgentEnabled()) {
|
|
138
|
+
if (updateContext instanceof FileContext) {
|
|
139
|
+
this.#updateAgent(ConversationType.FILE);
|
|
140
|
+
} else if (updateContext instanceof NodeContext) {
|
|
141
|
+
this.#updateAgent(ConversationType.STYLING);
|
|
142
|
+
} else if (updateContext instanceof RequestContext) {
|
|
143
|
+
this.#updateAgent(ConversationType.NETWORK);
|
|
144
|
+
} else if (updateContext instanceof PerformanceTraceContext) {
|
|
145
|
+
this.#updateAgent(ConversationType.PERFORMANCE);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
130
148
|
}
|
|
131
149
|
|
|
132
150
|
get selectedContext(): ConversationContext<unknown>|undefined {
|
|
@@ -249,37 +267,40 @@ export class AiConversation {
|
|
|
249
267
|
};
|
|
250
268
|
}
|
|
251
269
|
|
|
252
|
-
#
|
|
270
|
+
#updateAgent(type: ConversationType): void {
|
|
271
|
+
if (this.#type === type) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
this.#type = type;
|
|
253
276
|
const options = {
|
|
254
277
|
aidaClient: this.#aidaClient,
|
|
255
278
|
serverSideLoggingEnabled: isAiAssistanceServerSideLoggingEnabled(),
|
|
256
279
|
sessionId: this.id,
|
|
257
280
|
changeManager: this.#changeManager,
|
|
258
281
|
};
|
|
259
|
-
|
|
260
|
-
switch (this.#type) {
|
|
282
|
+
switch (type) {
|
|
261
283
|
case ConversationType.STYLING: {
|
|
262
|
-
agent = new StylingAgent(options);
|
|
284
|
+
this.#agent = new StylingAgent(options);
|
|
263
285
|
break;
|
|
264
286
|
}
|
|
265
287
|
case ConversationType.NETWORK: {
|
|
266
|
-
agent = new NetworkAgent(options);
|
|
288
|
+
this.#agent = new NetworkAgent(options);
|
|
267
289
|
break;
|
|
268
290
|
}
|
|
269
291
|
case ConversationType.FILE: {
|
|
270
|
-
agent = new FileAgent(options);
|
|
292
|
+
this.#agent = new FileAgent(options);
|
|
271
293
|
break;
|
|
272
294
|
}
|
|
273
295
|
case ConversationType.PERFORMANCE: {
|
|
274
|
-
agent = new PerformanceAgent(options);
|
|
296
|
+
this.#agent = new PerformanceAgent(options);
|
|
275
297
|
break;
|
|
276
298
|
}
|
|
277
299
|
case ConversationType.NONE: {
|
|
278
|
-
agent = new ContextSelectionAgent(options);
|
|
300
|
+
this.#agent = new ContextSelectionAgent(options);
|
|
279
301
|
break;
|
|
280
302
|
}
|
|
281
303
|
}
|
|
282
|
-
return agent;
|
|
283
304
|
}
|
|
284
305
|
|
|
285
306
|
#factsCache = new Map<ExtraContext, Host.AidaClient.RequestFact>();
|
|
@@ -399,11 +420,6 @@ Time: ${micros(time)}`;
|
|
|
399
420
|
},
|
|
400
421
|
options.multimodalInput,
|
|
401
422
|
)) {
|
|
402
|
-
if (data.type === ResponseType.CONTEXT_CHANGE) {
|
|
403
|
-
this.#type = ConversationType.NETWORK;
|
|
404
|
-
this.#agent = this.#createAgent();
|
|
405
|
-
}
|
|
406
|
-
|
|
407
423
|
if (shouldAddToHistory(data)) {
|
|
408
424
|
void this.addHistoryItem(data);
|
|
409
425
|
}
|
|
@@ -439,3 +455,7 @@ function isAiAssistanceServerSideLoggingEnabled(): boolean {
|
|
|
439
455
|
type ExtraContext = SDK.DOMModel.DOMNode|SDK.NetworkRequest.NetworkRequest|
|
|
440
456
|
{event: Trace.Types.Events.Event, traceStartTime: Trace.Types.Timing.Micro}|
|
|
441
457
|
{insight: Trace.Insights.Types.InsightModel, trace: Trace.TraceModel.ParsedTrace};
|
|
458
|
+
|
|
459
|
+
function isAiAssistanceContextSelectionAgentEnabled(): boolean {
|
|
460
|
+
return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled);
|
|
461
|
+
}
|
|
@@ -327,7 +327,6 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
327
327
|
Protocol.Log.LogEntryLevel.Warning, UIStrings.consoleTpcdErrorMessage, {
|
|
328
328
|
url: this.details().request?.url as Platform.DevToolsPath.UrlString | undefined,
|
|
329
329
|
affectedResources: {requestId: this.details().request?.requestId, issueId: this.issueId},
|
|
330
|
-
isCookieReportIssue: true
|
|
331
330
|
});
|
|
332
331
|
}
|
|
333
332
|
return;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
7
|
import * as Protocol from '../../generated/protocol.js';
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ import {BounceTrackingIssue} from './BounceTrackingIssue.js';
|
|
|
12
11
|
import {ClientHintIssue} from './ClientHintIssue.js';
|
|
13
12
|
import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
|
|
14
13
|
import {CookieDeprecationMetadataIssue} from './CookieDeprecationMetadataIssue.js';
|
|
15
|
-
import {CookieIssue
|
|
14
|
+
import {CookieIssue} from './CookieIssue.js';
|
|
16
15
|
import {CorsIssue} from './CorsIssue.js';
|
|
17
16
|
import {CrossOriginEmbedderPolicyIssue, isCrossOriginEmbedderPolicyIssue} from './CrossOriginEmbedderPolicyIssue.js';
|
|
18
17
|
import {DeprecationIssue} from './DeprecationIssue.js';
|
|
@@ -211,7 +210,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
211
210
|
#thirdPartyCookiePhaseoutIssueCount = new Map<IssueKind, number>();
|
|
212
211
|
#issuesById = new Map<string, Issue>();
|
|
213
212
|
#issuesByOutermostTarget: WeakMap<SDK.Target.Target, Set<Issue>> = new Map();
|
|
214
|
-
#thirdPartyCookiePhaseoutIssueMessageSent = false;
|
|
215
213
|
|
|
216
214
|
constructor(
|
|
217
215
|
private readonly showThirdPartyIssuesSetting?: Common.Settings.Setting<boolean>,
|
|
@@ -314,7 +312,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
314
312
|
|
|
315
313
|
#onIssueAddedEvent(event: Common.EventTarget.EventTargetEvent<SDK.IssuesModel.IssueAddedEvent>): void {
|
|
316
314
|
const {issuesModel, inspectorIssue} = event.data;
|
|
317
|
-
const isPrivacyUiEnabled = Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled;
|
|
318
315
|
|
|
319
316
|
const issues = createIssuesFromProtocolIssue(issuesModel, inspectorIssue);
|
|
320
317
|
for (const issue of issues) {
|
|
@@ -323,16 +320,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
323
320
|
if (!message) {
|
|
324
321
|
continue;
|
|
325
322
|
}
|
|
326
|
-
|
|
327
|
-
// Only show one message for third-party cookie phaseout issues if the new privacy ui is enabled
|
|
328
|
-
const is3rdPartyCookiePhaseoutIssue =
|
|
329
|
-
CookieIssue.getSubCategory(issue.code()) === CookieIssueSubCategory.THIRD_PARTY_PHASEOUT_COOKIE;
|
|
330
|
-
if (!is3rdPartyCookiePhaseoutIssue || !isPrivacyUiEnabled || !this.#thirdPartyCookiePhaseoutIssueMessageSent) {
|
|
331
|
-
issuesModel.target().model(SDK.ConsoleModel.ConsoleModel)?.addMessage(message);
|
|
332
|
-
}
|
|
333
|
-
if (is3rdPartyCookiePhaseoutIssue && isPrivacyUiEnabled) {
|
|
334
|
-
this.#thirdPartyCookiePhaseoutIssueMessageSent = true;
|
|
335
|
-
}
|
|
323
|
+
issuesModel.target().model(SDK.ConsoleModel.ConsoleModel)?.addMessage(message);
|
|
336
324
|
}
|
|
337
325
|
}
|
|
338
326
|
|
|
@@ -453,7 +441,6 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
453
441
|
this.#issuesById.clear();
|
|
454
442
|
this.#hiddenIssueCount.clear();
|
|
455
443
|
this.#thirdPartyCookiePhaseoutIssueCount.clear();
|
|
456
|
-
this.#thirdPartyCookiePhaseoutIssueMessageSent = false;
|
|
457
444
|
const values = this.hideIssueSetting?.get();
|
|
458
445
|
for (const [key, issue] of this.#allIssues) {
|
|
459
446
|
if (this.#issueFilter(issue)) {
|
|
@@ -729,7 +729,9 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
729
729
|
this.#conversation = conversation;
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
-
this.#conversation?.setContext(this.#getConversationContext(
|
|
732
|
+
this.#conversation?.setContext(this.#getConversationContext(
|
|
733
|
+
isAiAssistanceContextSelectionAgentEnabled() ? this.#getDefaultConversationType() :
|
|
734
|
+
(this.#conversation?.type ?? null)));
|
|
733
735
|
|
|
734
736
|
this.requestUpdate();
|
|
735
737
|
}
|
|
@@ -1269,12 +1271,9 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1269
1271
|
this.#runAbortController = new AbortController();
|
|
1270
1272
|
}
|
|
1271
1273
|
|
|
1272
|
-
#getConversationContext(
|
|
1274
|
+
#getConversationContext(type?: AiAssistanceModel.AiHistoryStorage.ConversationType):
|
|
1273
1275
|
AiAssistanceModel.AiAgent.ConversationContext<unknown>|null {
|
|
1274
|
-
|
|
1275
|
-
return null;
|
|
1276
|
-
}
|
|
1277
|
-
switch (conversation.type) {
|
|
1276
|
+
switch (type) {
|
|
1278
1277
|
case AiAssistanceModel.AiHistoryStorage.ConversationType.STYLING:
|
|
1279
1278
|
return this.#selectedElement;
|
|
1280
1279
|
case AiAssistanceModel.AiHistoryStorage.ConversationType.FILE:
|
|
@@ -1284,35 +1283,28 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1284
1283
|
case AiAssistanceModel.AiHistoryStorage.ConversationType.PERFORMANCE:
|
|
1285
1284
|
return this.#selectedPerformanceTrace;
|
|
1286
1285
|
case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE:
|
|
1286
|
+
case undefined:
|
|
1287
1287
|
return null;
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
#handleConversationContextChange = (data: unknown): void => {
|
|
1292
1292
|
if (data instanceof Workspace.UISourceCode.UISourceCode) {
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
}
|
|
1296
|
-
this.#selectedFile = new AiAssistanceModel.FileAgent.FileContext(data);
|
|
1293
|
+
const context = new AiAssistanceModel.FileAgent.FileContext(data);
|
|
1294
|
+
this.#selectedFile = context;
|
|
1297
1295
|
|
|
1298
1296
|
} else if (data instanceof SDK.DOMModel.DOMNode) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
return;
|
|
1303
|
-
}
|
|
1304
|
-
this.#selectedElement = new AiAssistanceModel.StylingAgent.NodeContext(data);
|
|
1297
|
+
const context = new AiAssistanceModel.StylingAgent.NodeContext(data);
|
|
1298
|
+
this.#selectedElement = context;
|
|
1299
|
+
|
|
1305
1300
|
} else if (data instanceof SDK.NetworkRequest.NetworkRequest) {
|
|
1306
|
-
if (this.#selectedRequest?.getItem() === data) {
|
|
1307
|
-
return;
|
|
1308
|
-
}
|
|
1309
1301
|
const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
|
|
1310
|
-
|
|
1302
|
+
|
|
1303
|
+
const context = new AiAssistanceModel.NetworkAgent.RequestContext(data, calculator);
|
|
1304
|
+
this.#selectedRequest = context;
|
|
1311
1305
|
} else if (data instanceof AiAssistanceModel.AIContext.AgentFocus) {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
}
|
|
1315
|
-
this.#selectedPerformanceTrace = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(data);
|
|
1306
|
+
const context = new AiAssistanceModel.PerformanceAgent.PerformanceTraceContext(data);
|
|
1307
|
+
this.#selectedPerformanceTrace = context;
|
|
1316
1308
|
}
|
|
1317
1309
|
|
|
1318
1310
|
this.#updateConversationState(this.#conversation);
|
|
@@ -1329,7 +1321,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1329
1321
|
// Cancel any previous in-flight conversation.
|
|
1330
1322
|
this.#cancel();
|
|
1331
1323
|
const signal = this.#runAbortController.signal;
|
|
1332
|
-
const context = this.#getConversationContext(this.#conversation);
|
|
1324
|
+
const context = this.#getConversationContext(this.#conversation.type);
|
|
1333
1325
|
this.#conversation.setContext(context);
|
|
1334
1326
|
|
|
1335
1327
|
// If a different context is provided, it must be from the same origin.
|
|
@@ -174,7 +174,6 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
174
174
|
return new AiAssistance.ActionDelegate();
|
|
175
175
|
},
|
|
176
176
|
condition: config => isAnyFeatureAvailable(config) && !isPolicyRestricted(config) && !isGeoRestricted(config),
|
|
177
|
-
featurePromotionId: 'debug-with-ai',
|
|
178
177
|
});
|
|
179
178
|
|
|
180
179
|
UI.ActionRegistration.registerActionExtension({
|
|
@@ -38,7 +38,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
38
38
|
import * as Host from '../../core/host/host.js';
|
|
39
39
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
40
40
|
import * as Platform from '../../core/platform/platform.js';
|
|
41
|
-
import * as Root from '../../core/root/root.js';
|
|
42
41
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
43
42
|
import * as Protocol from '../../generated/protocol.js';
|
|
44
43
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
|
@@ -47,7 +46,6 @@ import type * as IssuesManager from '../../models/issues_manager/issues_manager.
|
|
|
47
46
|
import * as Logs from '../../models/logs/logs.js';
|
|
48
47
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
49
48
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
50
|
-
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
51
49
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
52
50
|
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
53
51
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
@@ -61,7 +59,6 @@ import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
|
61
59
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
62
60
|
import {render} from '../../ui/lit/lit.js';
|
|
63
61
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
64
|
-
import * as Security from '../security/security.js';
|
|
65
62
|
|
|
66
63
|
import {format, updateStyle} from './ConsoleFormat.js';
|
|
67
64
|
import {ConsoleInsightTeaser} from './ConsoleInsightTeaser.js';
|
|
@@ -220,10 +217,6 @@ const UIStrings = {
|
|
|
220
217
|
* @description Message to offer insights for a console message
|
|
221
218
|
*/
|
|
222
219
|
explainThisMessageWithAI: 'Understand this message. Powered by AI',
|
|
223
|
-
/**
|
|
224
|
-
* @description Tooltip shown when user hovers over the cookie icon to explain that the button will bring the user to the cookie report
|
|
225
|
-
*/
|
|
226
|
-
SeeIssueInCookieReport: 'Click to open privacy and security panel and show third-party cookie report',
|
|
227
220
|
/**
|
|
228
221
|
* @description Element text content in Object Properties Section
|
|
229
222
|
*/
|
|
@@ -574,23 +567,6 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
574
567
|
return elements;
|
|
575
568
|
}
|
|
576
569
|
|
|
577
|
-
#appendCookieReportButtonToElem(elem: HTMLElement): void {
|
|
578
|
-
const button = new Buttons.Button.Button();
|
|
579
|
-
button.data = {
|
|
580
|
-
size: Buttons.Button.Size.SMALL,
|
|
581
|
-
variant: Buttons.Button.Variant.ICON,
|
|
582
|
-
iconName: 'cookie',
|
|
583
|
-
jslogContext: 'privacy',
|
|
584
|
-
title: i18nString(UIStrings.SeeIssueInCookieReport)
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
button.addEventListener('click', () => {
|
|
588
|
-
void Common.Revealer.reveal(new Security.CookieReportView.CookieReportView());
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
elem.appendChild(button);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
570
|
#getLinkifierMetric(): Host.UserMetrics.Action|undefined {
|
|
595
571
|
const request = Logs.NetworkLog.NetworkLog.requestForConsoleMessage(this.message);
|
|
596
572
|
if (request?.resourceType().isStyleSheet()) {
|
|
@@ -631,14 +607,6 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
631
607
|
return null;
|
|
632
608
|
};
|
|
633
609
|
|
|
634
|
-
if (this.message.isCookieReportIssue && Root.Runtime.hostConfig.devToolsPrivacyUI?.enabled) {
|
|
635
|
-
const anchorWrapperElement = document.createElement('span');
|
|
636
|
-
anchorWrapperElement.classList.add('console-message-anchor', 'cookie-report-anchor');
|
|
637
|
-
this.#appendCookieReportButtonToElem(anchorWrapperElement);
|
|
638
|
-
UI.UIUtils.createTextChild(anchorWrapperElement, ' ');
|
|
639
|
-
return anchorWrapperElement;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
610
|
const anchorElement = linkify(this.message);
|
|
643
611
|
// Append a space to prevent the anchor text from being glued to the console message when the user selects and copies the console messages.
|
|
644
612
|
if (anchorElement) {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import '../../ui/kit/kit.js';
|
|
6
6
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
8
9
|
import type * as Protocol from '../../generated/protocol.js';
|
|
9
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
11
|
import {Directives, html, render} from '../../ui/lit/lit.js';
|
|
@@ -61,7 +62,8 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
61
62
|
render(
|
|
62
63
|
html`
|
|
63
64
|
<style>${playerListViewStyles}</style>
|
|
64
|
-
<div class="player-entry-header">${i18nString(UIStrings.players)}</div>
|
|
65
|
+
<div class="player-entry-header" id="players-header">${i18nString(UIStrings.players)}</div>
|
|
66
|
+
<div role="listbox" aria-labelledby="players-header">
|
|
65
67
|
${input.players.map(player => {
|
|
66
68
|
const isSelected = player.playerID === input.selectedPlayerID;
|
|
67
69
|
return html`
|
|
@@ -71,8 +73,17 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
71
73
|
selected: isSelected,
|
|
72
74
|
'force-white-icons': isSelected,
|
|
73
75
|
})}
|
|
76
|
+
tabindex="0"
|
|
74
77
|
@click=${() => input.onPlayerClick(player.playerID)}
|
|
78
|
+
@keydown=${(e: KeyboardEvent) => {
|
|
79
|
+
if (Platform.KeyboardUtilities.isEnterOrSpaceKey(e)) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
input.onPlayerClick(player.playerID);
|
|
82
|
+
}
|
|
83
|
+
}}
|
|
75
84
|
@contextmenu=${(e: Event) => input.onPlayerContextMenu(player.playerID, e)}
|
|
85
|
+
role="option"
|
|
86
|
+
aria-selected=${isSelected}
|
|
76
87
|
jslog=${VisualLogging.item('player').track({click: true})}>
|
|
77
88
|
<div class="player-entry-status-icon vbox">
|
|
78
89
|
<div class="player-entry-status-icon-centering">
|
|
@@ -84,6 +95,7 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
84
95
|
</div>
|
|
85
96
|
`;
|
|
86
97
|
})}
|
|
98
|
+
</div>
|
|
87
99
|
`,
|
|
88
100
|
target
|
|
89
101
|
);
|
|
@@ -34,6 +34,11 @@ li.storage-group-list-item::before {
|
|
|
34
34
|
background: var(--sys-color-state-hover-on-subtle);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
&:focus-visible {
|
|
38
|
+
outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
|
|
39
|
+
outline-offset: calc(var(--sys-size-2) * -1);
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
&.selected {
|
|
38
43
|
background: var(--sys-color-tonal-container);
|
|
39
44
|
color: var(--sys-color-on-tonal-container);
|
|
@@ -345,7 +345,8 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
|
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
if (this.#request.queryParameters || await this.#request.requestFormData()) {
|
|
348
|
-
this.#payloadView = new RequestPayloadView(
|
|
348
|
+
this.#payloadView = new RequestPayloadView();
|
|
349
|
+
this.#payloadView.request = this.#request;
|
|
349
350
|
this.appendTab(
|
|
350
351
|
NetworkForward.UIRequestLocation.UIRequestTabs.PAYLOAD, i18nString(UIStrings.payload), this.#payloadView,
|
|
351
352
|
i18nString(UIStrings.payload), /* userGesture=*/ void 0,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as Common from '../../core/common/common.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import type * as NetworkTimeCalculator from '../../models/network_time_calculator/network_time_calculator.js';
|
|
9
|
+
import * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
9
10
|
import {Icon} from '../../ui/kit/kit.js';
|
|
10
11
|
import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
|
|
11
12
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
@@ -880,20 +881,30 @@ export class NetworkLogViewColumns {
|
|
|
880
881
|
if (!request) {
|
|
881
882
|
return null;
|
|
882
883
|
}
|
|
884
|
+
let descriptor: Common.EventTarget.EventDescriptor|undefined = undefined;
|
|
883
885
|
return {
|
|
884
886
|
box: anchor.boxInWindow(),
|
|
885
887
|
show: async (popover: UI.GlassPane.GlassPane) => {
|
|
886
|
-
this.popupLinkifier
|
|
887
|
-
popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
|
|
888
|
-
});
|
|
889
|
-
const content = RequestInitiatorView.createStackTracePreview((request), this.popupLinkifier, false);
|
|
888
|
+
const content = await RequestInitiatorView.createStackTracePreview((request), this.popupLinkifier, false);
|
|
890
889
|
if (!content) {
|
|
891
890
|
return false;
|
|
892
891
|
}
|
|
893
|
-
content.
|
|
892
|
+
descriptor = content.stackTrace?.addEventListener(StackTrace.StackTrace.Events.UPDATED, async () => {
|
|
893
|
+
await content.preview.updateComplete;
|
|
894
|
+
popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
|
|
895
|
+
});
|
|
896
|
+
content.preview.show(popover.contentElement);
|
|
897
|
+
await content.preview.updateComplete.then(() => {
|
|
898
|
+
popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
|
|
899
|
+
});
|
|
894
900
|
return true;
|
|
895
901
|
},
|
|
896
|
-
hide:
|
|
902
|
+
hide: () => {
|
|
903
|
+
this.popupLinkifier.reset();
|
|
904
|
+
if (descriptor) {
|
|
905
|
+
Common.EventTarget.removeEventListeners([descriptor]);
|
|
906
|
+
}
|
|
907
|
+
},
|
|
897
908
|
};
|
|
898
909
|
}
|
|
899
910
|
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import * as Bindings from '../../models/bindings/bindings.js';
|
|
8
9
|
import * as Logs from '../../models/logs/logs.js';
|
|
10
|
+
import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
9
11
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
10
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
13
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -172,17 +174,31 @@ export class RequestInitiatorView extends UI.Widget.VBox {
|
|
|
172
174
|
this.#view = view;
|
|
173
175
|
}
|
|
174
176
|
|
|
175
|
-
static createStackTracePreview(
|
|
177
|
+
static async createStackTracePreview(
|
|
176
178
|
request: SDK.NetworkRequest.NetworkRequest, linkifier: Components.Linkifier.Linkifier,
|
|
177
|
-
focusableLink?: boolean):
|
|
179
|
+
focusableLink?: boolean): Promise<{
|
|
180
|
+
preview: Components.JSPresentationUtils.StackTracePreviewContent,
|
|
181
|
+
stackTrace: StackTrace.StackTrace.StackTrace|null,
|
|
182
|
+
}|null> {
|
|
178
183
|
const initiator = request.initiator();
|
|
179
184
|
if (!initiator?.stack) {
|
|
180
185
|
return null;
|
|
181
186
|
}
|
|
182
187
|
const networkManager = SDK.NetworkManager.NetworkManager.forRequest(request);
|
|
183
188
|
const target = networkManager ? networkManager.target() : undefined;
|
|
184
|
-
|
|
185
|
-
|
|
189
|
+
if (target) {
|
|
190
|
+
const stackTrace = await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()
|
|
191
|
+
.createStackTraceFromProtocolRuntime(initiator.stack, target);
|
|
192
|
+
const preview = new Components.JSPresentationUtils.StackTracePreviewContent(
|
|
193
|
+
undefined, target, linkifier, {tabStops: focusableLink});
|
|
194
|
+
preview.stackTrace = stackTrace;
|
|
195
|
+
return {preview, stackTrace};
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
preview: new Components.JSPresentationUtils.StackTracePreviewContent(
|
|
199
|
+
undefined, target, linkifier, {runtimeStackTrace: initiator.stack, tabStops: focusableLink}),
|
|
200
|
+
stackTrace: null
|
|
201
|
+
};
|
|
186
202
|
}
|
|
187
203
|
|
|
188
204
|
override performUpdate(): void {
|