chrome-devtools-frontend 1.0.1683520 → 1.0.1689415
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/gerrit-cli/SKILL.md +29 -8
- package/.agents/skills/gerrit-cli/references/commands.md +51 -18
- package/.agents/skills/gerrit-cli/references/workflows.md +6 -6
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +43 -70
- package/AUTHORS +1 -0
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +9 -0
- package/docs/contributing/issues.md +1 -1
- package/docs/styleguide/ux/writing.md +2 -2
- package/eslint.config.mjs +18 -10
- package/front_end/core/common/Base64.ts +1 -1
- package/front_end/core/common/Color.ts +28 -6
- package/front_end/core/common/ColorConverter.ts +12 -0
- package/front_end/core/common/Console.ts +2 -1
- package/front_end/core/common/Object.ts +2 -2
- package/front_end/core/common/ResourceType.ts +12 -13
- package/front_end/core/common/Revealer.ts +1 -1
- package/front_end/core/common/Settings.ts +2 -2
- package/front_end/core/common/TextDictionary.ts +2 -2
- package/front_end/core/common/Throttler.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +51 -37
- package/front_end/core/host/host.ts +1 -1
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/platform/HostRuntime.ts +3 -3
- package/front_end/core/platform/KeyboardUtilities.ts +1 -1
- package/front_end/core/protocol_client/InspectorBackend.ts +7 -6
- package/front_end/core/root/Runtime.ts +4 -2
- package/front_end/core/sdk/AnimationModel.ts +1 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +198 -0
- package/front_end/core/sdk/CSSMetadata.ts +11 -6
- package/front_end/core/sdk/CSSPropertyParser.ts +5 -3
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +90 -59
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -3
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/EmulationModel.ts +5 -0
- package/front_end/core/sdk/LayerTreeBase.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +1 -1
- package/front_end/core/sdk/README.md +40 -0
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -2
- package/front_end/core/sdk/SDKModel.ts +1 -1
- package/front_end/core/sdk/SDKSettings.ts +6 -0
- package/front_end/core/sdk/Script.ts +2 -1
- package/front_end/core/sdk/SecurityOrigin.ts +48 -0
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -7
- package/front_end/core/sdk/ServiceWorkerManager.ts +75 -17
- package/front_end/core/sdk/StorageBucketsModel.ts +0 -6
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/core/text_utils/ContentData.ts +1 -1
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +3 -1
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +1 -1
- package/front_end/entrypoints/inspector_main/nodeIcon.css +1 -1
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +3 -3
- package/front_end/entrypoints/inspector_main/renderingOptions.css +3 -3
- package/front_end/entrypoints/js_app/js_app.ts +25 -9
- package/front_end/entrypoints/main/MainImpl.ts +2 -1
- package/front_end/entrypoints/main/main-meta.ts +5 -31
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +5 -5
- package/front_end/entrypoints/node_app/node_app.ts +1 -1
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/ARIAProperties.ts +39 -1
- package/front_end/generated/InspectorBackendCommands.ts +13 -22
- package/front_end/generated/SupportedCSSProperties.ts +60 -119
- package/front_end/generated/protocol-mapping.d.ts +18 -59
- package/front_end/generated/protocol-proxy-api.d.ts +14 -47
- package/front_end/generated/protocol.ts +104 -331
- package/front_end/models/ai_assistance/AiAgent2.ts +25 -11
- package/front_end/models/ai_assistance/AiConversation.ts +23 -14
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +2 -2
- package/front_end/models/ai_assistance/AiUtils.ts +16 -0
- package/front_end/models/ai_assistance/EvaluateAction.ts +1 -1
- package/front_end/models/ai_assistance/README.md +1 -1
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -3
- package/front_end/models/ai_assistance/agents/AiAgent.ts +40 -25
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -3
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +13 -11
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -7
- package/front_end/models/ai_assistance/ai_assistance.ts +12 -0
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +16 -1
- package/front_end/models/ai_assistance/contexts/FileContext.ts +6 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +150 -325
- package/front_end/models/ai_assistance/injected.ts +5 -3
- package/front_end/models/ai_assistance/performance/AIContext.ts +1 -1
- package/front_end/models/ai_assistance/skills/README.md +1 -1
- package/front_end/models/ai_assistance/skills/accessibility.md +19 -10
- package/front_end/models/ai_assistance/skills/network.md +13 -7
- package/front_end/models/ai_assistance/skills/performance.md +22 -16
- package/front_end/models/ai_assistance/skills/sources.md +13 -7
- package/front_end/models/ai_assistance/skills/storage.md +19 -18
- package/front_end/models/ai_assistance/skills/styling.md +30 -37
- package/front_end/models/ai_assistance/tools/CookieUtils.ts +120 -0
- package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +53 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +8 -32
- package/front_end/models/ai_assistance/tools/GetCookieValues.ts +146 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +11 -9
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +17 -5
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +12 -11
- package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +11 -11
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +15 -8
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +12 -12
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +132 -0
- package/front_end/models/ai_assistance/tools/GetStorageValues.ts +18 -5
- package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +13 -14
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +12 -10
- package/front_end/models/ai_assistance/tools/ListCookies.ts +93 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +15 -6
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +3 -3
- package/front_end/models/ai_assistance/tools/ListSources.ts +5 -3
- package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +17 -5
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +3 -2
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +4 -3
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +14 -17
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/Tool.ts +36 -13
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +41 -8
- package/front_end/models/badges/AiExplorerBadge.ts +3 -3
- package/front_end/models/badges/CodeWhispererBadge.ts +2 -2
- package/front_end/models/badges/DOMDetectiveBadge.ts +3 -3
- package/front_end/models/badges/SpeedsterBadge.ts +3 -3
- package/front_end/models/badges/StarterBadge.ts +4 -4
- package/front_end/models/bindings/CompilerScriptMapping.ts +11 -2
- package/front_end/models/bindings/ContentProviderBasedProject.ts +3 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
- package/front_end/models/emulation/EmulatedDevices.ts +2 -2
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
- package/front_end/models/formatter/ScriptFormatter.ts +1 -2
- package/front_end/models/geometry/GeometryImpl.ts +2 -2
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +1 -1
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +3 -2
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DOMIssuesManager.ts +144 -0
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +13 -1
- package/front_end/models/issues_manager/GenericIssue.ts +32 -20
- package/front_end/models/issues_manager/IssuesManager.ts +0 -1
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +1 -1
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/{NativeFunctions.js → NativeFunctions.ts} +29 -9
- package/front_end/models/live-metrics/LiveMetrics.ts +9 -3
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +58 -6
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +2 -62
- package/front_end/models/network_time_calculator/RequestTimeRanges.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +35 -6
- package/front_end/models/stack_trace/StackTraceImpl.ts +2 -2
- package/front_end/models/trace/LanternComputationData.ts +2 -3
- package/front_end/models/trace/extras/StackTraceForEvent.ts +3 -2
- package/front_end/models/trace/extras/ThirdParties.ts +9 -9
- package/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +7 -4
- package/front_end/models/trace/handlers/FramesHandler.ts +3 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/handlers/SamplesHandler.ts +4 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +1 -1
- package/front_end/models/trace/handlers/WarningsHandler.ts +2 -2
- package/front_end/models/trace/helpers/Network.ts +3 -3
- package/front_end/models/trace/helpers/Trace.ts +1 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
- package/front_end/models/trace/insights/Cache.ts +3 -1
- package/front_end/models/trace/insights/CharacterSet.ts +3 -1
- package/front_end/models/trace/insights/DOMSize.ts +3 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -1
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -1
- package/front_end/models/trace/insights/FontDisplay.ts +2 -1
- package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +3 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +3 -1
- package/front_end/models/trace/insights/LegacyJavaScript.ts +3 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +5 -4
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -3
- package/front_end/models/trace/insights/Viewport.ts +2 -1
- package/front_end/models/trace/lantern/simulation/Constants.ts +34 -2
- package/front_end/models/trace/lantern/simulation/DNSCache.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +8 -3
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +18 -2
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +686 -2
- package/front_end/panels/accessibility/accessibilityNode.css +4 -4
- package/front_end/panels/accessibility/accessibilityProperties.css +1 -1
- package/front_end/panels/accessibility/accessibilitySidebarView.css +2 -2
- package/front_end/panels/accessibility/axBreadcrumbs.css +13 -13
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -14
- package/front_end/panels/ai_assistance/ExternalHandler.ts +89 -0
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +12 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +16 -16
- package/front_end/panels/ai_assistance/components/chatView.css +2 -2
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -1
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +4 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +6 -6
- package/front_end/panels/animation/animationTimeline.css +62 -62
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -1
- package/front_end/panels/application/BackgroundServiceModel.ts +4 -3
- package/front_end/panels/application/BackgroundServiceView.ts +290 -252
- package/front_end/panels/application/IndexedDBModel.ts +0 -7
- package/front_end/panels/application/WebMCPView.ts +15 -7
- package/front_end/panels/application/appManifestView.css +5 -5
- package/front_end/panels/application/backgroundServiceView.css +18 -2
- package/front_end/panels/application/components/AdsView.ts +100 -4
- package/front_end/panels/application/components/adsView.css +8 -5
- package/front_end/panels/application/components/backForwardCacheView.css +5 -5
- package/front_end/panels/application/components/bounceTrackingMitigationsView.css +1 -1
- package/front_end/panels/application/components/endpointsGrid.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/components/protocolHandlersView.css +6 -6
- package/front_end/panels/application/components/reportsGrid.css +1 -1
- package/front_end/panels/application/components/serviceWorkerRouterView.css +4 -4
- package/front_end/panels/application/components/trustTokensView.css +7 -7
- package/front_end/panels/application/cookieItemsView.css +3 -3
- package/front_end/panels/application/deviceBoundSessionsView.css +3 -3
- package/front_end/panels/application/frameDetailsReportView.css +11 -11
- package/front_end/panels/application/indexedDBViews.css +7 -7
- package/front_end/panels/application/originTrialTokenRows.css +2 -2
- package/front_end/panels/application/originTrialTreeView.css +3 -3
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +1 -1
- package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingGrid.css +2 -2
- package/front_end/panels/application/preloading/components/usedPreloadingView.css +7 -7
- package/front_end/panels/application/preloading/preloadingView.css +1 -1
- package/front_end/panels/application/preloading/preloadingViewDropDown.css +3 -3
- package/front_end/panels/application/serviceWorkerCacheViews.css +5 -5
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +12 -12
- package/front_end/panels/application/serviceWorkersView.css +15 -16
- package/front_end/panels/application/storageView.css +5 -5
- package/front_end/panels/application/webMCPView.css +9 -9
- package/front_end/panels/autofill/autofillView.css +4 -4
- package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +5 -3
- package/front_end/panels/browser_debugger/xhrBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/changes/changesSidebar.css +1 -1
- package/front_end/panels/changes/changesView.css +1 -1
- package/front_end/panels/changes/combinedDiffView.css +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +5 -10
- package/front_end/panels/common/badgeNotification.css +2 -2
- package/front_end/panels/common/domLinkifier.css +1 -1
- package/front_end/panels/common/gdpSignUpDialog.css +3 -3
- package/front_end/panels/common/geminiRebrandPromoDialog.css +1 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -3
- package/front_end/panels/console/ConsoleView.ts +23 -19
- package/front_end/panels/console/ConsoleViewMessage.ts +7 -2
- package/front_end/panels/console/console-meta.ts +9 -43
- package/front_end/panels/console/consoleContextSelector.css +2 -2
- package/front_end/panels/console/consolePinPane.css +9 -9
- package/front_end/panels/console/consolePrompt.css +5 -5
- package/front_end/panels/console/consoleView.css +39 -39
- package/front_end/panels/coverage/coverageListView.css +2 -2
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +34 -34
- package/front_end/panels/css_overview/cssOverviewProcessingView.css +5 -5
- package/front_end/panels/css_overview/cssOverviewSidebarPanel.css +1 -1
- package/front_end/panels/css_overview/cssOverviewStartView.css +17 -17
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +209 -62
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +4 -4
- package/front_end/panels/elements/DOMTreeContextMenu.ts +59 -54
- package/front_end/panels/elements/ElementIssueUtils.ts +10 -2
- package/front_end/panels/elements/ElementsPanel.ts +5 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +212 -255
- package/front_end/panels/elements/ElementsTreeOutline.ts +1804 -495
- package/front_end/panels/elements/ShortcutTreeElement.ts +6 -3
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -11
- package/front_end/panels/elements/StylePropertiesSection.ts +65 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -0
- package/front_end/panels/elements/StylesContainer.ts +1 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +317 -159
- package/front_end/panels/elements/classesPaneWidget.css +6 -6
- package/front_end/panels/elements/components/stylePropertyEditor.css +7 -7
- package/front_end/panels/elements/computedStyleWidget.css +1 -1
- package/front_end/panels/elements/elementStatePaneWidget.css +8 -8
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/elements/elementsPanel.css +4 -4
- package/front_end/panels/elements/elementsTreeOutline.css +222 -38
- package/front_end/panels/elements/layersWidget.css +4 -4
- package/front_end/panels/elements/layoutPane.css +18 -18
- package/front_end/panels/elements/metricsSidebarPane.css +11 -11
- package/front_end/panels/elements/platformFontsWidget.css +5 -5
- package/front_end/panels/elements/propertiesWidget.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +20 -20
- package/front_end/panels/elements/stylesSidebarPane.css +37 -20
- package/front_end/panels/emulation/deviceModeView.css +49 -49
- package/front_end/panels/emulation/mediaQueryInspector.css +18 -18
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +29 -29
- package/front_end/panels/issues/components/elementsPanelLink.css +2 -2
- package/front_end/panels/issues/components/hideIssuesMenu.css +1 -1
- package/front_end/panels/issues/issuesPane.css +2 -2
- package/front_end/panels/issues/issuesTree.css +50 -50
- package/front_end/panels/layer_viewer/Layers3DView.ts +9 -10
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +2 -2
- package/front_end/panels/layer_viewer/layers3DView.css +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +1 -1
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/media/playerListView.css +9 -9
- package/front_end/panels/media/playerMessagesView.css +8 -8
- package/front_end/panels/media/playerPropertiesView.css +6 -6
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +9 -9
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -0
- package/front_end/panels/network/NetworkPanel.ts +9 -4
- package/front_end/panels/network/RequestConditionsDrawer.ts +12 -12
- package/front_end/panels/network/RequestPayloadView.ts +78 -26
- package/front_end/panels/network/binaryResourceView.css +1 -1
- package/front_end/panels/network/components/EditableSpan.css +3 -3
- package/front_end/panels/network/components/HeaderSectionRow.css +14 -14
- package/front_end/panels/network/components/RequestHeaderSection.css +7 -7
- package/front_end/panels/network/components/RequestHeadersView.css +18 -18
- package/front_end/panels/network/components/RequestTrustTokensView.css +1 -1
- package/front_end/panels/network/network-meta.ts +9 -9
- package/front_end/panels/network/networkConfigView.css +11 -11
- package/front_end/panels/network/networkLogView.css +35 -35
- package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
- package/front_end/panels/network/networkPanel.css +7 -7
- package/front_end/panels/network/networkTimingTable.css +13 -13
- package/front_end/panels/network/requestConditionsDrawer.css +4 -4
- package/front_end/panels/network/requestCookiesView.css +5 -5
- package/front_end/panels/network/requestDeviceBoundSessionsView.css +1 -1
- package/front_end/panels/network/requestHTMLView.css +1 -1
- package/front_end/panels/network/requestHeadersTree.css +19 -19
- package/front_end/panels/network/requestInitiatorView.css +1 -1
- package/front_end/panels/network/requestInitiatorViewTree.css +3 -3
- package/front_end/panels/network/requestPayloadTree.css +5 -5
- package/front_end/panels/network/requestPayloadView.css +1 -1
- package/front_end/panels/network/resourceChunkView.css +3 -3
- package/front_end/panels/network/signedExchangeInfoTree.css +6 -6
- package/front_end/panels/profiler/heapProfiler.css +15 -15
- package/front_end/panels/profiler/profileLauncherView.css +10 -10
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/StepEditor.ts +86 -7
- package/front_end/panels/recorder/TimelineSection.ts +2 -1
- package/front_end/panels/recorder/createRecordingView.css +17 -17
- package/front_end/panels/recorder/extensionView.css +5 -5
- package/front_end/panels/recorder/injected/RecordingClient.ts +1 -1
- package/front_end/panels/recorder/models/SchemaUtils.ts +2 -2
- package/front_end/panels/recorder/models/ScreenshotStorage.ts +1 -1
- package/front_end/panels/recorder/recorderPanel.css +7 -7
- package/front_end/panels/recorder/recordingListView.css +12 -12
- package/front_end/panels/recorder/recordingView.css +47 -47
- package/front_end/panels/recorder/stepEditor.css +2 -2
- package/front_end/panels/recorder/stepView.css +20 -20
- package/front_end/panels/recorder/timelineSection.css +9 -9
- package/front_end/panels/screencast/screencastView.css +12 -12
- package/front_end/panels/search/searchResultsPane.css +10 -10
- package/front_end/panels/search/searchView.css +9 -9
- package/front_end/panels/security/SecurityPanel.ts +84 -54
- package/front_end/panels/security/SecurityPanelSidebar.ts +0 -32
- package/front_end/panels/security/mainView.css +26 -26
- package/front_end/panels/security/originView.css +15 -15
- package/front_end/panels/sensors/locationsSettingsTab.css +6 -6
- package/front_end/panels/sensors/sensors.css +28 -28
- package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -2
- package/front_end/panels/settings/components/syncSection.css +5 -5
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +13 -13
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +16 -16
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +2 -2
- package/front_end/panels/settings/keybindsSettingsTab.css +2 -2
- package/front_end/panels/settings/settingsScreen.css +5 -5
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/breakpointEditDialog.css +9 -9
- package/front_end/panels/sources/breakpointsView.css +25 -25
- package/front_end/panels/sources/callStackSidebarPane.css +10 -10
- package/front_end/panels/sources/components/HeadersView.css +6 -6
- package/front_end/panels/sources/debuggerPausedMessage.css +4 -4
- package/front_end/panels/sources/dialog.css +2 -2
- package/front_end/panels/sources/navigatorTree.css +2 -2
- package/front_end/panels/sources/navigatorView.css +2 -2
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/sources/sourcesNavigator.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/sources/sourcesView.css +1 -1
- package/front_end/panels/sources/threadsSidebarPane.css +5 -5
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +8 -8
- package/front_end/panels/timeline/TimelineDetailsView.ts +9 -21
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -5
- package/front_end/panels/timeline/TimelineMiniMap.ts +3 -3
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +2 -6
- package/front_end/panels/timeline/components/CWVMetrics.ts +9 -10
- package/front_end/panels/timeline/components/DetailsView.ts +12 -16
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +13 -13
- package/front_end/panels/timeline/components/FieldSettingsDialog.ts +19 -19
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +7 -9
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +3 -3
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +13 -13
- package/front_end/panels/timeline/components/LiveMetricsView.ts +65 -65
- package/front_end/panels/timeline/components/MetricCard.ts +25 -25
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +22 -22
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +9 -9
- package/front_end/panels/timeline/components/OriginMap.ts +7 -7
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +19 -20
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/TimelineSummary.ts +2 -2
- package/front_end/panels/timeline/components/Utils.ts +2 -6
- package/front_end/panels/timeline/components/breadcrumbsUI.css +3 -3
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +13 -13
- package/front_end/panels/timeline/components/ignoreListSetting.css +3 -3
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -9
- package/front_end/panels/timeline/components/insights/Checklist.ts +2 -2
- package/front_end/panels/timeline/components/insights/Table.ts +1 -1
- package/front_end/panels/timeline/components/liveMetricsView.css +39 -39
- package/front_end/panels/timeline/components/metricCard.css +20 -20
- package/front_end/panels/timeline/components/networkRequestDetails.css +9 -9
- package/front_end/panels/timeline/components/networkRequestTooltip.css +14 -14
- package/front_end/panels/timeline/components/networkTrackWidget.css +2 -2
- package/front_end/panels/timeline/components/originMap.css +4 -4
- package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +5 -5
- package/front_end/panels/timeline/components/sidebarSingleInsightSet.css +1 -1
- package/front_end/panels/timeline/components/timelineSummary.css +4 -4
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -4
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +6 -6
- package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +1 -1
- package/front_end/panels/timeline/thirdPartyTreeView.css +5 -5
- package/front_end/panels/timeline/timeline-meta.ts +0 -6
- package/front_end/panels/timeline/timelineDetailsView.css +11 -11
- package/front_end/panels/timeline/timelinePanel.css +20 -20
- package/front_end/panels/timeline/timelineTreeView.css +8 -8
- package/front_end/panels/webauthn/webauthnPane.css +6 -6
- package/front_end/panels/whats_new/ReleaseNoteText.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +42 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +15 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +14 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +23 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js +77 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +16 -2
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +36 -1
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/Poller.ts +86 -6
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +22 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +6 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +30 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +14 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +19 -13
- 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/doubleRAF.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +3 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +15 -1
- package/front_end/third_party/web-vitals/package/package.json +1 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +9 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +36 -5
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +21 -15
- package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +16 -1
- package/front_end/third_party/web-vitals/rebuild.sh +3 -3
- package/front_end/ui/comments/CommentAnchorResolver.ts +109 -4
- package/front_end/ui/comments/CommentOverlayManager.ts +16 -32
- package/front_end/ui/comments/commentsOverlay.css +6 -5
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/adorners/adorner.css +6 -6
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/buttons/button.css +9 -9
- package/front_end/ui/components/buttons/floatingButton.css +2 -2
- package/front_end/ui/components/buttons/textButton.css +12 -12
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/dialog.css +1 -1
- package/front_end/ui/components/diff_view/diffView.css +3 -3
- package/front_end/ui/components/expandable_list/expandableList.css +9 -9
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +4 -0
- package/front_end/ui/components/icon_button/iconButton.css +2 -2
- package/front_end/ui/components/input/checkbox.css +8 -8
- package/front_end/ui/components/input/textInput.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/linkifier/linkifierImpl.css +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +2 -2
- package/front_end/ui/components/markdown_view/markdownView.css +7 -7
- package/front_end/ui/components/menus/menuGroup.css +2 -2
- package/front_end/ui/components/menus/menuItem.css +2 -2
- package/front_end/ui/components/menus/selectMenu.css +2 -2
- package/front_end/ui/components/menus/selectMenuButton.css +4 -4
- package/front_end/ui/components/panel_feedback/panelFeedback.css +15 -15
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +7 -7
- package/front_end/ui/components/report_view/report.css +3 -3
- package/front_end/ui/components/report_view/reportSectionDivider.css +1 -1
- package/front_end/ui/components/report_view/reportValue.css +1 -1
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/settings/settingCheckbox.css +6 -6
- package/front_end/ui/components/text_editor/TextEditor.ts +3 -1
- package/front_end/ui/components/text_editor/config.ts +16 -4
- package/front_end/ui/kit/icons/icon.css +4 -4
- package/front_end/ui/kit/link/link.css +1 -1
- package/front_end/ui/legacy/ActionRegistration.ts +23 -23
- package/front_end/ui/legacy/Dialog.ts +1 -1
- package/front_end/ui/legacy/DockController.ts +7 -4
- package/front_end/ui/legacy/EmptyWidget.ts +13 -34
- package/front_end/ui/legacy/FilterBar.ts +4 -4
- package/front_end/ui/legacy/Infobar.ts +2 -2
- package/front_end/ui/legacy/InspectorDrawerView.ts +6 -6
- package/front_end/ui/legacy/InspectorView.ts +22 -27
- package/front_end/ui/legacy/KeyboardShortcut.ts +4 -7
- package/front_end/ui/legacy/ListWidget.ts +7 -7
- package/front_end/ui/legacy/PlusButton.ts +1 -3
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +6 -6
- package/front_end/ui/legacy/SearchableView.ts +18 -17
- package/front_end/ui/legacy/ShortcutRegistry.ts +6 -3
- package/front_end/ui/legacy/SoftContextMenu.ts +8 -8
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +10 -10
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/Toolbar.ts +5 -5
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +90 -26
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/ViewRegistration.ts +7 -7
- package/front_end/ui/legacy/Widget.ts +5 -5
- package/front_end/ui/legacy/checkboxTextLabel.css +3 -3
- package/front_end/ui/legacy/components/color_picker/ColorFormatSpec.ts +16 -0
- package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -0
- package/front_end/ui/legacy/components/color_picker/spectrum.css +90 -90
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +23 -24
- package/front_end/ui/legacy/components/cookie_table/cookiesTable.css +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +26 -28
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +3 -7
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +13 -13
- package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +7 -7
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +5 -5
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +18 -18
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +104 -86
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -6
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +4 -4
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +2 -2
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +28 -11
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -15
- package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/NetworkPriorities.ts +5 -5
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +5 -5
- package/front_end/ui/legacy/components/perf_ui/PieChart.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +0 -4
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +4 -4
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +7 -7
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -11
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +4 -6
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/timelineGrid.css +5 -5
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +3 -3
- package/front_end/ui/legacy/components/source_frame/FontView.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +13 -13
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +15 -18
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/jsonView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/resourceSourceFrame.css +1 -1
- package/front_end/ui/legacy/components/source_frame/source_frame-meta.ts +10 -10
- package/front_end/ui/legacy/components/source_frame/xmlTree.css +3 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/components/utils/jsUtils.css +10 -10
- package/front_end/ui/legacy/dropTarget.css +2 -2
- package/front_end/ui/legacy/emptyWidget.css +6 -0
- package/front_end/ui/legacy/filter.css +19 -19
- package/front_end/ui/legacy/infobar.css +2 -2
- package/front_end/ui/legacy/inspectorCommon.css +67 -67
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +5 -5
- package/front_end/ui/legacy/progressIndicator.css +4 -4
- package/front_end/ui/legacy/reportView.css +7 -7
- package/front_end/ui/legacy/searchableView.css +5 -5
- package/front_end/ui/legacy/smallBubble.css +3 -3
- package/front_end/ui/legacy/softContextMenu.css +4 -4
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/splitWidget.css +9 -31
- package/front_end/ui/legacy/suggestBox.css +4 -4
- package/front_end/ui/legacy/tabbedPane.css +17 -17
- package/front_end/ui/legacy/textPrompt.css +2 -2
- package/front_end/ui/legacy/toolbar.css +4 -4
- package/front_end/ui/legacy/treeoutline.css +14 -14
- package/front_end/ui/legacy/viewContainers.css +6 -6
- package/front_end/ui/settings/ConsoleSettings.ts +66 -0
- package/front_end/ui/settings/MainSettings.ts +47 -0
- package/front_end/ui/settings/settings.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
- package/inspector_overlay/common.ts +12 -12
- package/inspector_overlay/css_grid_label_helpers.ts +16 -17
- package/inspector_overlay/drag_resize_handler.ts +2 -2
- package/inspector_overlay/highlight_common.ts +11 -13
- package/inspector_overlay/highlight_container_query.ts +2 -2
- package/inspector_overlay/highlight_flex_common.ts +6 -7
- package/inspector_overlay/highlight_grid_common.ts +3 -3
- package/inspector_overlay/highlight_isolated_element.ts +12 -3
- package/inspector_overlay/highlight_scroll_snap.ts +2 -2
- package/inspector_overlay/loadCSS.rollup.js +0 -1
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +13 -13
- package/inspector_overlay/tool_green_dev_anchors.ts +3 -3
- package/inspector_overlay/tool_highlight.ts +9 -9
- package/inspector_overlay/tool_paused.ts +4 -4
- package/inspector_overlay/tool_persistent.ts +11 -11
- package/inspector_overlay/tool_screenshot.ts +7 -7
- package/inspector_overlay/tool_source_order.ts +4 -4
- package/inspector_overlay/tool_viewport_size.ts +3 -3
- package/inspector_overlay/tool_window_controls.ts +4 -4
- package/mcp/mcp.ts +1 -0
- package/package.json +2 -2
- package/front_end/generated/protocol-tsconfig.json +0 -10
- package/front_end/panels/js_timeline/DIR_METADATA +0 -3
- package/front_end/panels/js_timeline/js_timeline-meta.ts +0 -193
- package/front_end/panels/js_timeline/js_timeline.ts +0 -1
- /package/front_end/entrypoints/{formatter_worker/FormatterActions.ts → formatter_actions/formatter_actions.ts} +0 -0
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
5
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
+
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import type * as Protocol from '../../generated/protocol.js';
|
|
6
9
|
|
|
7
10
|
import {AccessibilitySubPane} from './AccessibilitySubPane.js';
|
|
8
11
|
|
|
@@ -10,16 +13,697 @@ const UIStrings = {
|
|
|
10
13
|
/**
|
|
11
14
|
* @description Title for the ARIA-Live and JS announcements recording tool
|
|
12
15
|
*/
|
|
13
|
-
ariaLiveRecording: '
|
|
16
|
+
ariaLiveRecording: 'Announcements recording',
|
|
14
17
|
} as const;
|
|
15
18
|
const str_ = i18n.i18n.registerUIStrings('panels/accessibility/AccessibilityAnnouncementRecordingView.ts', UIStrings);
|
|
16
19
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
17
20
|
|
|
18
|
-
export
|
|
21
|
+
export const BINDING_NAME = '__announcementsRecorderBinding';
|
|
22
|
+
|
|
23
|
+
export const enum AnnouncementApi {
|
|
24
|
+
ARIA_LIVE = 'aria-live',
|
|
25
|
+
JS_TRIGGERED = 'js-triggered',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare global {
|
|
29
|
+
interface Window {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
31
|
+
__announcementsRecorderBinding?: (payload: string) => void;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
33
|
+
__announcementsRecorderBinding_loaded?: boolean;
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
35
|
+
__announcementsRecorderBinding_cleanup?: () => void;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface A11yAnnouncement {
|
|
40
|
+
api: AnnouncementApi;
|
|
41
|
+
message: string;
|
|
42
|
+
politeness: string;
|
|
43
|
+
element: string;
|
|
44
|
+
elementId?: string;
|
|
45
|
+
stack?: string;
|
|
46
|
+
target?: SDK.Target.Target;
|
|
47
|
+
time: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function injectedScript(ariaLiveApi: string, jsTriggeredApi: string): void {
|
|
51
|
+
// Prevent duplicate script evaluation if already injected.
|
|
52
|
+
if (window.__announcementsRecorderBinding_loaded) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Assigns a unique tracking identifier using an in-memory WeakMap (does not mutate DOM elements).
|
|
57
|
+
const elementIdMap = new WeakMap<Element, string>();
|
|
58
|
+
let recordIdCounter = 0;
|
|
59
|
+
function getOrCreateRecordId(element: Element|null|undefined): string {
|
|
60
|
+
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
|
61
|
+
return '';
|
|
62
|
+
}
|
|
63
|
+
let id = elementIdMap.get(element);
|
|
64
|
+
if (!id) {
|
|
65
|
+
recordIdCounter++;
|
|
66
|
+
id = String(recordIdCounter);
|
|
67
|
+
elementIdMap.set(element, id);
|
|
68
|
+
}
|
|
69
|
+
return id;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Traverses to parent element or across shadow root boundary to host element.
|
|
73
|
+
function getParentOrHost(node: Node|null|undefined): Element|null {
|
|
74
|
+
if (!node) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
if (node.parentElement) {
|
|
78
|
+
return node.parentElement;
|
|
79
|
+
}
|
|
80
|
+
const root = node.getRootNode();
|
|
81
|
+
if (root && root !== node && root instanceof ShadowRoot) {
|
|
82
|
+
return root.host;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Checks whether an element is visible to accessibility tree (opacity and CSS visibility).
|
|
88
|
+
function checkVisibility(element: Element|null|undefined): boolean {
|
|
89
|
+
if (!element) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
return element.checkVisibility({
|
|
94
|
+
checkOpacity: true,
|
|
95
|
+
checkVisibilityCSS: true,
|
|
96
|
+
});
|
|
97
|
+
} catch {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Checks if any ancestor element is hidden via aria-hidden="true" or CSS visibility across shadow boundaries.
|
|
103
|
+
function isAncestorHidden(element: Element|null|undefined): boolean {
|
|
104
|
+
let current = getParentOrHost(element);
|
|
105
|
+
while (current) {
|
|
106
|
+
if (current.getAttribute('aria-hidden') === 'true') {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
if (!checkVisibility(current)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
current = getParentOrHost(current);
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Intercepts programmatic JS announcements by wrapping ariaNotify on the given prototype.
|
|
118
|
+
function patchAriaNotify(proto: object, name: string): ((...args: unknown[]) => unknown)|undefined {
|
|
119
|
+
if (!proto || typeof proto !== 'object') {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
if (!Object.isExtensible(proto) || Object.isFrozen(proto) || Object.isSealed(proto)) {
|
|
123
|
+
throw new TypeError('Prototype object is non-extensible, frozen, or sealed');
|
|
124
|
+
}
|
|
125
|
+
const desc = Object.getOwnPropertyDescriptor(proto, name);
|
|
126
|
+
if (desc && (!desc.writable && !desc.set)) {
|
|
127
|
+
throw new TypeError('Property ' + name + ' is read-only');
|
|
128
|
+
}
|
|
129
|
+
const protoRecord = proto as Record<string, unknown>;
|
|
130
|
+
const original = protoRecord[name] as ((...args: unknown[]) => unknown) | undefined;
|
|
131
|
+
const wrapped = function(this: Element|Document, message?: string, options?: {politeness?: string}): unknown {
|
|
132
|
+
const bindingFn = window.__announcementsRecorderBinding;
|
|
133
|
+
if (typeof bindingFn === 'function') {
|
|
134
|
+
try {
|
|
135
|
+
const announcement = {
|
|
136
|
+
api: jsTriggeredApi,
|
|
137
|
+
message: String(message || ''),
|
|
138
|
+
politeness: (options && options.politeness) || 'polite',
|
|
139
|
+
elementId: getOrCreateRecordId(this as Element),
|
|
140
|
+
element: (this as Element).outerHTML || (this as Node).nodeName,
|
|
141
|
+
stack: new Error().stack || '',
|
|
142
|
+
time: Date.now(),
|
|
143
|
+
};
|
|
144
|
+
bindingFn(JSON.stringify(announcement));
|
|
145
|
+
} catch {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (typeof original === 'function') {
|
|
149
|
+
return original.apply(this, arguments as unknown as unknown[]);
|
|
150
|
+
}
|
|
151
|
+
return undefined;
|
|
152
|
+
};
|
|
153
|
+
Object.defineProperty(proto, name, {
|
|
154
|
+
value: wrapped,
|
|
155
|
+
writable: true,
|
|
156
|
+
configurable: true,
|
|
157
|
+
enumerable: desc ? desc.enumerable : false,
|
|
158
|
+
});
|
|
159
|
+
if (protoRecord[name] !== wrapped) {
|
|
160
|
+
throw new TypeError('Failed to override ' + name + ' on prototype');
|
|
161
|
+
}
|
|
162
|
+
return original;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Wrap ariaNotify on prototypes inside isolated try/catch so failure doesn't block MutationObserver.
|
|
166
|
+
let originalElementAriaNotify: ((...args: unknown[]) => unknown)|undefined;
|
|
167
|
+
let originalDocumentAriaNotify: ((...args: unknown[]) => unknown)|undefined;
|
|
168
|
+
let originalAttachShadow: ((init: ShadowRootInit) => ShadowRoot)|undefined;
|
|
169
|
+
|
|
170
|
+
try {
|
|
171
|
+
originalElementAriaNotify = patchAriaNotify(Element.prototype, 'ariaNotify');
|
|
172
|
+
originalDocumentAriaNotify = patchAriaNotify(Document.prototype, 'ariaNotify');
|
|
173
|
+
} catch (e: unknown) {
|
|
174
|
+
const bindingFn = window.__announcementsRecorderBinding;
|
|
175
|
+
if (typeof bindingFn === 'function') {
|
|
176
|
+
try {
|
|
177
|
+
const error = e as {message?: string};
|
|
178
|
+
bindingFn(JSON.stringify({
|
|
179
|
+
api: 'blocked',
|
|
180
|
+
reason: error && error.message ? String(error.message) : String(e),
|
|
181
|
+
}));
|
|
182
|
+
} catch {
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Derives politeness from explicit aria-live attribute or implicit ARIA roles.
|
|
188
|
+
function derivePoliteness(element: Element): string {
|
|
189
|
+
const explicit = element.getAttribute('aria-live');
|
|
190
|
+
if (explicit) {
|
|
191
|
+
return explicit;
|
|
192
|
+
}
|
|
193
|
+
const role = element.getAttribute('role');
|
|
194
|
+
if (role === 'status' || role === 'log') {
|
|
195
|
+
return 'polite';
|
|
196
|
+
}
|
|
197
|
+
if (role === 'alert') {
|
|
198
|
+
return 'assertive';
|
|
199
|
+
}
|
|
200
|
+
return 'off';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
let lastRecordedId: string|null = null;
|
|
204
|
+
let lastRecordedText: string|null = null;
|
|
205
|
+
let lastRecordedPoliteness: string|null = null;
|
|
206
|
+
let lastRecordedTime = 0;
|
|
207
|
+
|
|
208
|
+
// Emits an announcement payload for an active live region node via the CDP binding.
|
|
209
|
+
function recordLiveNode(node: Node|null|undefined): void {
|
|
210
|
+
if (!node || node.nodeType !== Node.ELEMENT_NODE) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const element = node as Element;
|
|
214
|
+
const politeness = derivePoliteness(element);
|
|
215
|
+
if (politeness === 'off') {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (element.getAttribute('aria-hidden') === 'true') {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (!checkVisibility(element)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (isAncestorHidden(element)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const text = (element.textContent || '').trim();
|
|
228
|
+
if (!text) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const elementId = getOrCreateRecordId(element);
|
|
232
|
+
const now = Date.now();
|
|
233
|
+
// Debounce duplicate announcements on the same element within 50ms.
|
|
234
|
+
if (lastRecordedId === elementId && lastRecordedText === text && lastRecordedPoliteness === politeness &&
|
|
235
|
+
(now - lastRecordedTime) < 50) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
lastRecordedId = elementId;
|
|
239
|
+
lastRecordedText = text;
|
|
240
|
+
lastRecordedPoliteness = politeness;
|
|
241
|
+
lastRecordedTime = now;
|
|
242
|
+
|
|
243
|
+
const bindingFn = window.__announcementsRecorderBinding;
|
|
244
|
+
if (typeof bindingFn === 'function') {
|
|
245
|
+
try {
|
|
246
|
+
const announcement = {
|
|
247
|
+
api: ariaLiveApi,
|
|
248
|
+
message: text,
|
|
249
|
+
politeness,
|
|
250
|
+
elementId,
|
|
251
|
+
element: element.outerHTML || element.nodeName,
|
|
252
|
+
time: now,
|
|
253
|
+
};
|
|
254
|
+
bindingFn(JSON.stringify(announcement));
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Selector targeting live regions and standard ARIA roles with live semantics.
|
|
261
|
+
const selector = '[aria-live], [role="status"], [role="alert"], [role="log"]';
|
|
262
|
+
|
|
263
|
+
function findLiveParent(node: Node|null|undefined): Element|null {
|
|
264
|
+
let current: Node|null|undefined = node;
|
|
265
|
+
while (current) {
|
|
266
|
+
if (current.nodeType === Node.ELEMENT_NODE) {
|
|
267
|
+
const el = current as Element;
|
|
268
|
+
if (el.matches && el.matches(selector)) {
|
|
269
|
+
return el;
|
|
270
|
+
}
|
|
271
|
+
if (el.closest) {
|
|
272
|
+
const match = el.closest(selector);
|
|
273
|
+
if (match) {
|
|
274
|
+
return match;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
current = getParentOrHost(current);
|
|
279
|
+
}
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const observer = new MutationObserver((mutations: MutationRecord[]) => {
|
|
284
|
+
for (const mutation of mutations) {
|
|
285
|
+
if (mutation.type === 'childList') {
|
|
286
|
+
const target = mutation.target;
|
|
287
|
+
if (target && target.nodeType === Node.ELEMENT_NODE) {
|
|
288
|
+
const liveParent = findLiveParent(target);
|
|
289
|
+
if (liveParent) {
|
|
290
|
+
recordLiveNode(liveParent);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
for (const node of mutation.addedNodes) {
|
|
294
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
295
|
+
const el = node as Element;
|
|
296
|
+
if (el.shadowRoot) {
|
|
297
|
+
observeSubtree(el.shadowRoot);
|
|
298
|
+
scanAndObserveShadowRoots(el.shadowRoot);
|
|
299
|
+
}
|
|
300
|
+
scanAndObserveShadowRoots(el);
|
|
301
|
+
|
|
302
|
+
if (el.matches && el.matches(selector)) {
|
|
303
|
+
recordLiveNode(el);
|
|
304
|
+
}
|
|
305
|
+
const children = el.querySelectorAll ? el.querySelectorAll(selector) : [];
|
|
306
|
+
for (const child of children) {
|
|
307
|
+
recordLiveNode(child);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
} else if (mutation.type === 'characterData') {
|
|
312
|
+
const parent = mutation.target.parentElement || getParentOrHost(mutation.target);
|
|
313
|
+
if (parent) {
|
|
314
|
+
const liveParent = findLiveParent(parent);
|
|
315
|
+
if (liveParent) {
|
|
316
|
+
recordLiveNode(liveParent);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
} else if (mutation.type === 'attributes') {
|
|
320
|
+
// Only record attribute mutations if the mutated element itself is a live region.
|
|
321
|
+
const target = mutation.target;
|
|
322
|
+
if (target && target.nodeType === Node.ELEMENT_NODE) {
|
|
323
|
+
const liveTarget = findLiveParent(target);
|
|
324
|
+
if (liveTarget) {
|
|
325
|
+
recordLiveNode(liveTarget);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
const observedRoots = new WeakSet<Node>();
|
|
333
|
+
|
|
334
|
+
function observeSubtree(root: Node|null|undefined): void {
|
|
335
|
+
if (!root || observedRoots.has(root)) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
try {
|
|
339
|
+
observer.observe(root, {
|
|
340
|
+
childList: true,
|
|
341
|
+
subtree: true,
|
|
342
|
+
characterData: true,
|
|
343
|
+
attributes: true,
|
|
344
|
+
attributeFilter: ['aria-live', 'aria-hidden', 'hidden', 'style', 'class', 'role'],
|
|
345
|
+
});
|
|
346
|
+
observedRoots.add(root);
|
|
347
|
+
} catch {
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function scanAndObserveShadowRoots(node: Node|null|undefined): void {
|
|
352
|
+
if (!node) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
356
|
+
const el = node as Element;
|
|
357
|
+
if (el.shadowRoot) {
|
|
358
|
+
observeSubtree(el.shadowRoot);
|
|
359
|
+
scanAndObserveShadowRoots(el.shadowRoot);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const children = (node as Element).children || [];
|
|
363
|
+
for (let i = 0; i < children.length; i++) {
|
|
364
|
+
scanAndObserveShadowRoots(children[i]);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const rootNode = document.body || document.documentElement;
|
|
369
|
+
if (rootNode) {
|
|
370
|
+
observeSubtree(rootNode);
|
|
371
|
+
scanAndObserveShadowRoots(rootNode);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Intercept attachShadow to automatically observe dynamically created open shadow roots.
|
|
375
|
+
try {
|
|
376
|
+
const origAttachShadow = Element.prototype.attachShadow;
|
|
377
|
+
if (typeof origAttachShadow === 'function') {
|
|
378
|
+
originalAttachShadow = origAttachShadow;
|
|
379
|
+
Element.prototype.attachShadow = function(this: Element, init: ShadowRootInit): ShadowRoot {
|
|
380
|
+
const shadow = origAttachShadow.apply(this, [init]);
|
|
381
|
+
if (init && init.mode === 'open') {
|
|
382
|
+
observeSubtree(shadow);
|
|
383
|
+
}
|
|
384
|
+
return shadow;
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
} catch {
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
window.__announcementsRecorderBinding_loaded = true;
|
|
391
|
+
|
|
392
|
+
// Registers cleanup function invoked during recording teardown.
|
|
393
|
+
window.__announcementsRecorderBinding_cleanup = function(): void {
|
|
394
|
+
observer.disconnect();
|
|
395
|
+
if (originalElementAriaNotify) {
|
|
396
|
+
try {
|
|
397
|
+
(Element.prototype as unknown as Record<string, unknown>)['ariaNotify'] = originalElementAriaNotify;
|
|
398
|
+
} catch {
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (originalDocumentAriaNotify) {
|
|
402
|
+
try {
|
|
403
|
+
(Document.prototype as unknown as Record<string, unknown>)['ariaNotify'] = originalDocumentAriaNotify;
|
|
404
|
+
} catch {
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if (originalAttachShadow) {
|
|
408
|
+
try {
|
|
409
|
+
Element.prototype.attachShadow = originalAttachShadow;
|
|
410
|
+
} catch {
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
delete window.__announcementsRecorderBinding_loaded;
|
|
414
|
+
delete window.__announcementsRecorderBinding_cleanup;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export function teardownScript(): void {
|
|
419
|
+
if (typeof window.__announcementsRecorderBinding_cleanup === 'function') {
|
|
420
|
+
window.__announcementsRecorderBinding_cleanup();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export const INJECTED_SCRIPT_SOURCE = `(${injectedScript.toString()})(${JSON.stringify(AnnouncementApi.ARIA_LIVE)}, ${
|
|
425
|
+
JSON.stringify(AnnouncementApi.JS_TRIGGERED)});`;
|
|
426
|
+
|
|
427
|
+
export const TEARDOWN_SCRIPT_SOURCE = `(${teardownScript.toString()})();`;
|
|
428
|
+
|
|
429
|
+
export function checkForBlockedPayload(payload: unknown): string|null {
|
|
430
|
+
if (typeof payload !== 'string') {
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
try {
|
|
434
|
+
const parsed = JSON.parse(payload);
|
|
435
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed) && parsed.api === 'blocked') {
|
|
436
|
+
return typeof parsed.reason === 'string' ? parsed.reason : '';
|
|
437
|
+
}
|
|
438
|
+
} catch {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
return null;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export function validateAndSanitizeAnnouncement(payload: unknown): A11yAnnouncement|null {
|
|
445
|
+
if (typeof payload !== 'string') {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
let parsed: unknown;
|
|
450
|
+
try {
|
|
451
|
+
parsed = JSON.parse(payload);
|
|
452
|
+
} catch {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const parsedObj = parsed as {
|
|
461
|
+
api?: unknown,
|
|
462
|
+
message?: unknown,
|
|
463
|
+
politeness?: unknown,
|
|
464
|
+
element?: unknown,
|
|
465
|
+
time?: unknown,
|
|
466
|
+
elementId?: unknown,
|
|
467
|
+
stack?: unknown,
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
if (parsedObj.api !== AnnouncementApi.ARIA_LIVE && parsedObj.api !== AnnouncementApi.JS_TRIGGERED) {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (typeof parsedObj.message !== 'string') {
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (typeof parsedObj.politeness !== 'string') {
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (typeof parsedObj.element !== 'string') {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (typeof parsedObj.time !== 'number' || !Number.isFinite(parsedObj.time)) {
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
let elementId: string|undefined = undefined;
|
|
491
|
+
if ('elementId' in parsedObj) {
|
|
492
|
+
if (typeof parsedObj.elementId !== 'string') {
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
elementId = parsedObj.elementId;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
let stack: string|undefined = undefined;
|
|
499
|
+
if ('stack' in parsedObj) {
|
|
500
|
+
if (typeof parsedObj.stack !== 'string') {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
stack = parsedObj.stack;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return {
|
|
507
|
+
api: parsedObj.api as AnnouncementApi,
|
|
508
|
+
message: parsedObj.message,
|
|
509
|
+
politeness: parsedObj.politeness,
|
|
510
|
+
element: parsedObj.element,
|
|
511
|
+
...(elementId !== undefined ? {elementId} : {}),
|
|
512
|
+
...(stack !== undefined ? {stack} : {}),
|
|
513
|
+
time: parsedObj.time,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export class AccessibilityAnnouncementRecordingView extends AccessibilitySubPane implements SDK.TargetManager.Observer {
|
|
518
|
+
#announcements: A11yAnnouncement[] = [];
|
|
519
|
+
#isRecording = false;
|
|
520
|
+
#blockedTargets = new Map<SDK.Target.Target, string>();
|
|
521
|
+
#scriptIdentifiers = new Map<SDK.Target.Target, Protocol.Page.ScriptIdentifier>();
|
|
522
|
+
#targets = new Set<SDK.Target.Target>();
|
|
523
|
+
#enabledTargets = new Set<SDK.Target.Target>();
|
|
524
|
+
|
|
19
525
|
constructor() {
|
|
20
526
|
super({
|
|
21
527
|
title: i18nString(UIStrings.ariaLiveRecording),
|
|
22
528
|
viewId: 'aria-live-recording',
|
|
23
529
|
});
|
|
530
|
+
SDK.TargetManager.TargetManager.instance().observeTargets(this, {scoped: true});
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
override wasShown(): void {
|
|
534
|
+
super.wasShown();
|
|
535
|
+
this.requestUpdate();
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
async targetAdded(target: SDK.Target.Target): Promise<void> {
|
|
539
|
+
if (target.type() !== SDK.Target.Type.FRAME || this.#targets.has(target)) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
this.#targets.add(target);
|
|
543
|
+
if (this.#isRecording) {
|
|
544
|
+
await this.#enableTarget(target);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
async targetRemoved(target: SDK.Target.Target): Promise<void> {
|
|
549
|
+
this.#targets.delete(target);
|
|
550
|
+
this.#blockedTargets.delete(target);
|
|
551
|
+
await this.#disableTarget(target);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
async #enableTarget(target: SDK.Target.Target): Promise<void> {
|
|
555
|
+
if (this.#enabledTargets.has(target)) {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
this.#enabledTargets.add(target);
|
|
559
|
+
const runtimeModel = target.model(SDK.RuntimeModel.RuntimeModel);
|
|
560
|
+
if (!runtimeModel) {
|
|
561
|
+
this.#enabledTargets.delete(target);
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
runtimeModel.addEventListener(SDK.RuntimeModel.Events.BindingCalled, this.#onBindingCalled, this);
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
await runtimeModel.addBinding({
|
|
568
|
+
name: BINDING_NAME,
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
const pageAgent = target.pageAgent();
|
|
572
|
+
const {identifier} = await pageAgent.invoke_addScriptToEvaluateOnNewDocument({
|
|
573
|
+
source: INJECTED_SCRIPT_SOURCE,
|
|
574
|
+
runImmediately: true,
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
if (!this.#enabledTargets.has(target)) {
|
|
578
|
+
try {
|
|
579
|
+
await pageAgent.invoke_removeScriptToEvaluateOnNewDocument({identifier});
|
|
580
|
+
} catch {
|
|
581
|
+
}
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
this.#scriptIdentifiers.set(target, identifier);
|
|
585
|
+
} catch {
|
|
586
|
+
await this.#disableTarget(target);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
#handleRecordingBlocked(target: SDK.Target.Target|null, blockedReason: string): void {
|
|
591
|
+
if (target) {
|
|
592
|
+
this.#blockedTargets.set(target, blockedReason);
|
|
593
|
+
}
|
|
594
|
+
this.requestUpdate();
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
async #disableTarget(target: SDK.Target.Target): Promise<void> {
|
|
598
|
+
if (!this.#enabledTargets.has(target)) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
this.#enabledTargets.delete(target);
|
|
602
|
+
const runtimeModel = target.model(SDK.RuntimeModel.RuntimeModel);
|
|
603
|
+
if (runtimeModel) {
|
|
604
|
+
runtimeModel.removeEventListener(SDK.RuntimeModel.Events.BindingCalled, this.#onBindingCalled, this);
|
|
605
|
+
try {
|
|
606
|
+
await runtimeModel.removeBinding({
|
|
607
|
+
name: BINDING_NAME,
|
|
608
|
+
});
|
|
609
|
+
} catch {
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
const identifier = this.#scriptIdentifiers.get(target);
|
|
613
|
+
if (identifier) {
|
|
614
|
+
try {
|
|
615
|
+
await target.pageAgent().invoke_removeScriptToEvaluateOnNewDocument({
|
|
616
|
+
identifier,
|
|
617
|
+
});
|
|
618
|
+
} catch {
|
|
619
|
+
}
|
|
620
|
+
this.#scriptIdentifiers.delete(target);
|
|
621
|
+
}
|
|
622
|
+
try {
|
|
623
|
+
const runtimeAgent = target.runtimeAgent();
|
|
624
|
+
await runtimeAgent.invoke_evaluate({
|
|
625
|
+
expression: TEARDOWN_SCRIPT_SOURCE,
|
|
626
|
+
userGesture: false,
|
|
627
|
+
awaitPromise: false,
|
|
628
|
+
});
|
|
629
|
+
} catch {
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
#onBindingCalled(event: Common.EventTarget
|
|
634
|
+
.EventTargetEvent<SDK.RuntimeModel.EventTypes[SDK.RuntimeModel.Events.BindingCalled]>): void {
|
|
635
|
+
const {name, payload} = event.data;
|
|
636
|
+
if (!this.#isRecording) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (name !== BINDING_NAME) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const runtimeModel = event.source instanceof SDK.RuntimeModel.RuntimeModel ? event.source : null;
|
|
643
|
+
const target = runtimeModel?.target() ?? null;
|
|
644
|
+
const blockedReason = checkForBlockedPayload(payload);
|
|
645
|
+
if (blockedReason !== null) {
|
|
646
|
+
this.#handleRecordingBlocked(target, blockedReason);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const announcement = validateAndSanitizeAnnouncement(payload);
|
|
650
|
+
if (!announcement) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (target) {
|
|
654
|
+
announcement.target = target;
|
|
655
|
+
}
|
|
656
|
+
const last = this.#announcements[this.#announcements.length - 1];
|
|
657
|
+
if (last && last.api === announcement.api && last.message === announcement.message &&
|
|
658
|
+
last.politeness === announcement.politeness && last.element === announcement.element &&
|
|
659
|
+
Math.abs(announcement.time - last.time) < 50) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
this.#announcements.push(announcement);
|
|
663
|
+
this.requestUpdate();
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
async startRecording(): Promise<void> {
|
|
667
|
+
if (this.#isRecording) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
this.#isRecording = true;
|
|
671
|
+
this.#blockedTargets.clear();
|
|
672
|
+
for (const target of this.#targets) {
|
|
673
|
+
await this.#enableTarget(target);
|
|
674
|
+
}
|
|
675
|
+
this.requestUpdate();
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
async stopRecording(): Promise<void> {
|
|
679
|
+
if (!this.#isRecording) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
this.#isRecording = false;
|
|
683
|
+
for (const target of this.#targets) {
|
|
684
|
+
await this.#disableTarget(target);
|
|
685
|
+
}
|
|
686
|
+
this.requestUpdate();
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
clearAnnouncements(): void {
|
|
690
|
+
this.#announcements = [];
|
|
691
|
+
this.requestUpdate();
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
announcementsForTest(): A11yAnnouncement[] {
|
|
695
|
+
return [...this.#announcements];
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
blockedReasonForTargetForTest(target: SDK.Target.Target): string|undefined {
|
|
699
|
+
return this.#blockedTargets.get(target);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
blockedTargetsForTest(): Map<SDK.Target.Target, string> {
|
|
703
|
+
return new Map(this.#blockedTargets);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
isRecordingForTest(): boolean {
|
|
707
|
+
return this.#isRecording;
|
|
24
708
|
}
|
|
25
709
|
}
|