chrome-devtools-frontend 1.0.1645245 → 1.0.1646714
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/skills/devtools-source-maps/SKILL.md +124 -0
- package/SECURITY.md +1 -1
- package/docs/README.md +1 -0
- package/docs/using_source_maps.md +159 -0
- package/front_end/core/host/AidaClientTypes.ts +2 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/DebuggerModel.ts +7 -9
- package/front_end/core/sdk/NetworkRequest.ts +0 -24
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +279 -0
- package/front_end/generated/protocol.ts +0 -1
- package/front_end/models/ai_assistance/AiAgent2.ts +43 -11
- package/front_end/models/ai_assistance/AiConversation.ts +4 -2
- package/front_end/models/ai_assistance/AiOrigins.ts +63 -2
- package/front_end/models/ai_assistance/README.md +15 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/FileAgent.ts +9 -42
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +9 -133
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +10 -2
- package/front_end/models/ai_assistance/agents/README.md +7 -0
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +45 -0
- package/front_end/models/ai_assistance/ai_assistance.ts +8 -0
- package/front_end/models/ai_assistance/contexts/FileContext.ts +45 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +48 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.ts +116 -0
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/network.md +16 -0
- package/front_end/models/ai_assistance/skills/styling.md +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +118 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +124 -0
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/Tool.ts +2 -0
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -0
- package/front_end/models/emulation/EmulatedDevices.ts +430 -12
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +15 -11
- package/front_end/models/web_mcp/WebMCPModel.ts +8 -48
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -13
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -4
- package/front_end/panels/application/ApplicationPanelSidebar.ts +25 -0
- package/front_end/panels/application/WebMCPTreeElement.ts +8 -0
- package/front_end/panels/application/WebMCPView.ts +40 -70
- package/front_end/panels/application/components/AdsView.ts +31 -28
- package/front_end/panels/application/components/adsView.css +6 -0
- package/front_end/panels/common/ExtensionServer.ts +5 -0
- package/front_end/panels/profiler/IsolateSelector.ts +4 -2
- package/front_end/panels/profiler/ProfileLauncherView.ts +194 -126
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +9 -0
- package/package.json +1 -1
|
@@ -349,6 +349,7 @@ async function getEmptyStateSuggestions(conversation?: AiAssistanceModel.AiConve
|
|
|
349
349
|
return [
|
|
350
350
|
{title: 'How is localStorage used on this page?', jslogContext: 'storage-default'},
|
|
351
351
|
{title: 'How is sessionStorage used on this page?', jslogContext: 'storage-default'},
|
|
352
|
+
{title: 'What cookies are stored for this page?', jslogContext: 'storage-default'},
|
|
352
353
|
];
|
|
353
354
|
}
|
|
354
355
|
|
|
@@ -576,12 +577,12 @@ function createDOMNodeContext(node: SDK.DOMModel.DOMNode|null): AiAssistanceMode
|
|
|
576
577
|
return new AiAssistanceModel.DOMNodeContext.DOMNodeContext(node);
|
|
577
578
|
}
|
|
578
579
|
|
|
579
|
-
function createFileContext(file: Workspace.UISourceCode.UISourceCode|null): AiAssistanceModel.
|
|
580
|
+
function createFileContext(file: Workspace.UISourceCode.UISourceCode|null): AiAssistanceModel.FileContext.FileContext|
|
|
580
581
|
null {
|
|
581
582
|
if (!file) {
|
|
582
583
|
return null;
|
|
583
584
|
}
|
|
584
|
-
return new AiAssistanceModel.
|
|
585
|
+
return new AiAssistanceModel.FileContext.FileContext(file);
|
|
585
586
|
}
|
|
586
587
|
|
|
587
588
|
function createAccessibilityContext(report: LighthousePanel.LighthousePanel.ActiveLighthouseReport|null):
|
|
@@ -592,13 +593,13 @@ function createAccessibilityContext(report: LighthousePanel.LighthousePanel.Acti
|
|
|
592
593
|
return new AiAssistanceModel.AccessibilityAgent.AccessibilityContext(report.report);
|
|
593
594
|
}
|
|
594
595
|
|
|
595
|
-
function createRequestContext(request: SDK.NetworkRequest.NetworkRequest|
|
|
596
|
-
|
|
596
|
+
function createRequestContext(request: SDK.NetworkRequest.NetworkRequest|
|
|
597
|
+
null): AiAssistanceModel.RequestContext.RequestContext|null {
|
|
597
598
|
if (!request) {
|
|
598
599
|
return null;
|
|
599
600
|
}
|
|
600
601
|
const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
|
|
601
|
-
return new AiAssistanceModel.
|
|
602
|
+
return new AiAssistanceModel.RequestContext.RequestContext(request, calculator);
|
|
602
603
|
}
|
|
603
604
|
|
|
604
605
|
function createPerformanceTraceContext(focus: AiAssistanceModel.AIContext.AgentFocus|null):
|
|
@@ -666,10 +667,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
666
667
|
|
|
667
668
|
#conversation?: AiAssistanceModel.AiConversation.AiConversation;
|
|
668
669
|
|
|
669
|
-
#selectedFile: AiAssistanceModel.
|
|
670
|
+
#selectedFile: AiAssistanceModel.FileContext.FileContext|null = null;
|
|
670
671
|
#selectedElement: AiAssistanceModel.DOMNodeContext.DOMNodeContext|null = null;
|
|
671
672
|
#selectedPerformanceTrace: AiAssistanceModel.PerformanceAgent.PerformanceTraceContext|null = null;
|
|
672
|
-
#selectedRequest: AiAssistanceModel.
|
|
673
|
+
#selectedRequest: AiAssistanceModel.RequestContext.RequestContext|null = null;
|
|
673
674
|
|
|
674
675
|
#selectedAccessibility: AiAssistanceModel.AccessibilityAgent.AccessibilityContext|null = null;
|
|
675
676
|
#selectedStorage: AiAssistanceModel.StorageAgent.StorageContext|null = null;
|
|
@@ -1254,7 +1255,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1254
1255
|
|
|
1255
1256
|
if (Boolean(ev.data)) {
|
|
1256
1257
|
const calculator = NetworkPanel.NetworkPanel.NetworkPanel.instance().networkLogView.timeCalculator();
|
|
1257
|
-
this.#selectedRequest = new AiAssistanceModel.
|
|
1258
|
+
this.#selectedRequest = new AiAssistanceModel.RequestContext.RequestContext(ev.data, calculator);
|
|
1258
1259
|
} else {
|
|
1259
1260
|
this.#selectedRequest = null;
|
|
1260
1261
|
}
|
|
@@ -1280,7 +1281,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1280
1281
|
if (!newFile || this.#selectedFile?.getItem() === newFile) {
|
|
1281
1282
|
return;
|
|
1282
1283
|
}
|
|
1283
|
-
this.#selectedFile = new AiAssistanceModel.
|
|
1284
|
+
this.#selectedFile = new AiAssistanceModel.FileContext.FileContext(ev.data);
|
|
1284
1285
|
this.#updateConversationState(this.#conversation);
|
|
1285
1286
|
};
|
|
1286
1287
|
|
|
@@ -1488,12 +1489,12 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1488
1489
|
}
|
|
1489
1490
|
|
|
1490
1491
|
const context = this.#conversation.selectedContext;
|
|
1491
|
-
if (context instanceof AiAssistanceModel.
|
|
1492
|
+
if (context instanceof AiAssistanceModel.RequestContext.RequestContext) {
|
|
1492
1493
|
const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
1493
1494
|
context.getItem(), NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT);
|
|
1494
1495
|
return Common.Revealer.reveal(requestLocation);
|
|
1495
1496
|
}
|
|
1496
|
-
if (context instanceof AiAssistanceModel.
|
|
1497
|
+
if (context instanceof AiAssistanceModel.FileContext.FileContext) {
|
|
1497
1498
|
return Common.Revealer.reveal(context.getItem().uiLocation(0, 0));
|
|
1498
1499
|
}
|
|
1499
1500
|
if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
|
|
@@ -1733,11 +1734,11 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1733
1734
|
}
|
|
1734
1735
|
|
|
1735
1736
|
#handleConversationContextChange = (data: unknown): void => {
|
|
1736
|
-
if (data instanceof AiAssistanceModel.
|
|
1737
|
+
if (data instanceof AiAssistanceModel.FileContext.FileContext) {
|
|
1737
1738
|
this.#selectedFile = data;
|
|
1738
1739
|
} else if (data instanceof AiAssistanceModel.DOMNodeContext.DOMNodeContext) {
|
|
1739
1740
|
this.#selectedElement = data;
|
|
1740
|
-
} else if (data instanceof AiAssistanceModel.
|
|
1741
|
+
} else if (data instanceof AiAssistanceModel.RequestContext.RequestContext) {
|
|
1741
1742
|
this.#selectedRequest = data;
|
|
1742
1743
|
} else if (data instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
|
|
1743
1744
|
this.#selectedPerformanceTrace = data;
|
|
@@ -171,13 +171,13 @@ export type ViewOutput = undefined;
|
|
|
171
171
|
|
|
172
172
|
function getContextRemoveLabel(context: AiAssistanceModel.AiAgent.ConversationContext<unknown>):
|
|
173
173
|
Platform.UIString.LocalizedString {
|
|
174
|
-
if (context instanceof AiAssistanceModel.
|
|
174
|
+
if (context instanceof AiAssistanceModel.FileContext.FileContext) {
|
|
175
175
|
return lockedString(UIStringsNotTranslate.removeContextFile);
|
|
176
176
|
}
|
|
177
177
|
if (context instanceof AiAssistanceModel.DOMNodeContext.DOMNodeContext) {
|
|
178
178
|
return lockedString(UIStringsNotTranslate.removeContextElement);
|
|
179
179
|
}
|
|
180
|
-
if (context instanceof AiAssistanceModel.
|
|
180
|
+
if (context instanceof AiAssistanceModel.RequestContext.RequestContext) {
|
|
181
181
|
return lockedString(UIStringsNotTranslate.removeContextRequest);
|
|
182
182
|
}
|
|
183
183
|
if (context instanceof AiAssistanceModel.PerformanceAgent.PerformanceTraceContext) {
|
|
@@ -351,9 +351,9 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
351
351
|
})}
|
|
352
352
|
></devtools-widget>` :
|
|
353
353
|
html`
|
|
354
|
-
${input.context instanceof AiAssistanceModel.
|
|
354
|
+
${input.context instanceof AiAssistanceModel.RequestContext.RequestContext ?
|
|
355
355
|
PanelUtils.PanelUtils.getIconForNetworkRequest(input.context.getItem()) :
|
|
356
|
-
input.context instanceof AiAssistanceModel.
|
|
356
|
+
input.context instanceof AiAssistanceModel.FileContext.FileContext ?
|
|
357
357
|
PanelUtils.PanelUtils.getIconForSourceFile(input.context.getItem()) :
|
|
358
358
|
input.context instanceof AiAssistanceModel.AccessibilityAgent.AccessibilityContext ?
|
|
359
359
|
html`<devtools-icon class="icon" name="performance" title="Lighthouse"></devtools-icon>` :
|
|
@@ -52,6 +52,7 @@ import {BackForwardCacheTreeElement} from './BackForwardCacheTreeElement.js';
|
|
|
52
52
|
import {BackgroundServiceModel} from './BackgroundServiceModel.js';
|
|
53
53
|
import {BackgroundServiceView} from './BackgroundServiceView.js';
|
|
54
54
|
import {BounceTrackingMitigationsTreeElement} from './BounceTrackingMitigationsTreeElement.js';
|
|
55
|
+
import * as ApplicationComponents from './components/components.js';
|
|
55
56
|
import {DeviceBoundSessionsModel} from './DeviceBoundSessionsModel.js';
|
|
56
57
|
import {RootTreeElement as DeviceBoundSessionsRootTreeElement} from './DeviceBoundSessionsTreeElement.js';
|
|
57
58
|
import {
|
|
@@ -110,6 +111,10 @@ const UIStrings = {
|
|
|
110
111
|
* @description Text in Application Panel Sidebar of the Application panel
|
|
111
112
|
*/
|
|
112
113
|
application: 'Application',
|
|
114
|
+
/**
|
|
115
|
+
* @description Text in Application Panel Sidebar of the Application panel
|
|
116
|
+
*/
|
|
117
|
+
ads: 'Ads',
|
|
113
118
|
/**
|
|
114
119
|
* @description Text in Application Panel Sidebar of the Application panel
|
|
115
120
|
*/
|
|
@@ -354,6 +359,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
|
|
|
354
359
|
pushMessagingTreeElement: BackgroundServiceTreeElement;
|
|
355
360
|
reportingApiTreeElement: ReportingApiTreeElement;
|
|
356
361
|
webMcpTreeElement?: WebMCPTreeElement;
|
|
362
|
+
adsTreeElement?: ApplicationPanelTreeElement;
|
|
357
363
|
deviceBoundSessionsRootTreeElement: DeviceBoundSessionsRootTreeElement|undefined;
|
|
358
364
|
deviceBoundSessionsModel: DeviceBoundSessionsModel|undefined;
|
|
359
365
|
preloadingSummaryTreeElement: PreloadingSummaryTreeElement|undefined;
|
|
@@ -403,6 +409,25 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
|
|
|
403
409
|
this.applicationTreeElement.appendChild(this.webMcpTreeElement);
|
|
404
410
|
}
|
|
405
411
|
|
|
412
|
+
if (Root.Runtime.hostConfig.devToolsAdsPanel?.enabled) {
|
|
413
|
+
const adsTreeElement = new ApplicationPanelTreeElement(panel, i18nString(UIStrings.ads), false, 'ads');
|
|
414
|
+
const icon = createIcon('experiment');
|
|
415
|
+
adsTreeElement.setLeadingIcons([icon]);
|
|
416
|
+
adsTreeElement.itemURL = 'ads://' as Platform.DevToolsPath.UrlString;
|
|
417
|
+
let adsView: ApplicationComponents.AdsView.AdsView;
|
|
418
|
+
adsTreeElement.onselect = (selectedByUser?: boolean): boolean => {
|
|
419
|
+
ApplicationPanelTreeElement.prototype.onselect.call(adsTreeElement, selectedByUser);
|
|
420
|
+
if (!adsView) {
|
|
421
|
+
adsView = new ApplicationComponents.AdsView.AdsView();
|
|
422
|
+
}
|
|
423
|
+
adsTreeElement.showView(adsView);
|
|
424
|
+
UI.UIUserMetrics.UIUserMetrics.instance().panelShown('ads');
|
|
425
|
+
return false;
|
|
426
|
+
};
|
|
427
|
+
this.adsTreeElement = adsTreeElement;
|
|
428
|
+
this.applicationTreeElement.appendChild(this.adsTreeElement);
|
|
429
|
+
}
|
|
430
|
+
|
|
406
431
|
const storageSectionTitle = i18nString(UIStrings.storage);
|
|
407
432
|
const storageTreeElement = this.addSidebarSection(storageSectionTitle, 'storage');
|
|
408
433
|
this.localStorageListTreeElement = new ExpandableApplicationPanelTreeElement(
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type * as Platform from '../../core/platform/platform.js';
|
|
6
6
|
import {createIcon} from '../../ui/kit/kit.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
|
+
import {html, render} from '../../ui/lit/lit.js';
|
|
8
9
|
|
|
9
10
|
import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
|
|
10
11
|
import type {ResourcesPanel} from './ResourcesPanel.js';
|
|
@@ -17,6 +18,13 @@ export class WebMCPTreeElement extends ApplicationPanelTreeElement {
|
|
|
17
18
|
super(storagePanel, 'WebMCP', false, 'web-mcp');
|
|
18
19
|
const icon = createIcon('document');
|
|
19
20
|
this.setLeadingIcons([icon]);
|
|
21
|
+
const newBadge = UI.UIUtils.maybeCreateNewBadge('web-mcp');
|
|
22
|
+
if (newBadge) {
|
|
23
|
+
const fragment = document.createDocumentFragment();
|
|
24
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
25
|
+
render(html`<div class="trailing-icons icons-container">${newBadge}</div>`, fragment);
|
|
26
|
+
this.listItemElement.appendChild(fragment);
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
override get itemURL(): Platform.DevToolsPath.UrlString {
|
|
@@ -16,6 +16,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
16
16
|
import * as Platform from '../../core/platform/platform.js';
|
|
17
17
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
18
18
|
import * as Protocol from '../../generated/protocol.js';
|
|
19
|
+
import type * as Bindings from '../../models/bindings/bindings.js';
|
|
19
20
|
import type * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
20
21
|
import * as WebMCP from '../../models/web_mcp/web_mcp.js';
|
|
21
22
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
@@ -33,6 +34,8 @@ import {
|
|
|
33
34
|
type TemplateResult,
|
|
34
35
|
} from '../../ui/lit/lit.js';
|
|
35
36
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
37
|
+
import * as Console from '../console/console.js';
|
|
38
|
+
import symbolizedErrorWidgetStyles from '../console/symbolizedErrorWidget.css.js';
|
|
36
39
|
import * as ProtocolMonitor from '../protocol_monitor/protocol_monitor.js';
|
|
37
40
|
|
|
38
41
|
import webMCPViewStyles from './webMCPView.css.js';
|
|
@@ -191,10 +194,6 @@ const UIStrings = {
|
|
|
191
194
|
* @description Notice to display when a tool has been unregistered
|
|
192
195
|
*/
|
|
193
196
|
toolUnregisteredNotice: 'This tool has been unregistered',
|
|
194
|
-
/**
|
|
195
|
-
* @description Text preceding a nested error in a stack trace
|
|
196
|
-
*/
|
|
197
|
-
causedBy: 'Caused by:',
|
|
198
197
|
} as const;
|
|
199
198
|
const str_ = i18n.i18n.registerUIStrings('panels/application/WebMCPView.ts', UIStrings);
|
|
200
199
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -592,7 +591,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
592
591
|
${widget(PayloadWidget, {
|
|
593
592
|
valueObject: input.selectedCall?.result?.output,
|
|
594
593
|
errorText: input.selectedCall?.result?.errorText,
|
|
595
|
-
|
|
594
|
+
symbolizedError: input.selectedCall?.result?.symbolizedError,
|
|
596
595
|
})}>
|
|
597
596
|
</devtools-widget>
|
|
598
597
|
</devtools-tabbed-pane>
|
|
@@ -953,11 +952,11 @@ export interface PayloadViewInput {
|
|
|
953
952
|
valueObject?: unknown;
|
|
954
953
|
valueString?: string;
|
|
955
954
|
errorText?: string;
|
|
956
|
-
|
|
955
|
+
symbolizedError?: Bindings.SymbolizedError.SymbolizedError|null;
|
|
957
956
|
}
|
|
958
957
|
|
|
959
958
|
export const PAYLOAD_DEFAULT_VIEW = (input: PayloadViewInput, output: object, target: HTMLElement): void => {
|
|
960
|
-
if (!input.valueObject && !input.valueString && !input.errorText && !input.
|
|
959
|
+
if (!input.valueObject && !input.valueString && !input.errorText && !input.symbolizedError) {
|
|
961
960
|
render(nothing, target);
|
|
962
961
|
return;
|
|
963
962
|
}
|
|
@@ -988,73 +987,44 @@ export const PAYLOAD_DEFAULT_VIEW = (input: PayloadViewInput, output: object, ta
|
|
|
988
987
|
html`<div class="payload-value source-code error-text">${text}</div>`;
|
|
989
988
|
|
|
990
989
|
const createException = (
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
index: number,
|
|
997
|
-
array: StackTrace.ErrorStackParser.ParsedErrorFrame[],
|
|
998
|
-
): TemplateResult => {
|
|
999
|
-
const newline = index < array.length - 1 ? '\n' : '';
|
|
1000
|
-
const {line, link, isCallFrame} = frame;
|
|
1001
|
-
|
|
1002
|
-
if (!isCallFrame) {
|
|
1003
|
-
return html`<span>${line}${newline}</span>`;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
if (!link) {
|
|
1007
|
-
return html`<span class="formatted-builtin-stack-frame">${line}${newline}</span>`;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
const scriptLocationLink = linkifier.linkifyScriptLocation(
|
|
1011
|
-
details.error.runtimeModel().target(),
|
|
1012
|
-
link.scriptId || null,
|
|
1013
|
-
link.url,
|
|
1014
|
-
link.lineNumber,
|
|
1015
|
-
{
|
|
1016
|
-
columnNumber: link.columnNumber,
|
|
1017
|
-
showColumnNumber: true,
|
|
1018
|
-
},
|
|
1019
|
-
);
|
|
1020
|
-
scriptLocationLink.tabIndex = -1;
|
|
1021
|
-
|
|
1022
|
-
return html`<span class="formatted-stack-frame">${link.prefix}${scriptLocationLink}${link.suffix}${
|
|
1023
|
-
newline}</span>`;
|
|
1024
|
-
};
|
|
1025
|
-
|
|
990
|
+
error: Bindings.SymbolizedError.SymbolizedError|null,
|
|
991
|
+
): TemplateResult|typeof nothing => {
|
|
992
|
+
if (!error) {
|
|
993
|
+
return nothing;
|
|
994
|
+
}
|
|
1026
995
|
return html`
|
|
1027
996
|
<div class="payload-value source-code error-text">
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
997
|
+
<devtools-widget
|
|
998
|
+
${UI.Widget.widget(Console.SymbolizedErrorWidget.SymbolizedErrorWidget, {error})}
|
|
999
|
+
></devtools-widget>
|
|
1000
|
+
</div>
|
|
1001
|
+
`;
|
|
1033
1002
|
};
|
|
1034
1003
|
|
|
1035
|
-
render(
|
|
1036
|
-
html`
|
|
1004
|
+
render(html`
|
|
1037
1005
|
<style>${webMCPViewStyles}</style>
|
|
1006
|
+
<style>${symbolizedErrorWidgetStyles}</style>
|
|
1038
1007
|
<div class="call-payload-view">
|
|
1039
1008
|
<div class="call-payload-content">
|
|
1040
1009
|
${
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1010
|
+
isParsable ?
|
|
1011
|
+
createPayload(input.valueObject) :
|
|
1012
|
+
(input.valueString !== undefined ?
|
|
1013
|
+
createSourceText(input.valueString) :
|
|
1014
|
+
(input.symbolizedError ? createException(input.symbolizedError) :
|
|
1015
|
+
(input.errorText ? createErrorText(input.errorText) : nothing)))}
|
|
1046
1016
|
</div>
|
|
1047
1017
|
</div>
|
|
1048
1018
|
`,
|
|
1049
|
-
|
|
1019
|
+
target);
|
|
1050
1020
|
};
|
|
1051
1021
|
|
|
1052
1022
|
export class PayloadWidget extends UI.Widget.Widget {
|
|
1053
1023
|
#valueObject?: unknown;
|
|
1054
1024
|
#valueString?: string;
|
|
1055
1025
|
#errorText?: string;
|
|
1056
|
-
#
|
|
1057
|
-
#
|
|
1026
|
+
#symbolizedErrorPromise?: Promise<Bindings.SymbolizedError.SymbolizedError|null>;
|
|
1027
|
+
#symbolizedError?: Bindings.SymbolizedError.SymbolizedError|null;
|
|
1058
1028
|
#view: typeof PAYLOAD_DEFAULT_VIEW;
|
|
1059
1029
|
|
|
1060
1030
|
constructor(element?: HTMLElement, view = PAYLOAD_DEFAULT_VIEW) {
|
|
@@ -1089,27 +1059,27 @@ export class PayloadWidget extends UI.Widget.Widget {
|
|
|
1089
1059
|
return this.#errorText;
|
|
1090
1060
|
}
|
|
1091
1061
|
|
|
1092
|
-
async #
|
|
1093
|
-
|
|
1094
|
-
if (this.#
|
|
1062
|
+
async #updateSymbolizedError(symbolizedErrorPromise: Promise<Bindings.SymbolizedError.SymbolizedError|null>|
|
|
1063
|
+
undefined): Promise<void> {
|
|
1064
|
+
if (this.#symbolizedErrorPromise === symbolizedErrorPromise) {
|
|
1095
1065
|
return;
|
|
1096
1066
|
}
|
|
1097
|
-
this.#
|
|
1098
|
-
this.#
|
|
1067
|
+
this.#symbolizedErrorPromise = symbolizedErrorPromise;
|
|
1068
|
+
this.#symbolizedError = undefined;
|
|
1099
1069
|
this.requestUpdate();
|
|
1100
|
-
const
|
|
1101
|
-
if (this.#
|
|
1102
|
-
this.#
|
|
1070
|
+
const symbolizedError = await symbolizedErrorPromise;
|
|
1071
|
+
if (this.#symbolizedErrorPromise === symbolizedErrorPromise) {
|
|
1072
|
+
this.#symbolizedError = symbolizedError || null;
|
|
1103
1073
|
this.requestUpdate();
|
|
1104
1074
|
}
|
|
1105
1075
|
}
|
|
1106
1076
|
|
|
1107
|
-
set
|
|
1108
|
-
void this.#
|
|
1077
|
+
set symbolizedError(symbolizedErrorPromise: Promise<Bindings.SymbolizedError.SymbolizedError|null>|undefined) {
|
|
1078
|
+
void this.#updateSymbolizedError(symbolizedErrorPromise);
|
|
1109
1079
|
}
|
|
1110
1080
|
|
|
1111
|
-
get
|
|
1112
|
-
return this.#
|
|
1081
|
+
get symbolizedError(): Promise<Bindings.SymbolizedError.SymbolizedError|null>|undefined {
|
|
1082
|
+
return this.#symbolizedErrorPromise;
|
|
1113
1083
|
}
|
|
1114
1084
|
override wasShown(): void {
|
|
1115
1085
|
super.wasShown();
|
|
@@ -1121,7 +1091,7 @@ export class PayloadWidget extends UI.Widget.Widget {
|
|
|
1121
1091
|
valueObject: this.#valueObject,
|
|
1122
1092
|
valueString: this.#valueString,
|
|
1123
1093
|
errorText: this.#errorText,
|
|
1124
|
-
|
|
1094
|
+
symbolizedError: this.#symbolizedError,
|
|
1125
1095
|
};
|
|
1126
1096
|
this.#view(input, {}, this.contentElement);
|
|
1127
1097
|
}
|
|
@@ -7,6 +7,7 @@ import * as SDK from '../../../core/sdk/sdk.js';
|
|
|
7
7
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
8
8
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
9
9
|
import * as Lit from '../../../ui/lit/lit.js';
|
|
10
|
+
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
10
11
|
|
|
11
12
|
import adsViewStyles from './adsView.css.js';
|
|
12
13
|
|
|
@@ -89,34 +90,36 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
89
90
|
// clang-format off
|
|
90
91
|
Lit.render(html`
|
|
91
92
|
<style>${adsViewStyles}</style>
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
93
|
+
<div class="ads-view-container" jslog=${VisualLogging.pane('ads')}>
|
|
94
|
+
<dl class="metrics-container">
|
|
95
|
+
<div class="metric-box">
|
|
96
|
+
<dt class="metric-title">${i18nString(UIStrings.viewportAdDensity)}</dt>
|
|
97
|
+
<dd class="metric-value">
|
|
98
|
+
<span>${formatValue(metrics.viewportAdDensityByArea, true)}</span>
|
|
99
|
+
<span class="metric-average">${i18nString(UIStrings.average, {PH1: formatAverage(metrics.averageViewportAdDensityByArea, true)})}</span>
|
|
100
|
+
</dd>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="metric-box">
|
|
103
|
+
<dt class="metric-title">${i18nString(UIStrings.viewportAdCount)}</dt>
|
|
104
|
+
<dd class="metric-value">
|
|
105
|
+
<span>${formatValue(metrics.viewportAdCount, false)}</span>
|
|
106
|
+
<span class="metric-average">${i18nString(UIStrings.average, {PH1: formatAverage(metrics.averageViewportAdCount, false)})}</span>
|
|
107
|
+
</dd>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="metric-box">
|
|
110
|
+
<dt class="metric-title">${i18nString(UIStrings.totalCpuUsage)}</dt>
|
|
111
|
+
<dd class="metric-value">
|
|
112
|
+
<span>${formatCpu(metrics.totalAdCpuTime)}</span>
|
|
113
|
+
</dd>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="metric-box">
|
|
116
|
+
<dt class="metric-title">${i18nString(UIStrings.totalNetworkUsage)}</dt>
|
|
117
|
+
<dd class="metric-value">
|
|
118
|
+
<span>${formatNetwork(metrics.totalAdNetworkBytes)}</span>
|
|
119
|
+
</dd>
|
|
120
|
+
</div>
|
|
121
|
+
</dl>
|
|
122
|
+
</div>
|
|
120
123
|
`, target);
|
|
121
124
|
// clang-format on
|
|
122
125
|
};
|
|
@@ -12,6 +12,7 @@ import * as Host from '../../core/host/host.js';
|
|
|
12
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
13
13
|
import * as Platform from '../../core/platform/platform.js';
|
|
14
14
|
import * as _ProtocolClient from '../../core/protocol_client/protocol_client.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
15
|
+
import * as Root from '../../core/root/root.js';
|
|
15
16
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
16
17
|
import type * as Protocol from '../../generated/protocol.js';
|
|
17
18
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
@@ -1616,6 +1617,10 @@ export class ExtensionServer extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
1616
1617
|
targetType = Host.UserMetrics.ExtensionEvalTarget.SAME_EXTENSION;
|
|
1617
1618
|
} else {
|
|
1618
1619
|
targetType = Host.UserMetrics.ExtensionEvalTarget.OTHER_EXTENSION;
|
|
1620
|
+
if (!Root.Runtime.hostConfig.extensionsOnChromeUrls?.enabled) {
|
|
1621
|
+
return this.status.E_FAILED(
|
|
1622
|
+
'Access to extension URLs is restricted; use --extensions-on-chrome-urls to enable.');
|
|
1623
|
+
}
|
|
1619
1624
|
}
|
|
1620
1625
|
}
|
|
1621
1626
|
Host.userMetrics.extensionEvalTarget(targetType);
|
|
@@ -66,8 +66,10 @@ export class IsolateSelector extends UI.Widget.VBox implements UI.ListControl.Li
|
|
|
66
66
|
totalValueDiv: HTMLElement;
|
|
67
67
|
readonly totalTrendDiv: HTMLElement;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
// `devtools-widget` passes its host element into widget constructors.
|
|
70
|
+
// Accept and forward it so this widget attaches to that host element.
|
|
71
|
+
constructor(element?: HTMLElement) {
|
|
72
|
+
super(element);
|
|
71
73
|
|
|
72
74
|
this.items = new UI.ListModel.ListModel();
|
|
73
75
|
this.list = new UI.ListControl.ListControl(this.items, this, UI.ListControl.ListMode.NonViewport);
|