chrome-devtools-frontend 1.0.1674545 → 1.0.1676824
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-ux-writing-refactor/SKILL.md +26 -9
- package/WATCHLISTS +0 -4
- package/front_end/core/common/ParsedURL.ts +5 -1
- package/front_end/core/common/SettingRegistration.ts +29 -8
- package/front_end/core/common/Settings.ts +0 -77
- package/front_end/core/root/Runtime.ts +4 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +8 -28
- package/front_end/core/sdk/DebuggerModel.ts +50 -30
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/core/sdk/TargetManager.ts +18 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/main/MainImpl.ts +32 -0
- package/front_end/foundation/Universe.ts +44 -29
- package/front_end/generated/InspectorBackendCommands.ts +3 -1
- package/front_end/generated/SupportedCSSProperties.ts +21 -4
- package/front_end/generated/protocol-mapping.d.ts +14 -0
- package/front_end/generated/protocol-proxy-api.d.ts +10 -0
- package/front_end/generated/protocol.ts +35 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -0
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +15 -192
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +8 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +16 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +111 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/performance.md +8 -0
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +81 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +22 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +14 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/emulation/DeviceModeModel.ts +60 -71
- package/front_end/models/emulation/EmulatedDevices.ts +18 -66
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +2 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -31
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/models/workspace/FileManager.ts +13 -6
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -2
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/WebMCPView.ts +29 -12
- package/front_end/panels/application/components/AdsView.ts +24 -1
- package/front_end/panels/application/components/adsView.css +27 -21
- package/front_end/panels/autofill/AutofillView.ts +12 -12
- package/front_end/panels/autofill/autofill-meta.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +20 -19
- package/front_end/panels/elements/ElementsTreeElement.ts +550 -327
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/js_timeline/js_timeline-meta.ts +8 -8
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +30 -30
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +6 -6
- package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +11 -11
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +8 -8
- package/front_end/panels/layer_viewer/TransformController.ts +3 -3
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +11 -11
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -58
- package/front_end/panels/mobile_throttling/mobile_throttling.ts +0 -10
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +7 -0
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +9 -58
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -8
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +558 -0
- package/front_end/ui/comments/CommentManager.ts +640 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +121 -0
- package/front_end/ui/comments/comments.ts +13 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +40 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +270 -162
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +8 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -0
- package/front_end/ui/settings/SettingUIRegistration.ts +59 -6
- package/front_end/ui/visual_logging/Debugging.ts +1 -5
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/front_end/ui/visual_logging/LoggingConfig.ts +21 -0
- package/front_end/ui/visual_logging/visual_logging.ts +9 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +1 -1
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +0 -92
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
type BaseToolCapability,
|
|
11
|
+
type DataHandlerResult,
|
|
12
|
+
type DataTool,
|
|
13
|
+
MAX_FUNCTION_RESULT_BYTE_LENGTH,
|
|
14
|
+
type ToolArgs,
|
|
15
|
+
ToolName,
|
|
16
|
+
} from './Tool.js';
|
|
17
|
+
|
|
18
|
+
const UIStringsNotTranslate = {
|
|
19
|
+
networkActivitySummary: 'Network activity summary',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
const lockedString = i18n.i18n.lockedString;
|
|
23
|
+
|
|
24
|
+
export interface GetTraceNetworkSummaryArgs extends ToolArgs {
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class GetTraceNetworkSummaryTool implements DataTool<GetTraceNetworkSummaryArgs, string, BaseToolCapability> {
|
|
30
|
+
readonly name = ToolName.GET_TRACE_NETWORK_SUMMARY;
|
|
31
|
+
readonly description = 'Returns a summary of the network requests for the given bounds.';
|
|
32
|
+
|
|
33
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof GetTraceNetworkSummaryArgs> = {
|
|
34
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
35
|
+
description: 'Arguments for looking up a network track summary.',
|
|
36
|
+
nullable: false,
|
|
37
|
+
properties: {
|
|
38
|
+
min: {
|
|
39
|
+
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
40
|
+
description: 'The minimum time of the bounds, in microseconds.',
|
|
41
|
+
nullable: true,
|
|
42
|
+
},
|
|
43
|
+
max: {
|
|
44
|
+
type: Host.AidaClient.ParametersTypes.INTEGER,
|
|
45
|
+
description: 'The maximum time of the bounds, in microseconds.',
|
|
46
|
+
nullable: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: [],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
displayInfoFromArgs(params: GetTraceNetworkSummaryArgs): {
|
|
53
|
+
title: string,
|
|
54
|
+
action: string,
|
|
55
|
+
} {
|
|
56
|
+
const parts = [];
|
|
57
|
+
if (params.min !== undefined) {
|
|
58
|
+
parts.push(`min: ${params.min}`);
|
|
59
|
+
}
|
|
60
|
+
if (params.max !== undefined) {
|
|
61
|
+
parts.push(`max: ${params.max}`);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
title: lockedString(UIStringsNotTranslate.networkActivitySummary),
|
|
65
|
+
action: `getTraceNetworkSummary({${parts.join(', ')}})`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async handler(
|
|
70
|
+
params: GetTraceNetworkSummaryArgs,
|
|
71
|
+
capabilities: BaseToolCapability,
|
|
72
|
+
): Promise<DataHandlerResult<string>> {
|
|
73
|
+
const conversationContext = capabilities.conversationContext;
|
|
74
|
+
if (!conversationContext || !(conversationContext instanceof PerformanceTraceContext)) {
|
|
75
|
+
return {error: 'Performance trace context is not available.'};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const focus = conversationContext.getItem();
|
|
79
|
+
const bounds = conversationContext.createBounds(params.min, params.max);
|
|
80
|
+
if (!bounds) {
|
|
81
|
+
return {error: 'Invalid bounds.'};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const formatter = conversationContext.createFormatter();
|
|
85
|
+
const summary = formatter.formatNetworkTrackSummary(bounds);
|
|
86
|
+
if (summary.length > MAX_FUNCTION_RESULT_BYTE_LENGTH) {
|
|
87
|
+
return {
|
|
88
|
+
error:
|
|
89
|
+
'getTraceNetworkSummary response is too large. Try investigating using other functions, or a more narrow bounds',
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
result: summary,
|
|
95
|
+
widgets: [{
|
|
96
|
+
name: 'NETWORK_TRACK',
|
|
97
|
+
data: {
|
|
98
|
+
parsedTrace: focus.parsedTrace,
|
|
99
|
+
bounds,
|
|
100
|
+
},
|
|
101
|
+
}],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Common from '../../../core/common/common.js';
|
|
6
|
+
import * as Host from '../../../core/host/host.js';
|
|
7
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
|
9
|
+
import {areOriginsEquivalent, isOpaqueOrigin} from '../AiOrigins.js';
|
|
10
|
+
import {isSamePageOrigin} from '../contexts/StorageContext.js';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
type BaseToolCapability,
|
|
14
|
+
type DataHandlerResult,
|
|
15
|
+
type DataTool,
|
|
16
|
+
type OriginLockCapability,
|
|
17
|
+
ToolName,
|
|
18
|
+
} from './Tool.js';
|
|
19
|
+
|
|
20
|
+
const lockedString = i18n.i18n.lockedString;
|
|
21
|
+
|
|
22
|
+
export class ListPageOriginsTool implements
|
|
23
|
+
DataTool<Record<string, never>, {origins: string[]}, BaseToolCapability&OriginLockCapability> {
|
|
24
|
+
readonly name = ToolName.LIST_PAGE_ORIGINS;
|
|
25
|
+
readonly description =
|
|
26
|
+
'Lists all active, non-empty frame origins loaded by the page. Use this first when generic category context is active to discover all page origins, then pass them to listCookies or listStorageKeys, unless the user\'s explicit request hints at focusing only on the primary page.';
|
|
27
|
+
|
|
28
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<never> = {
|
|
29
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
30
|
+
description: '',
|
|
31
|
+
nullable: false,
|
|
32
|
+
properties: {},
|
|
33
|
+
required: [],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
displayInfoFromArgs(): {
|
|
37
|
+
title: string,
|
|
38
|
+
action: string,
|
|
39
|
+
} {
|
|
40
|
+
return {
|
|
41
|
+
title: lockedString('Listing page origins'),
|
|
42
|
+
action: 'listPageOrigins()',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async handler(
|
|
47
|
+
_args: Record<string, never>,
|
|
48
|
+
context: BaseToolCapability&OriginLockCapability,
|
|
49
|
+
): Promise<DataHandlerResult<{origins: string[]}>> {
|
|
50
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
51
|
+
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
52
|
+
const primaryPageTarget = targetManager.primaryPageTarget();
|
|
53
|
+
|
|
54
|
+
const allowedOrigin = context.getEstablishedOrigin();
|
|
55
|
+
if (!allowedOrigin || isOpaqueOrigin(allowedOrigin)) {
|
|
56
|
+
return {error: 'No origin available or not allowed.'};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const pageOrigin =
|
|
60
|
+
primaryPageTarget ? Common.ParsedURL.ParsedURL.extractOrigin(primaryPageTarget.inspectedURL()) : '';
|
|
61
|
+
const isAllowed = pageOrigin !== '' && areOriginsEquivalent(pageOrigin, allowedOrigin);
|
|
62
|
+
|
|
63
|
+
if (!isAllowed) {
|
|
64
|
+
return {error: 'No origin available or not allowed.'};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const origins = new Set<string>();
|
|
68
|
+
for (const frame of SDK.ResourceTreeModel.ResourceTreeModel.frames(targetManager)) {
|
|
69
|
+
if (!isSamePageOrigin(frame.resourceTreeModel().target().outermostTarget(), allowedOrigin)) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const origin = frame.securityOrigin;
|
|
73
|
+
if (!origin || isOpaqueOrigin(origin) || origins.has(origin)) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
origins.add(origin);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {result: {origins: Array.from(origins)}};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Common from '../../../core/common/common.js';
|
|
6
|
+
import * as Host from '../../../core/host/host.js';
|
|
7
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
|
+
import * as Workspace from '../../workspace/workspace.js';
|
|
9
|
+
import {isOpaqueOrigin} from '../AiOrigins.js';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
type BaseToolCapability,
|
|
13
|
+
type DataHandlerResult,
|
|
14
|
+
type DataTool,
|
|
15
|
+
type OriginLockCapability,
|
|
16
|
+
ToolName,
|
|
17
|
+
} from './Tool.js';
|
|
18
|
+
|
|
19
|
+
const UIStringsNotTranslate = {
|
|
20
|
+
listingSources: 'Listing workspace sources',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
const lockedString = i18n.i18n.lockedString;
|
|
24
|
+
|
|
25
|
+
interface SourceSummary {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A tool that lists all network source files in the workspace.
|
|
32
|
+
* Each file is returned with its displayName and a unique session-based numeric ID.
|
|
33
|
+
*/
|
|
34
|
+
export class ListSourcesTool implements
|
|
35
|
+
DataTool<Record<string, never>, {files: SourceSummary[]}, BaseToolCapability&OriginLockCapability> {
|
|
36
|
+
readonly name = ToolName.LIST_SOURCES;
|
|
37
|
+
readonly description = 'Lists all source files in the workspace with their name and a unique ID.';
|
|
38
|
+
|
|
39
|
+
static lastSourceId = 0;
|
|
40
|
+
static uiSourceCodeId = new WeakMap<Workspace.UISourceCode.UISourceCode, number>();
|
|
41
|
+
|
|
42
|
+
static reset(): void {
|
|
43
|
+
ListSourcesTool.lastSourceId = 0;
|
|
44
|
+
ListSourcesTool.uiSourceCodeId = new WeakMap();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line @devtools/no-instance-of-migrated-singletons
|
|
48
|
+
static getUISourceCodes(workspace: Workspace.Workspace.WorkspaceImpl = Workspace.Workspace.WorkspaceImpl.instance()):
|
|
49
|
+
Workspace.UISourceCode.UISourceCode[] {
|
|
50
|
+
const projects =
|
|
51
|
+
workspace.projects().filter(project => project.type() === Workspace.Workspace.projectTypes.Network);
|
|
52
|
+
const uiSourceCodes = new Map<string, Workspace.UISourceCode.UISourceCode>();
|
|
53
|
+
|
|
54
|
+
for (const project of projects) {
|
|
55
|
+
for (const uiSourceCode of project.uiSourceCodes()) {
|
|
56
|
+
if (uiSourceCode.isIgnoreListed()) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const url = uiSourceCode.url();
|
|
60
|
+
if (!uiSourceCodes.get(url) || uiSourceCode.contentType().isFromSourceMap()) {
|
|
61
|
+
uiSourceCodes.set(url, uiSourceCode);
|
|
62
|
+
if (!ListSourcesTool.uiSourceCodeId.has(uiSourceCode)) {
|
|
63
|
+
ListSourcesTool.uiSourceCodeId.set(uiSourceCode, ++ListSourcesTool.lastSourceId);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return [...uiSourceCodes.values()];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<never> = {
|
|
73
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
74
|
+
description: '',
|
|
75
|
+
nullable: true,
|
|
76
|
+
required: [],
|
|
77
|
+
properties: {},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
displayInfoFromArgs(): {
|
|
81
|
+
title: string,
|
|
82
|
+
action: string,
|
|
83
|
+
} {
|
|
84
|
+
return {
|
|
85
|
+
title: lockedString(UIStringsNotTranslate.listingSources),
|
|
86
|
+
action: 'listSources()',
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async handler(
|
|
91
|
+
_params: Record<string, never>,
|
|
92
|
+
context: BaseToolCapability&OriginLockCapability,
|
|
93
|
+
): Promise<DataHandlerResult<{files: SourceSummary[]}>> {
|
|
94
|
+
const origin = context.getEstablishedOrigin();
|
|
95
|
+
if (origin && isOpaqueOrigin(origin)) {
|
|
96
|
+
return {
|
|
97
|
+
error: 'Opaque origin not allowed',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const files = ListSourcesTool.getUISourceCodes().filter(file => {
|
|
102
|
+
const fileUrl = file.url();
|
|
103
|
+
const fileOrigin = Common.ParsedURL.ParsedURL.extractOrigin(fileUrl);
|
|
104
|
+
return !origin || fileOrigin === origin;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
result: {
|
|
109
|
+
files: files.map(file => ({
|
|
110
|
+
id: ListSourcesTool.uiSourceCodeId.get(file) ?? 0,
|
|
111
|
+
name: file.fullDisplayName(),
|
|
112
|
+
})),
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Common from '../../../core/common/common.js';
|
|
6
|
+
import * as Host from '../../../core/host/host.js';
|
|
7
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
|
+
import * as SDK from '../../../core/sdk/sdk.js';
|
|
9
|
+
import {PerformanceTraceContext} from '../contexts/PerformanceTraceContext.js';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
type BaseToolCapability,
|
|
13
|
+
type DataHandlerResult,
|
|
14
|
+
type DataTool,
|
|
15
|
+
type ToolArgs,
|
|
16
|
+
ToolName,
|
|
17
|
+
} from './Tool.js';
|
|
18
|
+
|
|
19
|
+
const UIStringsNotTranslate = {
|
|
20
|
+
selectingTraceEvent: 'Selecting trace event',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
const lockedString = i18n.i18n.lockedString;
|
|
24
|
+
|
|
25
|
+
export interface SelectTraceEventByKeyArgs extends ToolArgs {
|
|
26
|
+
eventKey: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class SelectTraceEventByKeyTool implements DataTool<SelectTraceEventByKeyArgs, string, BaseToolCapability> {
|
|
30
|
+
readonly name = ToolName.SELECT_TRACE_EVENT_BY_KEY;
|
|
31
|
+
readonly description = 'Selects and reveals a specific event by its key in the Performance panel Flamechart.';
|
|
32
|
+
|
|
33
|
+
readonly parameters: Host.AidaClient.FunctionObjectParam<keyof SelectTraceEventByKeyArgs> = {
|
|
34
|
+
type: Host.AidaClient.ParametersTypes.OBJECT,
|
|
35
|
+
description: 'Arguments for selecting a trace event.',
|
|
36
|
+
nullable: false,
|
|
37
|
+
properties: {
|
|
38
|
+
eventKey: {
|
|
39
|
+
type: Host.AidaClient.ParametersTypes.STRING,
|
|
40
|
+
description: 'The key of the event to select.',
|
|
41
|
+
nullable: false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ['eventKey'],
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
displayInfoFromArgs(params: SelectTraceEventByKeyArgs): {
|
|
48
|
+
title: string,
|
|
49
|
+
action: string,
|
|
50
|
+
} {
|
|
51
|
+
return {
|
|
52
|
+
title: lockedString(UIStringsNotTranslate.selectingTraceEvent),
|
|
53
|
+
action: `selectTraceEventByKey('${params.eventKey}')`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async handler(
|
|
58
|
+
params: SelectTraceEventByKeyArgs,
|
|
59
|
+
capabilities: BaseToolCapability,
|
|
60
|
+
): Promise<DataHandlerResult<string>> {
|
|
61
|
+
const conversationContext = capabilities.conversationContext;
|
|
62
|
+
if (!conversationContext || !(conversationContext instanceof PerformanceTraceContext)) {
|
|
63
|
+
return {error: 'Performance trace context is not available.'};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const focus = conversationContext.getItem();
|
|
67
|
+
const event = focus.lookupEvent(params.eventKey);
|
|
68
|
+
if (!event) {
|
|
69
|
+
return {error: `Could not find event with key "${params.eventKey}".`};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const revealable = new SDK.TraceObject.RevealableEvent(event);
|
|
73
|
+
try {
|
|
74
|
+
await Common.Revealer.reveal(revealable);
|
|
75
|
+
} catch {
|
|
76
|
+
// A failed reveal should not block returning the selected event context.
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
result: 'Event selected',
|
|
81
|
+
widgets: [{
|
|
82
|
+
name: 'TIMELINE_EVENT_SUMMARY',
|
|
83
|
+
data: {
|
|
84
|
+
event,
|
|
85
|
+
parsedTrace: focus.parsedTrace,
|
|
86
|
+
},
|
|
87
|
+
}],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -140,13 +140,18 @@ export interface PerformanceRecordingCapability {
|
|
|
140
140
|
* Used by the agent to pass a complete context to any tool type-safely.
|
|
141
141
|
*/
|
|
142
142
|
export type AllToolsCapabilities = BaseToolCapability&PageExecutionCapability&StyleMutationCapability&TargetCapability&
|
|
143
|
-
OriginLockCapability&LighthouseCapability&PerformanceRecordingCapability;
|
|
143
|
+
OriginLockCapability&LighthouseCapability&PerformanceRecordingCapability&ServerLoggingCapability;
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Base argument type for AI Tools.
|
|
147
147
|
*/
|
|
148
148
|
export type ToolArgs = Record<string, unknown>;
|
|
149
149
|
|
|
150
|
+
// The maximum size (in bytes) of a function execution result.
|
|
151
|
+
// Approximately 16k tokens at ~4 characters per token, designed to limit
|
|
152
|
+
// result sizes to prevent overloading the LLM's context window.
|
|
153
|
+
export const MAX_FUNCTION_RESULT_BYTE_LENGTH = 16384 * 4;
|
|
154
|
+
|
|
150
155
|
export const enum ToolName {
|
|
151
156
|
EXECUTE_JAVASCRIPT = 'executeJavaScript',
|
|
152
157
|
GET_STYLES = 'getStyles',
|
|
@@ -156,6 +161,13 @@ export const enum ToolName {
|
|
|
156
161
|
RESOLVE_DEVTOOLS_NODE_PATH = 'resolveDevtoolsNodePath',
|
|
157
162
|
GET_ELEMENT_ACCESSIBILITY_DETAILS = 'getElementAccessibilityDetails',
|
|
158
163
|
RECORD_PERFORMANCE_TRACE = 'recordPerformanceTrace',
|
|
164
|
+
LIST_PAGE_ORIGINS = 'listPageOrigins',
|
|
165
|
+
GET_TRACE_EVENT_BY_KEY = 'getTraceEventByKey',
|
|
166
|
+
SELECT_TRACE_EVENT_BY_KEY = 'selectTraceEventByKey',
|
|
167
|
+
LIST_SOURCES = 'listSources',
|
|
168
|
+
GET_SOURCE_CONTENT = 'getSourceContent',
|
|
169
|
+
GET_TRACE_MAIN_THREAD_SUMMARY = 'getTraceMainThreadSummary',
|
|
170
|
+
GET_TRACE_NETWORK_SUMMARY = 'getTraceNetworkSummary',
|
|
159
171
|
}
|
|
160
172
|
|
|
161
173
|
/**
|
|
@@ -180,6 +192,7 @@ export interface BaseTool<ArgsType extends ToolArgs = ToolArgs> {
|
|
|
180
192
|
) => {
|
|
181
193
|
title?: string, thought?: string, action?: string, suggestions?: [string, ...string[]],
|
|
182
194
|
};
|
|
195
|
+
readonly annotations?: ToolAnnotation[];
|
|
183
196
|
}
|
|
184
197
|
|
|
185
198
|
/**
|
|
@@ -242,3 +255,11 @@ export type Tool<
|
|
|
242
255
|
ReturnType = unknown,
|
|
243
256
|
CapabilitiesType extends BaseToolCapability = BaseToolCapability,
|
|
244
257
|
> = DataTool<ArgsType, ReturnType, CapabilitiesType>|ContextTool<ArgsType, ReturnType, CapabilitiesType>;
|
|
258
|
+
|
|
259
|
+
export interface ServerLoggingCapability {
|
|
260
|
+
setLoggingEnabled(enabled: boolean): void;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export const enum ToolAnnotation {
|
|
264
|
+
REDACT_FROM_HISTORY = 'redact-from-history',
|
|
265
|
+
}
|
|
@@ -6,10 +6,17 @@ import {ExecuteJavaScriptTool} from './ExecuteJavaScript.js';
|
|
|
6
6
|
import {GetElementAccessibilityDetailsTool} from './GetElementAccessibilityDetails.js';
|
|
7
7
|
import {GetLighthouseAuditsTool} from './GetLighthouseAudits.js';
|
|
8
8
|
import {GetNetworkRequestDetailsTool} from './GetNetworkRequestDetails.js';
|
|
9
|
+
import {GetSourceContentTool} from './GetSourceContent.js';
|
|
9
10
|
import {GetStylesTool} from './GetStyles.js';
|
|
11
|
+
import {GetTraceEventByKeyTool} from './GetTraceEventByKey.js';
|
|
12
|
+
import {GetTraceMainThreadSummaryTool} from './GetTraceMainThreadSummary.js';
|
|
13
|
+
import {GetTraceNetworkSummaryTool} from './GetTraceNetworkSummary.js';
|
|
10
14
|
import {ListNetworkRequestsTool} from './ListNetworkRequests.js';
|
|
15
|
+
import {ListPageOriginsTool} from './ListPageOrigins.js';
|
|
16
|
+
import {ListSourcesTool} from './ListSources.js';
|
|
11
17
|
import {RecordPerformanceTraceTool} from './RecordPerformanceTrace.js';
|
|
12
18
|
import {ResolveDevtoolsNodePathTool} from './ResolveDevtoolsNodePath.js';
|
|
19
|
+
import {SelectTraceEventByKeyTool} from './SelectTraceEventByKey.js';
|
|
13
20
|
import {type AllToolsCapabilities, type Tool, type ToolArgs, ToolName} from './Tool.js';
|
|
14
21
|
|
|
15
22
|
/**
|
|
@@ -29,6 +36,13 @@ export const TOOLS = {
|
|
|
29
36
|
[ToolName.RESOLVE_DEVTOOLS_NODE_PATH]: new ResolveDevtoolsNodePathTool(),
|
|
30
37
|
[ToolName.GET_ELEMENT_ACCESSIBILITY_DETAILS]: new GetElementAccessibilityDetailsTool(),
|
|
31
38
|
[ToolName.RECORD_PERFORMANCE_TRACE]: new RecordPerformanceTraceTool(),
|
|
39
|
+
[ToolName.LIST_PAGE_ORIGINS]: new ListPageOriginsTool(),
|
|
40
|
+
[ToolName.GET_TRACE_EVENT_BY_KEY]: new GetTraceEventByKeyTool(),
|
|
41
|
+
[ToolName.SELECT_TRACE_EVENT_BY_KEY]: new SelectTraceEventByKeyTool(),
|
|
42
|
+
[ToolName.LIST_SOURCES]: new ListSourcesTool(),
|
|
43
|
+
[ToolName.GET_SOURCE_CONTENT]: new GetSourceContentTool(),
|
|
44
|
+
[ToolName.GET_TRACE_MAIN_THREAD_SUMMARY]: new GetTraceMainThreadSummaryTool(),
|
|
45
|
+
[ToolName.GET_TRACE_NETWORK_SUMMARY]: new GetTraceNetworkSummaryTool(),
|
|
32
46
|
};
|
|
33
47
|
|
|
34
48
|
/**
|
|
@@ -143,6 +143,10 @@ export class CSSWorkspaceBinding implements SDK.TargetManager.SDKModelObserver<S
|
|
|
143
143
|
}
|
|
144
144
|
return rawLocations;
|
|
145
145
|
}
|
|
146
|
+
|
|
147
|
+
sourceMapURLsForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): Platform.DevToolsPath.UrlString[] {
|
|
148
|
+
return SASSSourceMapping.sourceMapURLsForUISourceCode(uiSourceCode);
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
export interface SourceMapping {
|
|
@@ -577,6 +577,10 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
577
577
|
return scripts;
|
|
578
578
|
}
|
|
579
579
|
|
|
580
|
+
sourceMapURLsForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): Platform.DevToolsPath.UrlString[] {
|
|
581
|
+
return [...this.#uiSourceCodeToSourceMaps.get(uiSourceCode)].map(sourceMap => sourceMap.url());
|
|
582
|
+
}
|
|
583
|
+
|
|
580
584
|
private sourceMapAttachedForTest(_sourceMap: SDK.SourceMap.SourceMap): void {
|
|
581
585
|
}
|
|
582
586
|
|
|
@@ -463,6 +463,14 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
463
463
|
return [...scripts];
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
sourceMapURLsForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): Platform.DevToolsPath.UrlString[] {
|
|
467
|
+
const urls = new Set<Platform.DevToolsPath.UrlString>();
|
|
468
|
+
for (const modelData of this.#debuggerModelToData.values()) {
|
|
469
|
+
modelData.compilerMapping.sourceMapURLsForUISourceCode(uiSourceCode).forEach(url => urls.add(url));
|
|
470
|
+
}
|
|
471
|
+
return [...urls];
|
|
472
|
+
}
|
|
473
|
+
|
|
466
474
|
supportsConditionalBreakpoints(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
|
|
467
475
|
const scripts = this.pluginManager.scriptsForUISourceCode(uiSourceCode);
|
|
468
476
|
return scripts.every(script => script.isJavaScript());
|