chrome-devtools-frontend 1.0.1664496 → 1.0.1665921
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-testing-guidance/SKILL.md +48 -0
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +3 -3
- package/.agents/skills/repro-flaky-tests/SKILL.md +2 -2
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +2 -0
- package/.agents/skills/version-control/SKILL.md +4 -3
- package/docs/ui_engineering.md +89 -0
- package/eslint.config.mjs +9 -2
- package/front_end/Images/rollup.config.mjs +1 -1
- package/front_end/Tests.js +15 -16
- package/front_end/core/common/Gzip.ts +2 -2
- package/front_end/core/common/Settings.ts +4 -20
- package/front_end/core/common/Srcset.ts +1 -1
- package/front_end/core/common/VersionController.ts +1 -1
- package/front_end/core/host/AidaClient.ts +19 -4
- package/front_end/core/host/AidaGcaTranslation.ts +2 -2
- package/front_end/core/host/GcaClient.ts +2 -2
- package/front_end/core/host/GdpClient.ts +3 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/ResourceLoader.ts +15 -15
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +78 -3
- package/front_end/core/sdk/CSSMetadata.ts +17 -12
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +3 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
- package/front_end/core/sdk/Connections.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +13 -13
- package/front_end/core/sdk/NetworkManager.ts +19 -19
- package/front_end/core/sdk/NetworkRequest.ts +57 -57
- package/front_end/core/sdk/OverlayModel.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +5 -5
- package/front_end/core/sdk/ScreenCaptureModel.ts +1 -1
- package/front_end/core/sdk/Script.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +7 -7
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +1 -1
- package/front_end/core/sdk/ServiceWorkerManager.ts +11 -11
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
- package/front_end/core/sdk/StorageKeyManager.ts +1 -1
- package/front_end/core/sdk/sdk-meta.ts +98 -98
- package/front_end/devtools_compatibility.js +15 -13
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -8
- package/front_end/entrypoints/main/MainImpl.ts +2 -3
- package/front_end/entrypoints/main/main-meta.ts +1 -16
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/foundation/README.md +1 -1
- package/front_end/foundation/Universe.test.api.ts +73 -0
- package/front_end/foundation/Universe.ts +22 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/SupportedCSSProperties.js +1 -1
- package/front_end/generated/protocol.ts +19 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +0 -70
- package/front_end/models/ai_assistance/ExtensionScope.ts +2 -36
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +9 -9
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +21 -21
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -5
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +11 -4
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +8 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +14 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +2 -2
- package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -2
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +9 -2
- package/front_end/models/ai_assistance/tools/GetStyles.ts +4 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -2
- package/front_end/models/badges/badges-meta.ts +27 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -3
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +6 -7
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -4
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +72 -29
- package/front_end/models/bindings/ResourceMapping.ts +38 -32
- package/front_end/models/bindings/ResourceScriptMapping.ts +5 -7
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -1
- package/front_end/models/har/Writer.ts +2 -2
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +14 -5
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +1 -1
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +13 -2
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +22 -5
- package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +1 -1
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +10 -4
- package/front_end/models/logs/logs-meta.ts +23 -16
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +1 -1
- package/front_end/models/source_map_scopes/NamesResolver.ts +104 -86
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +6 -2
- package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -1
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +17 -6
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -1
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +1 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +14 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -15
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -2
- package/front_end/panels/ai_assistance/components/ChatInput.ts +23 -19
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -18
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -35
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/ImageResize.ts +74 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +28 -29
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +0 -2
- package/front_end/panels/application/AppManifestView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/CrashReportContextView.ts +3 -3
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -1
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +6 -6
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/WebMCPView.ts +7 -5
- package/front_end/panels/application/components/AdsView.ts +21 -6
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +3 -3
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -1
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +2 -2
- package/front_end/panels/changes/ChangesSidebar.ts +2 -2
- package/front_end/panels/changes/ChangesView.ts +4 -5
- package/front_end/panels/changes/CombinedDiffView.ts +3 -3
- package/front_end/panels/changes/changes-meta.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -3
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/DOMLinkifier.ts +1 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +2 -2
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/aiCodeCompletionDisclaimer.css +0 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +3 -3
- package/front_end/panels/console/ConsolePrompt.ts +6 -4
- package/front_end/panels/console/ConsoleSidebar.ts +8 -10
- package/front_end/panels/console_counters/WarningErrorCounter.ts +10 -11
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +3 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -3
- package/front_end/panels/elements/EventListenersWidget.ts +1 -3
- package/front_end/panels/elements/LayoutPane.ts +23 -13
- package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -7
- package/front_end/panels/elements/StylePropertiesSection.ts +33 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -5
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
- package/front_end/panels/elements/elements-meta.ts +18 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +100 -40
- package/front_end/panels/emulation/DeviceModeView.ts +5 -4
- package/front_end/panels/emulation/MediaQueryInspector.ts +35 -19
- package/front_end/panels/event_listeners/EventListenersView.ts +4 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -9
- package/front_end/panels/explain/explain-meta.ts +3 -3
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +135 -167
- package/front_end/panels/layer_viewer/Layers3DView.ts +10 -23
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +27 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +44 -55
- package/front_end/panels/lighthouse/LighthousePanel.ts +9 -9
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +9 -12
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +33 -33
- package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
- package/front_end/panels/lighthouse/lighthouse-meta.ts +131 -1
- package/front_end/panels/media/EventDisplayTable.ts +67 -94
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/eventDisplayTable.css +9 -4
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +5 -5
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/EventSourceMessagesView.ts +98 -107
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -4
- package/front_end/panels/network/RequestTimingView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
- package/front_end/panels/network/eventSourceMessagesView.css +12 -3
- package/front_end/panels/network/networkTimingTable.css +2 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/BottomUpProfileDataGrid.ts +25 -29
- package/front_end/panels/profiler/HeapProfileView.ts +308 -247
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +13 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +30 -10
- package/front_end/panels/profiler/HeapTimelineOverview.ts +5 -2
- package/front_end/panels/profiler/ProfileDataGrid.ts +128 -157
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +17 -5
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/profiler/TopDownProfileDataGrid.ts +17 -21
- package/front_end/panels/profiler/profilesPanel.css +9 -13
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/recorder/CreateRecordingView.ts +4 -4
- package/front_end/panels/recorder/RecorderPanel.ts +6 -6
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/ReplaySection.ts +1 -1
- package/front_end/panels/recorder/StepView.ts +1 -1
- package/front_end/panels/recorder/injected/rollup.config.mjs +1 -1
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +54 -41
- package/front_end/panels/sensors/LocationsSettingsTab.ts +246 -233
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +11 -10
- package/front_end/panels/settings/SettingsScreen.ts +29 -24
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +5 -5
- package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +25 -22
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -5
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/CountersGraph.ts +1 -2
- package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +53 -81
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +10 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +18 -4
- package/front_end/panels/timeline/TrackConfigBanner.ts +1 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +8 -9
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +1 -1
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +1 -1
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +1 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -0
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +13 -8
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +1 -0
- package/front_end/panels/timeline/timeline-meta.ts +169 -0
- package/front_end/panels/timeline/timelineFlameChartView.css +5 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
- package/front_end/panels/whats_new/resources/WNDT.md +7 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +120 -19
- package/front_end/third_party/web-vitals/package/attribution.d.ts +16 -0
- package/front_end/third_party/web-vitals/package/attribution.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +1 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +53 -32
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +43 -12
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +21 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +30 -24
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +2 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +18 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +7 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +4 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +7 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +20 -11
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js +8 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.d.ts +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +19 -4
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +38 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +5 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +30 -11
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +36 -4
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +42 -22
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +109 -30
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +25 -7
- package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +24 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/fcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +14 -6
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/ttfb.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +26 -4
- package/front_end/third_party/web-vitals/package/package.json +21 -22
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +62 -39
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +52 -15
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +25 -7
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +43 -37
- package/front_end/third_party/web-vitals/package/src/lib/{polyfills/getFirstHiddenTimePolyfill.ts → FCPEntryManager.ts} +4 -14
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +22 -2
- package/front_end/third_party/web-vitals/package/src/lib/LCPEntryManager.ts +1 -0
- package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +11 -12
- package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +24 -11
- package/front_end/third_party/web-vitals/package/src/lib/initUnique.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +26 -5
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +48 -0
- package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +75 -18
- package/front_end/third_party/web-vitals/package/src/onFCP.ts +66 -7
- package/front_end/third_party/web-vitals/package/src/onINP.ts +100 -39
- package/front_end/third_party/web-vitals/package/src/onLCP.ts +169 -34
- package/front_end/third_party/web-vitals/package/src/onTTFB.ts +50 -13
- package/front_end/third_party/web-vitals/package/src/types/base.ts +31 -10
- package/front_end/third_party/web-vitals/package/src/types/fcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +14 -6
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/ttfb.ts +2 -2
- package/front_end/third_party/web-vitals/package/src/types.ts +32 -9
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +11 -11
- package/front_end/third_party/web-vitals/rebuild.sh +2 -2
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +2 -0
- package/front_end/ui/components/buttons/Button.ts +16 -0
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +6 -1
- package/front_end/ui/components/highlighting/highlighting.ts +1 -1
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +12 -7
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +6 -6
- package/front_end/ui/components/text_editor/javascript.ts +3 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +12 -2
- package/front_end/ui/legacy/ListControl.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +17 -19
- package/front_end/ui/legacy/Toolbar.ts +4 -1
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/spectrum.css +1 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -4
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +14 -11
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +1 -1
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +15 -5
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -4
- package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -1
- package/front_end/ui/lit/render.ts +1 -1
- package/front_end/ui/settings/SettingUIRegistration.ts +8 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/inspector_overlay/main.ts +1 -1
- package/mcp/mcp.ts +5 -4
- package/package.json +13 -13
- package/front_end/models/ai_assistance/AgentProject.ts +0 -261
- package/front_end/models/ai_assistance/agents/PatchAgent.ts +0 -306
- package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +0 -45
- package/front_end/models/text_utils/text_utils.ts +0 -5
- package/front_end/panels/ai_assistance/PatchWidget.ts +0 -867
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +0 -368
- package/front_end/panels/ai_assistance/selectWorkspaceDialog.css +0 -92
|
@@ -44,7 +44,6 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
44
44
|
import * as Foundation from '../../foundation/foundation.js';
|
|
45
45
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
|
46
46
|
import * as Badges from '../../models/badges/badges.js';
|
|
47
|
-
import * as Bindings from '../../models/bindings/bindings.js';
|
|
48
47
|
import * as CrUXManager from '../../models/crux-manager/crux-manager.js';
|
|
49
48
|
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
50
49
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
@@ -123,7 +122,7 @@ const UIStrings = {
|
|
|
123
122
|
/**
|
|
124
123
|
* @description Title of the menu item in the customize and control menu leading to the DevTools MCP repository.
|
|
125
124
|
*/
|
|
126
|
-
getDevToolsMcp: 'Get `DevTools MCP`'
|
|
125
|
+
getDevToolsMcp: 'Get `DevTools MCP`',
|
|
127
126
|
} as const;
|
|
128
127
|
const str_ = i18n.i18n.registerUIStrings('entrypoints/main/MainImpl.ts', UIStrings);
|
|
129
128
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -460,7 +459,6 @@ export class MainImpl {
|
|
|
460
459
|
targetManager.addEventListener(
|
|
461
460
|
SDK.TargetManager.Events.SUSPEND_STATE_CHANGED, this.#onSuspendStateChanged.bind(this));
|
|
462
461
|
|
|
463
|
-
new Bindings.PresentationConsoleMessageHelper.PresentationConsoleMessageManager(targetManager);
|
|
464
462
|
targetManager.setScopeTarget(targetManager.primaryPageTarget());
|
|
465
463
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.Target.Target, ({data}) => {
|
|
466
464
|
const outermostTarget = data?.outermostTarget();
|
|
@@ -479,6 +477,7 @@ export class MainImpl {
|
|
|
479
477
|
|
|
480
478
|
this.#universe.domDebuggerManager.initialize();
|
|
481
479
|
this.#universe.cpuThrottlingManager.initialize();
|
|
480
|
+
this.#universe.presentationConsoleMessageManager.enable();
|
|
482
481
|
void this.#universe.liveMetrics.enable();
|
|
483
482
|
CrUXManager.CrUXManager.instance();
|
|
484
483
|
|
|
@@ -192,11 +192,6 @@ const UIStrings = {
|
|
|
192
192
|
* of saving settings to their Google account.
|
|
193
193
|
*/
|
|
194
194
|
saveSettings: 'Save `DevTools` settings to your `Google` account',
|
|
195
|
-
/**
|
|
196
|
-
* @description Label for a checkbox in the settings UI. Allows developers to opt-in/opt-out
|
|
197
|
-
* of receiving Google Developer Program (GDP) badges based on their activity in Chrome DevTools.
|
|
198
|
-
*/
|
|
199
|
-
earnBadges: 'Earn badges',
|
|
200
195
|
/**
|
|
201
196
|
* @description A command available in the command menu to perform searches, for example in the
|
|
202
197
|
* elements panel, as user types, rather than only when they press Enter.
|
|
@@ -296,7 +291,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
|
296
291
|
shortcut: 'Shift+Esc',
|
|
297
292
|
},
|
|
298
293
|
],
|
|
299
|
-
condition: config => Boolean(config?.devToolsFlexibleLayout?.verticalDrawerEnabled)
|
|
294
|
+
condition: config => Boolean(config?.devToolsFlexibleLayout?.verticalDrawerEnabled),
|
|
300
295
|
});
|
|
301
296
|
|
|
302
297
|
UI.ActionRegistration.registerActionExtension({
|
|
@@ -795,16 +790,6 @@ Common.Settings.registerSettingExtension({
|
|
|
795
790
|
reloadRequired: true,
|
|
796
791
|
});
|
|
797
792
|
|
|
798
|
-
Common.Settings.registerSettingExtension({
|
|
799
|
-
category: Common.Settings.SettingCategory.ACCOUNT,
|
|
800
|
-
settingName: 'receive-gdp-badges',
|
|
801
|
-
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
802
|
-
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
803
|
-
title: i18nLazyString(UIStrings.earnBadges),
|
|
804
|
-
defaultValue: false,
|
|
805
|
-
reloadRequired: true,
|
|
806
|
-
});
|
|
807
|
-
|
|
808
793
|
Common.Settings.registerSettingExtension({
|
|
809
794
|
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
810
795
|
settingName: 'user-shortcuts',
|
|
@@ -18,6 +18,7 @@ import '../../panels/settings/settings-meta.js';
|
|
|
18
18
|
import '../../panels/protocol_monitor/protocol_monitor-meta.js';
|
|
19
19
|
import '../../models/persistence/persistence-meta.js';
|
|
20
20
|
import '../../models/logs/logs-meta.js';
|
|
21
|
+
import '../../models/badges/badges-meta.js';
|
|
21
22
|
import '../main/main-meta.js';
|
|
22
23
|
import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
|
|
23
24
|
import '../../ui/legacy/components/quick_open/quick_open-meta.js';
|
|
@@ -13,6 +13,7 @@ import '../../models/workspace/workspace-meta.js';
|
|
|
13
13
|
import '../../Images/Images.js';
|
|
14
14
|
import '../../models/logs/logs-meta.js';
|
|
15
15
|
import '../../models/persistence/persistence-meta.js';
|
|
16
|
+
import '../../models/badges/badges-meta.js';
|
|
16
17
|
import '../../panels/browser_debugger/browser_debugger-meta.js';
|
|
17
18
|
import '../../panels/developer_resources/developer_resources-meta.js';
|
|
18
19
|
// panels/timeline depends on mobile_throttling for settings UI
|
|
@@ -13,7 +13,7 @@ instances simultaneously.
|
|
|
13
13
|
|
|
14
14
|
The following is a prioritized list of architectural shortcomings and refactoring projects aimed at reducing coupling, eliminating global state, and improving the modularity of the DevTools foundation.
|
|
15
15
|
|
|
16
|
-
### Priority 1: Move `models/text_utils` to `core/text_utils`
|
|
16
|
+
### Priority 1: Move `models/text_utils` to `core/text_utils` [DONE]
|
|
17
17
|
* **Problem**: 22 files in `front_end/core/sdk` depend directly on `front_end/models/text_utils` for basic text structures (layering violation).
|
|
18
18
|
* **Rationale**: `text_utils` contains fundamental, non-business-logic utilities (`TextRange`, `TextCursor`, `ContentData`, `ContentProvider`) that represent the base data structures of the editor, debugger, and network panels. It only depends on `core/common` and `core/platform`. Moving it to `core` is a natural fit and resolves the majority of `core` -> `models` layering violations.
|
|
19
19
|
* **Action**:
|
|
@@ -0,0 +1,73 @@
|
|
|
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 {assert} from 'chai';
|
|
6
|
+
|
|
7
|
+
import * as Root from '../core/root/root.js';
|
|
8
|
+
import * as SDK from '../core/sdk/sdk.js';
|
|
9
|
+
|
|
10
|
+
describe('Universe API Test', () => {
|
|
11
|
+
describe('ConsoleModel', () => {
|
|
12
|
+
it('receives console messages emitted from inspected page in universe ConsoleModel',
|
|
13
|
+
async ({inspectedPage, universe}) => {
|
|
14
|
+
assert.isNotNull(universe);
|
|
15
|
+
|
|
16
|
+
const primaryTarget = universe.targetManager.primaryPageTarget();
|
|
17
|
+
assert.isNotNull(primaryTarget, 'Primary page target should exist in target manager');
|
|
18
|
+
|
|
19
|
+
await inspectedPage.goToHtml('<h1>DevTools API Test Page</h1>');
|
|
20
|
+
|
|
21
|
+
const consoleModel = primaryTarget?.model(SDK.ConsoleModel.ConsoleModel);
|
|
22
|
+
const messagePromise = consoleModel?.once(SDK.ConsoleModel.Events.MessageAdded);
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
await inspectedPage.evaluate(() => console.log('Hello from Universe API Test!'));
|
|
26
|
+
|
|
27
|
+
const consoleMessage = await messagePromise;
|
|
28
|
+
assert.isDefined(consoleMessage);
|
|
29
|
+
assert.strictEqual(
|
|
30
|
+
consoleMessage?.messageText,
|
|
31
|
+
'Hello from Universe API Test!',
|
|
32
|
+
'Console message should be received by universe ConsoleModel',
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('Suite with setup configuration', () => {
|
|
38
|
+
setup({
|
|
39
|
+
creationOptions: {
|
|
40
|
+
hostConfig: {
|
|
41
|
+
devToolsConsoleInsights: {
|
|
42
|
+
enabled: true,
|
|
43
|
+
modelId: 'test-model',
|
|
44
|
+
temperature: 0.7,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('applies hostConfig from setup creationOptions globally and to Universe', async ({universe}) => {
|
|
51
|
+
assert.isNotNull(universe);
|
|
52
|
+
assert.isTrue(Root.Runtime.hostConfig.devToolsConsoleInsights?.enabled);
|
|
53
|
+
assert.strictEqual(Root.Runtime.hostConfig.devToolsConsoleInsights?.modelId, 'test-model');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('Suite with targetUrl configuration', () => {
|
|
58
|
+
setup({
|
|
59
|
+
targetUrl: 'data:text/html,<!DOCTYPE%20html><h1>Target%20URL%20Test</h1>',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('navigates to targetUrl before attaching universe', async ({inspectedPage}) => {
|
|
63
|
+
const heading = await inspectedPage.evaluate(() => document.querySelector('h1')?.textContent);
|
|
64
|
+
assert.strictEqual(heading, 'Target URL Test');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe('Suite without custom setup', () => {
|
|
69
|
+
it('restores default hostConfig after previous test suite cleaned up', async () => {
|
|
70
|
+
assert.isUndefined(Root.Runtime.hostConfig.devToolsConsoleInsights?.modelId);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -148,6 +148,14 @@ export class Universe {
|
|
|
148
148
|
resourceMapping, targetManager, ignoreListManager, workspace);
|
|
149
149
|
context.set(Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding, debuggerWorkspaceBinding);
|
|
150
150
|
|
|
151
|
+
const presentationConsoleMessageManager =
|
|
152
|
+
new Bindings.PresentationConsoleMessageHelper.PresentationConsoleMessageManager(
|
|
153
|
+
targetManager, workspace, debuggerWorkspaceBinding, cssWorkspaceBinding);
|
|
154
|
+
context.set(
|
|
155
|
+
Bindings.PresentationConsoleMessageHelper.PresentationConsoleMessageManager,
|
|
156
|
+
presentationConsoleMessageManager,
|
|
157
|
+
);
|
|
158
|
+
|
|
151
159
|
const networkProjectManager = new Bindings.NetworkProject.NetworkProjectManager();
|
|
152
160
|
context.set(Bindings.NetworkProject.NetworkProjectManager, networkProjectManager);
|
|
153
161
|
|
|
@@ -173,6 +181,7 @@ export class Universe {
|
|
|
173
181
|
workspace,
|
|
174
182
|
persistence,
|
|
175
183
|
networkPersistenceManager,
|
|
184
|
+
settings,
|
|
176
185
|
);
|
|
177
186
|
context.set(WorkspaceDiff.WorkspaceDiff.WorkspaceDiffImpl, workspaceDiff);
|
|
178
187
|
|
|
@@ -217,10 +226,19 @@ export class Universe {
|
|
|
217
226
|
get cpuThrottlingManager(): SDK.CPUThrottlingManager.CPUThrottlingManager {
|
|
218
227
|
return this.context.get(SDK.CPUThrottlingManager.CPUThrottlingManager);
|
|
219
228
|
}
|
|
229
|
+
|
|
220
230
|
get cruxManager(): CrUXManager.CrUXManager {
|
|
221
231
|
return this.context.get(CrUXManager.CrUXManager);
|
|
222
232
|
}
|
|
223
233
|
|
|
234
|
+
get cssWorkspaceBinding(): Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding {
|
|
235
|
+
return this.context.get(Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
get debuggerWorkspaceBinding(): Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding {
|
|
239
|
+
return this.context.get(Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding);
|
|
240
|
+
}
|
|
241
|
+
|
|
224
242
|
// The DeviceModeModel may not be present, as emulation is only present for the `devtools_app` entrypoint, but not for the others.
|
|
225
243
|
get deviceModeModel(): Emulation.DeviceModeModel.DeviceModeModel|null {
|
|
226
244
|
return this.supportsEmulation ? this.context.get(Emulation.DeviceModeModel.DeviceModeModel) : null;
|
|
@@ -286,6 +304,10 @@ export class Universe {
|
|
|
286
304
|
return this.context.get(Persistence.Persistence.PersistenceImpl);
|
|
287
305
|
}
|
|
288
306
|
|
|
307
|
+
get presentationConsoleMessageManager(): Bindings.PresentationConsoleMessageHelper.PresentationConsoleMessageManager {
|
|
308
|
+
return this.context.get(Bindings.PresentationConsoleMessageHelper.PresentationConsoleMessageManager);
|
|
309
|
+
}
|
|
310
|
+
|
|
289
311
|
get projectSettingsModel(): ProjectSettings.ProjectSettingsModel.ProjectSettingsModel {
|
|
290
312
|
return this.context.get(ProjectSettings.ProjectSettingsModel.ProjectSettingsModel);
|
|
291
313
|
}
|
|
@@ -1488,8 +1488,8 @@ inspectorBackend.registerCommand("WebAuthn.clearCredentials", [{"name": "authent
|
|
|
1488
1488
|
inspectorBackend.registerCommand("WebAuthn.setUserVerified", [{"name": "authenticatorId", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorId"}, {"name": "isUserVerified", "type": "boolean", "optional": false, "description": "", "typeRef": null}], [], "Sets whether User Verification succeeds or fails for an authenticator. The default is true.");
|
|
1489
1489
|
inspectorBackend.registerCommand("WebAuthn.setAutomaticPresenceSimulation", [{"name": "authenticatorId", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorId"}, {"name": "enabled", "type": "boolean", "optional": false, "description": "", "typeRef": null}], [], "Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.");
|
|
1490
1490
|
inspectorBackend.registerCommand("WebAuthn.setCredentialProperties", [{"name": "authenticatorId", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorId"}, {"name": "credentialId", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "backupEligibility", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "backupState", "type": "boolean", "optional": true, "description": "", "typeRef": null}], [], "Allows setting credential properties. https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties");
|
|
1491
|
-
inspectorBackend.registerType("WebAuthn.VirtualAuthenticatorOptions", [{"name": "protocol", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorProtocol"}, {"name": "ctap2Version", "type": "string", "optional": true, "description": "Defaults to ctap2_0. Ignored if |protocol| == u2f.", "typeRef": "WebAuthn.Ctap2Version"}, {"name": "transport", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorTransport"}, {"name": "hasResidentKey", "type": "boolean", "optional": true, "description": "Defaults to false.", "typeRef": null}, {"name": "hasUserVerification", "type": "boolean", "optional": true, "description": "Defaults to false.", "typeRef": null}, {"name": "hasLargeBlob", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.", "typeRef": null}, {"name": "hasCredBlob", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false.", "typeRef": null}, {"name": "hasMinPinLength", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension Defaults to false.", "typeRef": null}, {"name": "hasPrf", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.", "typeRef": null}, {"name": "hasHmacSecret", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the hmac-secret extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension Defaults to false.", "typeRef": null}, {"name": "hasHmacSecretMc", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the hmac-secret-mc extension. https://fidoalliance.org/specs/fido-v2.2-rd-20241003/fido-client-to-authenticator-protocol-v2.2-rd-20241003.html#sctn-hmac-secret-make-cred-extension Defaults to false.", "typeRef": null}, {"name": "automaticPresenceSimulation", "type": "boolean", "optional": true, "description": "If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.", "typeRef": null}, {"name": "isUserVerified", "type": "boolean", "optional": true, "description": "Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.", "typeRef": null}, {"name": "defaultBackupEligibility", "type": "boolean", "optional": true, "description": "Credentials created by this authenticator will have the backup eligibility (BE) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup", "typeRef": null}, {"name": "defaultBackupState", "type": "boolean", "optional": true, "description": "Credentials created by this authenticator will have the backup state (BS) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup", "typeRef": null}]);
|
|
1492
|
-
inspectorBackend.registerType("WebAuthn.Credential", [{"name": "credentialId", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "isResidentCredential", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "rpId", "type": "string", "optional": true, "description": "Relying Party ID the credential is scoped to. Must be set when adding a credential.", "typeRef": null}, {"name": "privateKey", "type": "string", "optional": false, "description": "The ECDSA P-256 private key in PKCS#8 format.", "typeRef": null}, {"name": "userHandle", "type": "string", "optional": true, "description": "An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user.", "typeRef": null}, {"name": "signCount", "type": "number", "optional": false, "description": "Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter", "typeRef": null}, {"name": "largeBlob", "type": "string", "optional": true, "description": "The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension", "typeRef": null}, {"name": "backupEligibility", "type": "boolean", "optional": true, "description": "Assertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value.", "typeRef": null}, {"name": "backupState", "type": "boolean", "optional": true, "description": "Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.", "typeRef": null}, {"name": "userName", "type": "string", "optional": true, "description": "The credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name", "typeRef": null}, {"name": "userDisplayName", "type": "string", "optional": true, "description": "The credential's user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname", "typeRef": null}]);
|
|
1491
|
+
inspectorBackend.registerType("WebAuthn.VirtualAuthenticatorOptions", [{"name": "protocol", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorProtocol"}, {"name": "ctap2Version", "type": "string", "optional": true, "description": "Defaults to ctap2_0. Ignored if |protocol| == u2f.", "typeRef": "WebAuthn.Ctap2Version"}, {"name": "transport", "type": "string", "optional": false, "description": "", "typeRef": "WebAuthn.AuthenticatorTransport"}, {"name": "hasResidentKey", "type": "boolean", "optional": true, "description": "Defaults to false.", "typeRef": null}, {"name": "hasUserVerification", "type": "boolean", "optional": true, "description": "Defaults to false.", "typeRef": null}, {"name": "hasLargeBlob", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.", "typeRef": null}, {"name": "hasCredBlob", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false.", "typeRef": null}, {"name": "hasMinPinLength", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension Defaults to false.", "typeRef": null}, {"name": "hasPrf", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.", "typeRef": null}, {"name": "hasHmacSecret", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the hmac-secret extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-hmac-secret-extension Defaults to false.", "typeRef": null}, {"name": "hasHmacSecretMc", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the hmac-secret-mc extension. https://fidoalliance.org/specs/fido-v2.2-rd-20241003/fido-client-to-authenticator-protocol-v2.2-rd-20241003.html#sctn-hmac-secret-make-cred-extension Defaults to false.", "typeRef": null}, {"name": "hasCmtgKey", "type": "boolean", "optional": true, "description": "If set to true, the authenticator will support the cmtgKey (Credential Manager Trust Group Key) extension. https://github.com/w3c/webauthn/pull/2377 Defaults to false.", "typeRef": null}, {"name": "automaticPresenceSimulation", "type": "boolean", "optional": true, "description": "If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.", "typeRef": null}, {"name": "isUserVerified", "type": "boolean", "optional": true, "description": "Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.", "typeRef": null}, {"name": "defaultBackupEligibility", "type": "boolean", "optional": true, "description": "Credentials created by this authenticator will have the backup eligibility (BE) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup", "typeRef": null}, {"name": "defaultBackupState", "type": "boolean", "optional": true, "description": "Credentials created by this authenticator will have the backup state (BS) flag set to this value. Defaults to false. https://w3c.github.io/webauthn/#sctn-credential-backup", "typeRef": null}]);
|
|
1492
|
+
inspectorBackend.registerType("WebAuthn.Credential", [{"name": "credentialId", "type": "string", "optional": false, "description": "", "typeRef": null}, {"name": "isResidentCredential", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "rpId", "type": "string", "optional": true, "description": "Relying Party ID the credential is scoped to. Must be set when adding a credential.", "typeRef": null}, {"name": "privateKey", "type": "string", "optional": false, "description": "The ECDSA P-256 private key in PKCS#8 format.", "typeRef": null}, {"name": "userHandle", "type": "string", "optional": true, "description": "An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user.", "typeRef": null}, {"name": "signCount", "type": "number", "optional": false, "description": "Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter", "typeRef": null}, {"name": "largeBlob", "type": "string", "optional": true, "description": "The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension", "typeRef": null}, {"name": "backupEligibility", "type": "boolean", "optional": true, "description": "Assertions returned by this credential will have the backup eligibility (BE) flag set to this value. Defaults to the authenticator's defaultBackupEligibility value.", "typeRef": null}, {"name": "backupState", "type": "boolean", "optional": true, "description": "Assertions returned by this credential will have the backup state (BS) flag set to this value. Defaults to the authenticator's defaultBackupState value.", "typeRef": null}, {"name": "userName", "type": "string", "optional": true, "description": "The credential's user.name property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialentity-name", "typeRef": null}, {"name": "userDisplayName", "type": "string", "optional": true, "description": "The credential's user.displayName property. Equivalent to empty if not set. https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname", "typeRef": null}, {"name": "cmtgKeys", "type": "array", "optional": true, "description": "The CMTG keys associated with the credential.", "typeRef": "binary"}, {"name": "activeCmtgKeyIndex", "type": "number", "optional": true, "description": "The 0-based index of the active key in cmtgKeys.", "typeRef": null}, {"name": "generateCmtgKeyOnNextOperation", "type": "boolean", "optional": true, "description": "If true, the authenticator will generate a new CMTG key on the next operation.", "typeRef": null}]);
|
|
1493
1493
|
|
|
1494
1494
|
// WebMCP.
|
|
1495
1495
|
inspectorBackend.registerEnum("WebMCP.InvocationStatus", {Completed: "Completed", Canceled: "Canceled", Error: "Error"});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
/* eslint-disable @stylistic/quotes, @stylistic/quote-props */
|
|
5
|
+
/* eslint-disable @stylistic/quotes, @stylistic/quote-props, @stylistic/comma-dangle */
|
|
6
6
|
export const generatedProperties = [
|
|
7
7
|
{
|
|
8
8
|
"longhands": [
|
|
@@ -20279,6 +20279,13 @@ export namespace WebAuthn {
|
|
|
20279
20279
|
* Defaults to false.
|
|
20280
20280
|
*/
|
|
20281
20281
|
hasHmacSecretMc?: boolean;
|
|
20282
|
+
/**
|
|
20283
|
+
* If set to true, the authenticator will support the cmtgKey (Credential
|
|
20284
|
+
* Manager Trust Group Key) extension.
|
|
20285
|
+
* https://github.com/w3c/webauthn/pull/2377
|
|
20286
|
+
* Defaults to false.
|
|
20287
|
+
*/
|
|
20288
|
+
hasCmtgKey?: boolean;
|
|
20282
20289
|
/**
|
|
20283
20290
|
* If set to true, tests of user presence will succeed immediately.
|
|
20284
20291
|
* Otherwise, they will not be resolved. Defaults to true.
|
|
@@ -20354,6 +20361,18 @@ export namespace WebAuthn {
|
|
|
20354
20361
|
* https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-displayname
|
|
20355
20362
|
*/
|
|
20356
20363
|
userDisplayName?: string;
|
|
20364
|
+
/**
|
|
20365
|
+
* The CMTG keys associated with the credential.
|
|
20366
|
+
*/
|
|
20367
|
+
cmtgKeys?: binary[];
|
|
20368
|
+
/**
|
|
20369
|
+
* The 0-based index of the active key in cmtgKeys.
|
|
20370
|
+
*/
|
|
20371
|
+
activeCmtgKeyIndex?: integer;
|
|
20372
|
+
/**
|
|
20373
|
+
* If true, the authenticator will generate a new CMTG key on the next operation.
|
|
20374
|
+
*/
|
|
20375
|
+
generateCmtgKeyOnNextOperation?: boolean;
|
|
20357
20376
|
}
|
|
20358
20377
|
|
|
20359
20378
|
export interface EnableRequest {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type ConversationContext,
|
|
13
13
|
type MultimodalInputType,
|
|
14
14
|
type RequestOptions,
|
|
15
|
-
ResponseType
|
|
15
|
+
ResponseType,
|
|
16
16
|
} from './agents/AiAgent.js';
|
|
17
17
|
import {type ExecuteJsAgentOptions, executeJsCode} from './agents/ExecuteJavascript.js';
|
|
18
18
|
import {ChangeManager} from './ChangeManager.js';
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
type MultimodalInput,
|
|
22
22
|
type ResponseData,
|
|
23
23
|
ResponseType,
|
|
24
|
-
type UserQuery
|
|
24
|
+
type UserQuery,
|
|
25
25
|
} from './agents/AiAgent.js';
|
|
26
26
|
import {ContextSelectionAgent} from './agents/ContextSelectionAgent.js';
|
|
27
27
|
import {FileAgent} from './agents/FileAgent.js';
|
|
@@ -175,7 +175,7 @@ Your instructions are as follows:
|
|
|
175
175
|
headings or code blocks. Only write a single paragraph of text.
|
|
176
176
|
- Your response should be concise and to the point. Avoid lengthy explanations
|
|
177
177
|
or unnecessary details.
|
|
178
|
-
|
|
178
|
+
`,
|
|
179
179
|
}],
|
|
180
180
|
expectedInputs: [{
|
|
181
181
|
type: 'text',
|
|
@@ -9,15 +9,10 @@ import type * as Protocol from '../../generated/protocol.js';
|
|
|
9
9
|
|
|
10
10
|
export interface Change {
|
|
11
11
|
groupId: string;
|
|
12
|
-
// Optional about where in the source the selector was defined.
|
|
13
|
-
sourceLocation?: string;
|
|
14
12
|
// Selector used by the page or a simple selector as the fallback.
|
|
15
13
|
selector: string;
|
|
16
|
-
// Selector computed based on the element attributes.
|
|
17
|
-
simpleSelector?: string;
|
|
18
14
|
className: string;
|
|
19
15
|
styles: Record<string, string>;
|
|
20
|
-
backendNodeId?: Protocol.DOM.BackendNodeId;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
function formatStyles(styles: Record<string, string>, indent = 2): string {
|
|
@@ -34,7 +29,6 @@ export class ChangeManager {
|
|
|
34
29
|
readonly #cssModelToStylesheetId =
|
|
35
30
|
new Map<SDK.CSSModel.CSSModel, Map<Protocol.Page.FrameId, Protocol.DOM.StyleSheetId>>();
|
|
36
31
|
readonly #stylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
37
|
-
readonly #backupStylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
38
32
|
|
|
39
33
|
constructor(targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance()) {
|
|
40
34
|
targetManager.addModelListener(
|
|
@@ -45,35 +39,6 @@ export class ChangeManager {
|
|
|
45
39
|
);
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
async stashChanges(): Promise<void> {
|
|
49
|
-
for (const [cssModel, stylesheetMap] of this.#cssModelToStylesheetId.entries()) {
|
|
50
|
-
const stylesheetIds = Array.from(stylesheetMap.values());
|
|
51
|
-
await Promise.allSettled(stylesheetIds.map(async id => {
|
|
52
|
-
this.#backupStylesheetChanges.set(id, this.#stylesheetChanges.get(id) ?? []);
|
|
53
|
-
this.#stylesheetChanges.delete(id);
|
|
54
|
-
await cssModel.setStyleSheetText(id, '', true);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
dropStashedChanges(): void {
|
|
60
|
-
this.#backupStylesheetChanges.clear();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async popStashedChanges(): Promise<void> {
|
|
64
|
-
const cssModelAndStyleSheets = Array.from(this.#cssModelToStylesheetId.entries());
|
|
65
|
-
|
|
66
|
-
await Promise.allSettled(cssModelAndStyleSheets.map(async ([cssModel, stylesheetMap]) => {
|
|
67
|
-
const frameAndStylesheet = Array.from(stylesheetMap.entries());
|
|
68
|
-
return await Promise.allSettled(frameAndStylesheet.map(async ([frameId, stylesheetId]) => {
|
|
69
|
-
const changes = this.#backupStylesheetChanges.get(stylesheetId) ?? [];
|
|
70
|
-
return await Promise.allSettled(changes.map(async change => {
|
|
71
|
-
return await this.addChange(cssModel, frameId, change);
|
|
72
|
-
}));
|
|
73
|
-
}));
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
42
|
async clear(): Promise<void> {
|
|
78
43
|
const models = Array.from(this.#cssModelToStylesheetId.keys());
|
|
79
44
|
const results = await Promise.allSettled(models.map(async model => {
|
|
@@ -81,7 +46,6 @@ export class ChangeManager {
|
|
|
81
46
|
}));
|
|
82
47
|
this.#cssModelToStylesheetId.clear();
|
|
83
48
|
this.#stylesheetChanges.clear();
|
|
84
|
-
this.#backupStylesheetChanges.clear();
|
|
85
49
|
const firstFailed = results.find(result => result.status === 'rejected');
|
|
86
50
|
if (firstFailed) {
|
|
87
51
|
console.error(firstFailed.reason);
|
|
@@ -114,27 +78,6 @@ export class ChangeManager {
|
|
|
114
78
|
return content;
|
|
115
79
|
}
|
|
116
80
|
|
|
117
|
-
formatChangesForPatching(groupId: string, includeMetadata = false): string {
|
|
118
|
-
return Array.from(this.#stylesheetChanges.values())
|
|
119
|
-
.flatMap(
|
|
120
|
-
changesPerStylesheet => changesPerStylesheet.filter(change => change.groupId === groupId)
|
|
121
|
-
.map(change => this.#formatChange(change, includeMetadata)))
|
|
122
|
-
.filter(change => change !== '')
|
|
123
|
-
.join('\n\n');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
getChangedNodesForGroupId(groupId: string): Protocol.DOM.BackendNodeId[] {
|
|
127
|
-
const nodes = new Set<Protocol.DOM.BackendNodeId>();
|
|
128
|
-
for (const changes of this.#stylesheetChanges.values()) {
|
|
129
|
-
for (const change of changes) {
|
|
130
|
-
if (change.groupId === groupId && change.backendNodeId) {
|
|
131
|
-
nodes.add(change.backendNodeId);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return Array.from(nodes);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
81
|
#formatChangesForInspectorStylesheet(changes: Change[]): string {
|
|
139
82
|
return changes
|
|
140
83
|
.map(change => {
|
|
@@ -147,18 +90,6 @@ ${formatStyles(change.styles, 4)}
|
|
|
147
90
|
.join('\n');
|
|
148
91
|
}
|
|
149
92
|
|
|
150
|
-
#formatChange(change: Change, includeMetadata = false): string {
|
|
151
|
-
const sourceLocation =
|
|
152
|
-
includeMetadata && change.sourceLocation ? `/* related resource: ${change.sourceLocation} */\n` : '';
|
|
153
|
-
// TODO: includeMetadata indicates whether we are using Patch
|
|
154
|
-
// agent. If needed we can have an separate knob.
|
|
155
|
-
const simpleSelector =
|
|
156
|
-
includeMetadata && change.simpleSelector ? ` /* the element was ${change.simpleSelector} */` : '';
|
|
157
|
-
return `${sourceLocation}${change.selector} {${simpleSelector}
|
|
158
|
-
${formatStyles(change.styles)}
|
|
159
|
-
}`;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
93
|
async #getStylesheet(cssModel: SDK.CSSModel.CSSModel, frameId: Protocol.Page.FrameId):
|
|
163
94
|
Promise<Protocol.DOM.StyleSheetId> {
|
|
164
95
|
return await this.#stylesheetMutex.run(async () => {
|
|
@@ -189,7 +120,6 @@ ${formatStyles(change.styles)}
|
|
|
189
120
|
// Empty stylesheets.
|
|
190
121
|
const results = await Promise.allSettled(stylesheetIds.map(async id => {
|
|
191
122
|
this.#stylesheetChanges.delete(id);
|
|
192
|
-
this.#backupStylesheetChanges.delete(id);
|
|
193
123
|
await cssModel.setStyleSheetText(id, '', true);
|
|
194
124
|
}));
|
|
195
125
|
this.#cssModelToStylesheetId.delete(cssModel);
|
|
@@ -6,7 +6,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
8
|
import * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import * as Bindings from '../bindings/bindings.js';
|
|
10
9
|
|
|
11
10
|
import type {ChangeManager} from './ChangeManager.js';
|
|
12
11
|
import {
|
|
@@ -15,14 +14,11 @@ import {
|
|
|
15
14
|
FREESTYLER_BINDING_NAME,
|
|
16
15
|
FREESTYLER_WORLD_NAME,
|
|
17
16
|
freestylerBinding,
|
|
18
|
-
injectedFunctions
|
|
17
|
+
injectedFunctions,
|
|
19
18
|
} from './injected.js';
|
|
20
19
|
|
|
21
20
|
interface ElementContext {
|
|
22
21
|
selector: string;
|
|
23
|
-
simpleSelector?: string;
|
|
24
|
-
sourceLocation?: string;
|
|
25
|
-
backendNodeId?: Protocol.DOM.BackendNodeId;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
/**
|
|
@@ -237,27 +233,6 @@ export class ExtensionScope {
|
|
|
237
233
|
return node.localName() || node.nodeName().toLowerCase();
|
|
238
234
|
}
|
|
239
235
|
|
|
240
|
-
static getSourceLocation(
|
|
241
|
-
styleRule: SDK.CSSRule.CSSStyleRule,
|
|
242
|
-
cssWorkspaceBinding: Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding =
|
|
243
|
-
Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance(),
|
|
244
|
-
): string|undefined {
|
|
245
|
-
const styleSheetHeader = styleRule.header;
|
|
246
|
-
if (!styleSheetHeader) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const range = styleRule.selectorRange();
|
|
251
|
-
if (!range) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const lineNumber = styleSheetHeader.lineNumberInSource(range.startLine);
|
|
255
|
-
const columnNumber = styleSheetHeader.columnNumberInSource(range.startLine, range.startColumn);
|
|
256
|
-
const location = new SDK.CSSModel.CSSLocation(styleSheetHeader, lineNumber, columnNumber);
|
|
257
|
-
const uiLocation = cssWorkspaceBinding.rawLocationToUILocation(location);
|
|
258
|
-
return uiLocation?.linkText(/* skipTrim= */ true, /* showColumnNumber= */ true);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
236
|
async #computeContextFromElement(remoteObject: SDK.RemoteObject.RemoteObject): Promise<ElementContext> {
|
|
262
237
|
if (!remoteObject.objectId) {
|
|
263
238
|
throw new Error('DOMModel is not found');
|
|
@@ -278,7 +253,6 @@ export class ExtensionScope {
|
|
|
278
253
|
throw new Error('Node is not found');
|
|
279
254
|
}
|
|
280
255
|
|
|
281
|
-
const backendNodeId = node.backendNodeId();
|
|
282
256
|
try {
|
|
283
257
|
const matchedStyles = await cssModel.getMatchedStyles(node.id);
|
|
284
258
|
|
|
@@ -300,9 +274,6 @@ export class ExtensionScope {
|
|
|
300
274
|
|
|
301
275
|
return {
|
|
302
276
|
selector,
|
|
303
|
-
simpleSelector: ExtensionScope.getSelectorForNode(node),
|
|
304
|
-
sourceLocation: ExtensionScope.getSourceLocation(styleRule),
|
|
305
|
-
backendNodeId,
|
|
306
277
|
};
|
|
307
278
|
} catch {
|
|
308
279
|
// no-op to allow the fallback below to run.
|
|
@@ -311,7 +282,6 @@ export class ExtensionScope {
|
|
|
311
282
|
// Fallback
|
|
312
283
|
return {
|
|
313
284
|
selector: ExtensionScope.getSelectorForNode(node),
|
|
314
|
-
backendNodeId,
|
|
315
285
|
};
|
|
316
286
|
}
|
|
317
287
|
|
|
@@ -333,7 +303,7 @@ export class ExtensionScope {
|
|
|
333
303
|
const id = data.payload;
|
|
334
304
|
const [args, element] = await Promise.all([
|
|
335
305
|
this.#simpleEval(executionContext, `freestyler.getArgs(${id})`),
|
|
336
|
-
this.#simpleEval(executionContext, `freestyler.getElement(${id})`, false)
|
|
306
|
+
this.#simpleEval(executionContext, `freestyler.getElement(${id})`, false),
|
|
337
307
|
]);
|
|
338
308
|
|
|
339
309
|
const arg = JSON.parse(args.object.value) as Omit<FreestyleCallbackArgs, 'element'>;
|
|
@@ -345,7 +315,6 @@ export class ExtensionScope {
|
|
|
345
315
|
let context: ElementContext = {
|
|
346
316
|
// TODO: Should this a be a *?
|
|
347
317
|
selector: '',
|
|
348
|
-
backendNodeId: undefined,
|
|
349
318
|
};
|
|
350
319
|
try {
|
|
351
320
|
context = await this.#computeContextFromElement(element.object);
|
|
@@ -359,12 +328,9 @@ export class ExtensionScope {
|
|
|
359
328
|
const sanitizedStyles = await this.sanitizedStyleChanges(context.selector, arg.styles);
|
|
360
329
|
const styleChanges = await this.#changeManager.addChange(cssModel, this.frameId, {
|
|
361
330
|
groupId: this.#agentId,
|
|
362
|
-
sourceLocation: context.sourceLocation,
|
|
363
331
|
selector: context.selector,
|
|
364
|
-
simpleSelector: context.simpleSelector,
|
|
365
332
|
className: arg.className,
|
|
366
333
|
styles: sanitizedStyles,
|
|
367
|
-
backendNodeId: context.backendNodeId,
|
|
368
334
|
});
|
|
369
335
|
await this.#simpleEval(executionContext, `freestyler.respond(${id}, ${JSON.stringify(styleChanges)})`);
|
|
370
336
|
} catch (error) {
|
|
@@ -219,7 +219,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
219
219
|
displayInfoFromArgs: params => {
|
|
220
220
|
return {
|
|
221
221
|
title: i18n.i18n.lockedString(`Getting Lighthouse audits for ${params.categoryId}`),
|
|
222
|
-
action: `getLighthouseAudits('${params.categoryId}')
|
|
222
|
+
action: `getLighthouseAudits('${params.categoryId}')`,
|
|
223
223
|
};
|
|
224
224
|
},
|
|
225
225
|
handler: async params => {
|
|
@@ -233,7 +233,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
233
233
|
result: {audits},
|
|
234
234
|
widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report}}],
|
|
235
235
|
};
|
|
236
|
-
}
|
|
236
|
+
},
|
|
237
237
|
});
|
|
238
238
|
|
|
239
239
|
const executeJsTool = ToolRegistry.get(ToolName.EXECUTE_JAVASCRIPT);
|
|
@@ -284,7 +284,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
284
284
|
return {
|
|
285
285
|
title: i18n.i18n.lockedString('Running accessibility audits'),
|
|
286
286
|
thought: params.explanation,
|
|
287
|
-
action: 'runAccessibilityAudits()'
|
|
287
|
+
action: 'runAccessibilityAudits()',
|
|
288
288
|
};
|
|
289
289
|
},
|
|
290
290
|
handler: async params => {
|
|
@@ -310,7 +310,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
310
310
|
result: {audits},
|
|
311
311
|
widgets: [{name: 'LIGHTHOUSE_REPORT', data: {report, snapshotReport: true}}],
|
|
312
312
|
};
|
|
313
|
-
}
|
|
313
|
+
},
|
|
314
314
|
});
|
|
315
315
|
|
|
316
316
|
this.declareFunction<{
|
|
@@ -343,11 +343,11 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
343
343
|
nullable: false,
|
|
344
344
|
items: {
|
|
345
345
|
type: Host.AidaClient.ParametersTypes.STRING,
|
|
346
|
-
description: 'A CSS style property name to retrieve. For example, \'background-color\'.'
|
|
347
|
-
}
|
|
346
|
+
description: 'A CSS style property name to retrieve. For example, \'background-color\'.',
|
|
347
|
+
},
|
|
348
348
|
},
|
|
349
349
|
},
|
|
350
|
-
required: ['explanation', 'path', 'styleProperties']
|
|
350
|
+
required: ['explanation', 'path', 'styleProperties'],
|
|
351
351
|
},
|
|
352
352
|
displayInfoFromArgs: params => {
|
|
353
353
|
return {
|
|
@@ -388,7 +388,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
388
388
|
backendNodeId: node.backendNodeId(),
|
|
389
389
|
matchedCascade: matchedStyles,
|
|
390
390
|
properties: params.styleProperties,
|
|
391
|
-
}
|
|
391
|
+
},
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
|
|
@@ -422,7 +422,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
422
422
|
nullable: false,
|
|
423
423
|
},
|
|
424
424
|
},
|
|
425
|
-
required: ['explanation', 'path']
|
|
425
|
+
required: ['explanation', 'path'],
|
|
426
426
|
},
|
|
427
427
|
displayInfoFromArgs: params => {
|
|
428
428
|
return {
|