chrome-devtools-frontend 1.0.1657110 → 1.0.1660788
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +125 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +15 -70
- package/.agents/skills/repro-flaky-tests/SKILL.md +53 -0
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +37 -18
- package/.agents/skills/version-control/SKILL.md +8 -1
- package/AUTHORS +1 -0
- package/SECURITY.md +3 -0
- package/docs/get_the_code.md +6 -0
- package/front_end/Images/src/ads.svg +1 -0
- package/front_end/Tests.js +6 -6
- package/front_end/core/common/Gzip.ts +12 -5
- package/front_end/core/common/ResourceType.ts +19 -19
- package/front_end/core/common/Revealer.ts +15 -15
- package/front_end/core/common/SettingRegistration.ts +19 -19
- package/front_end/core/host/AidaClient.ts +35 -9
- package/front_end/core/host/GdpClient.ts +10 -7
- package/front_end/core/platform/StringUtilities.ts +35 -0
- package/front_end/core/sdk/AccessibilityModel.snapshot.txt +17 -0
- package/front_end/core/sdk/AccessibilityModel.ts +132 -2
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -5
- package/front_end/core/sdk/CSSMetadata.ts +110 -16
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -5
- package/front_end/core/sdk/ConsoleModel.ts +5 -5
- package/front_end/core/sdk/DOMDebuggerModel.ts +5 -1
- package/front_end/core/sdk/DOMModel.ts +32 -18
- package/front_end/core/sdk/NetworkManager.ts +58 -14
- package/front_end/core/sdk/NetworkRequest.ts +37 -1
- package/front_end/core/sdk/OverlayModel.ts +45 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +6 -7
- package/front_end/core/sdk/ScreenCaptureModel.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +17 -13
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +4 -2
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -5
- package/front_end/core/sdk/TargetManager.ts +10 -1
- package/front_end/core/sdk/TraceObject.ts +4 -2
- package/front_end/core/sdk/sdk-meta.ts +170 -0
- package/front_end/design_system_tokens.css +0 -5
- package/front_end/entrypoints/devtools_app/devtools_app.ts +1 -1
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +13 -4
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +5 -2
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +23 -4
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +33 -10
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +8 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +4 -4
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -2
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +36 -37
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +15 -33
- package/front_end/entrypoints/js_app/js_app.ts +6 -5
- package/front_end/entrypoints/main/GlobalAiButton.ts +4 -4
- package/front_end/entrypoints/main/MainImpl.ts +25 -55
- package/front_end/entrypoints/main/main-meta.ts +50 -50
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +5 -5
- package/front_end/entrypoints/node_app/app/NodeMain.ts +3 -3
- package/front_end/entrypoints/node_app/node_app.ts +10 -9
- package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
- package/front_end/foundation/Universe.ts +76 -6
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/SupportedCSSProperties.js +19 -12
- package/front_end/generated/protocol.ts +7 -1
- package/front_end/models/ai_assistance/AiConversation.ts +19 -17
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +37 -14
- package/front_end/models/ai_assistance/AiUtils.ts +38 -42
- package/front_end/models/ai_assistance/agents/AiAgent.ts +5 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -1
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +270 -286
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +20 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +3 -1
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +3 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +3 -1
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +8 -5
- package/front_end/models/bindings/CompilerScriptMapping.ts +2 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +15 -16
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +6 -4
- package/front_end/models/bindings/FileUtils.ts +11 -12
- package/front_end/models/bindings/NetworkProject.ts +4 -0
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +2 -1
- package/front_end/models/bindings/ResourceUtils.ts +1 -1
- package/front_end/models/bindings/SASSSourceMapping.ts +8 -5
- package/front_end/models/emulation/DeviceModeModel.ts +14 -14
- package/front_end/models/emulation/EmulatedDevices.ts +392 -11
- package/front_end/models/extensions/ExtensionAPI.ts +6 -6
- package/front_end/models/extensions/LanguageExtensionEndpoint.ts +13 -12
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +1 -1
- package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +1 -1
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +7 -7
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +2 -2
- package/front_end/models/issues_manager/CookieIssue.ts +6 -7
- package/front_end/models/issues_manager/CorsIssue.ts +3 -3
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +2 -2
- package/front_end/models/issues_manager/DeprecationIssue.ts +3 -3
- package/front_end/models/issues_manager/EmailVerificationRequestIssue.ts +1 -1
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +1 -1
- package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +7 -7
- package/front_end/models/issues_manager/HeavyAdIssue.ts +3 -3
- package/front_end/models/issues_manager/Issue.ts +8 -8
- package/front_end/models/issues_manager/MixedContentIssue.ts +1 -1
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +3 -3
- package/front_end/models/issues_manager/QuirksModeIssue.ts +1 -1
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
- package/front_end/models/issues_manager/SelectivePermissionsInterventionIssue.ts +2 -2
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +2 -2
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +1 -1
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +3 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +5 -1
- package/front_end/models/stack_trace/StackTraceModel.ts +3 -3
- package/front_end/models/text_utils/ContentData.ts +27 -0
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +21 -5
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +29 -14
- package/front_end/models/web_mcp/WebMCPModel.ts +24 -6
- package/front_end/models/workspace/IgnoreListManager.ts +6 -6
- package/front_end/models/workspace/UISourceCode.ts +3 -3
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +23 -12
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -22
- package/front_end/panels/ai_assistance/ExportConversation.ts +3 -4
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +7 -0
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +2 -2
- package/front_end/panels/animation/AnimationTimeline.ts +17 -19
- package/front_end/panels/animation/AnimationUI.ts +5 -5
- package/front_end/panels/animation/animation-meta.ts +2 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +13 -4
- package/front_end/panels/application/BackgroundServiceView.ts +2 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -6
- package/front_end/panels/application/IndexedDBViews.ts +245 -262
- package/front_end/panels/application/OpenedWindowDetailsView.ts +1 -1
- package/front_end/panels/application/ResourcesPanel.ts +9 -2
- package/front_end/panels/application/ServiceWorkersView.ts +252 -211
- package/front_end/panels/application/StorageView.ts +97 -33
- package/front_end/panels/application/WebMCPView.ts +15 -1
- package/front_end/panels/application/components/AdsView.ts +1 -1
- package/front_end/panels/application/indexedDBViews.css +38 -9
- package/front_end/panels/application/preloading/helper/PreloadingForward.ts +2 -1
- package/front_end/panels/application/resourcesSidebar.css +5 -0
- package/front_end/panels/application/storageView.css +26 -9
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +5 -1
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +8 -6
- package/front_end/panels/common/DOMLinkifier.ts +1 -1
- package/front_end/panels/common/ExtensionServer.ts +119 -14
- package/front_end/panels/console/ConsoleContextSelector.ts +4 -4
- package/front_end/panels/console/ConsolePinPane.ts +12 -12
- package/front_end/panels/console/ConsolePrompt.ts +6 -6
- package/front_end/panels/console/ConsoleSidebar.ts +7 -7
- package/front_end/panels/console/ConsoleView.ts +45 -44
- package/front_end/panels/console/ConsoleViewMessage.ts +40 -40
- package/front_end/panels/console/SymbolizedErrorWidget.ts +2 -1
- package/front_end/panels/console/console-meta.ts +34 -34
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -2
- package/front_end/panels/coverage/CoverageListView.ts +28 -28
- package/front_end/panels/coverage/CoverageModel.ts +2 -1
- package/front_end/panels/coverage/CoverageView.ts +23 -23
- package/front_end/panels/coverage/coverage-meta.ts +5 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +36 -36
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +6 -6
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +6 -6
- package/front_end/panels/css_overview/css_overview-meta.ts +2 -2
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +20 -21
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +6 -8
- package/front_end/panels/developer_resources/developer_resources-meta.ts +2 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +8 -102
- package/front_end/panels/elements/AccessibilityTreeView.ts +163 -70
- package/front_end/panels/elements/ElementsPanel.ts +17 -11
- package/front_end/panels/elements/ElementsTreeElement.ts +49 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +4 -4
- package/front_end/panels/elements/LayoutPane.ts +1 -1
- package/front_end/panels/elements/MetricsSidebarPane.ts +100 -34
- package/front_end/panels/elements/StylePropertiesSection.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +7 -18
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +2 -2
- package/front_end/panels/elements/components/QueryContainer.ts +1 -1
- package/front_end/panels/issues/AffectedDirectivesView.ts +1 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -1
- package/front_end/panels/layer_viewer/LayerViewHost.ts +1 -1
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/EventTimelineView.ts +4 -4
- package/front_end/panels/media/MainView.ts +4 -4
- package/front_end/panels/media/PlayerDetailView.ts +5 -5
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/PlayerMessagesView.ts +12 -12
- package/front_end/panels/media/PlayerPropertiesView.ts +17 -17
- package/front_end/panels/network/NetworkDataGridNode.ts +124 -36
- package/front_end/panels/network/NetworkLogView.ts +11 -2
- package/front_end/panels/network/NetworkLogViewColumns.ts +18 -0
- package/front_end/panels/network/NetworkPanel.ts +2 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +53 -7
- package/front_end/panels/network/RequestPreviewView.ts +7 -1
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/network/forward/UIFilter.ts +1 -0
- package/front_end/panels/network/networkPanel.css +1 -0
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/network/requestPayloadView.css +10 -0
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +12 -12
- package/front_end/panels/performance_monitor/performance_monitor-meta.ts +7 -7
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +2 -2
- package/front_end/panels/profiler/HeapProfileView.ts +563 -51
- package/front_end/panels/profiler/HeapSnapshotView.ts +15 -9
- package/front_end/panels/profiler/ProfilesPanel.ts +13 -7
- package/front_end/panels/profiler/WritableProfileHeader.ts +152 -0
- package/front_end/panels/profiler/profiler.ts +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +10 -10
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +28 -32
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +15 -15
- package/front_end/panels/recorder/RecorderEvents.ts +8 -0
- package/front_end/panels/recorder/components/CreateRecordingView.ts +11 -11
- package/front_end/panels/recorder/components/ExtensionView.ts +74 -83
- package/front_end/panels/recorder/components/RecordingListView.ts +3 -3
- package/front_end/panels/recorder/components/RecordingView.ts +13 -10
- package/front_end/panels/recorder/components/ReplaySection.ts +9 -9
- package/front_end/panels/recorder/components/StepEditor.ts +352 -321
- package/front_end/panels/recorder/components/StepView.ts +36 -37
- package/front_end/panels/recorder/components/recordingView.css +1 -1
- package/front_end/panels/recorder/models/RecorderSettings.ts +2 -2
- package/front_end/panels/recorder/recorder-meta.ts +7 -7
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +12 -12
- package/front_end/panels/search/SearchResultsPane.ts +4 -4
- package/front_end/panels/search/SearchView.ts +20 -20
- package/front_end/panels/security/SecurityModel.ts +7 -7
- package/front_end/panels/security/SecurityPanel.ts +99 -107
- package/front_end/panels/security/SecurityPanelSidebar.ts +7 -7
- package/front_end/panels/security/security-meta.ts +2 -2
- package/front_end/panels/sensors/LocationsSettingsTab.ts +19 -19
- package/front_end/panels/sensors/SensorsView.ts +27 -27
- package/front_end/panels/sensors/sensors-meta.ts +13 -167
- package/front_end/panels/settings/AISettingsTab.ts +98 -56
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +20 -20
- package/front_end/panels/settings/KeybindsSettingsTab.ts +20 -21
- package/front_end/panels/settings/SettingsScreen.ts +11 -11
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +5 -5
- package/front_end/panels/settings/components/SyncSection.ts +12 -12
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +13 -13
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +31 -31
- package/front_end/panels/settings/emulation/emulation-meta.ts +1 -1
- package/front_end/panels/settings/settings-meta.ts +14 -14
- package/front_end/panels/sources/NavigatorView.ts +7 -6
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +83 -37
- package/front_end/panels/sources/SourcesNavigator.ts +20 -18
- package/front_end/panels/sources/SourcesView.ts +10 -1
- package/front_end/panels/sources/scopeChainSidebarPane.css +12 -4
- package/front_end/panels/sources/sources-meta.ts +4 -4
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -1
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +2 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +2 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +4 -2
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +4 -2
- package/front_end/panels/timeline/components/insights/ImageRef.ts +2 -1
- package/front_end/panels/utils/utils.ts +7 -3
- package/front_end/panels/web_audio/WebAudioView.ts +17 -18
- package/front_end/panels/web_audio/web_audio-meta.ts +3 -3
- package/front_end/panels/webauthn/WebauthnPane.ts +10 -10
- package/front_end/panels/whats_new/ReleaseNoteView.ts +1 -1
- package/front_end/panels/whats_new/whats_new-meta.ts +11 -11
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lit/lib/async-directive.d.ts +2 -1
- package/front_end/third_party/lit/lib/async-directive.js +1 -1
- package/front_end/third_party/lit/lib/async-directive.js.map +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +2 -1
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.d.ts +2 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.d.ts +2 -1
- package/front_end/third_party/lit/lib/directives.js +8 -8
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +2 -1
- package/front_end/third_party/lit/lib/lit.js +1 -1
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.d.ts +2 -1
- package/front_end/third_party/lit/lib/static-html.js +1 -1
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/package.json +2 -2
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/lit/src/async-directive.ts +5 -0
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -1
- package/front_end/ui/components/dialogs/shortcutDialog.css +15 -12
- package/front_end/ui/components/diff_view/DiffView.ts +2 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +5 -5
- package/front_end/ui/components/lists/List.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +5 -5
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/survey_link/SurveyLink.ts +3 -3
- package/front_end/ui/components/text_editor/config.ts +2 -2
- package/front_end/ui/components/tree_outline/TreeOutline.ts +34 -1
- package/front_end/ui/legacy/ReportView.ts +5 -0
- package/front_end/ui/legacy/Treeoutline.ts +18 -0
- package/front_end/ui/legacy/View.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -3
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +1 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +100 -36
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +7 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +5 -0
- package/front_end/ui/legacy/components/utils/ImagePreview.ts +4 -2
- package/front_end/ui/legacy/inspectorCommon.css +5 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +4 -0
- package/mcp/mcp.ts +2 -0
- package/package.json +4 -4
- package/front_end/panels/profiler/ProfileView.ts +0 -610
|
@@ -38,7 +38,7 @@ import {ParsedURL} from './ParsedURL.js';
|
|
|
38
38
|
|
|
39
39
|
const UIStrings = {
|
|
40
40
|
/**
|
|
41
|
-
* @description Text that appears in a tooltip the
|
|
41
|
+
* @description Text that appears in a tooltip for the Fetch and XHR resource types filter.
|
|
42
42
|
*/
|
|
43
43
|
fetchAndXHR: '`Fetch` and `XHR`',
|
|
44
44
|
/**
|
|
@@ -50,7 +50,7 @@ const UIStrings = {
|
|
|
50
50
|
*/
|
|
51
51
|
js: 'JS',
|
|
52
52
|
/**
|
|
53
|
-
* @description Text that appears on a button for the
|
|
53
|
+
* @description Text that appears on a button for the CSS resource type filter.
|
|
54
54
|
*/
|
|
55
55
|
css: 'CSS',
|
|
56
56
|
/**
|
|
@@ -70,7 +70,7 @@ const UIStrings = {
|
|
|
70
70
|
*/
|
|
71
71
|
doc: 'Doc',
|
|
72
72
|
/**
|
|
73
|
-
* @description Text that appears on a button for the
|
|
73
|
+
* @description Text that appears on a button for the WebSocket, WebTransport, and DirectSocket resource type filter.
|
|
74
74
|
*/
|
|
75
75
|
socketShort: 'Socket',
|
|
76
76
|
/**
|
|
@@ -86,67 +86,67 @@ const UIStrings = {
|
|
|
86
86
|
*/
|
|
87
87
|
manifest: 'Manifest',
|
|
88
88
|
/**
|
|
89
|
-
* @description Text for other types of items
|
|
89
|
+
* @description Text for other types of items.
|
|
90
90
|
*/
|
|
91
91
|
other: 'Other',
|
|
92
92
|
/**
|
|
93
|
-
* @description Name of a network resource type
|
|
93
|
+
* @description Name of a network resource type.
|
|
94
94
|
*/
|
|
95
95
|
document: 'Document',
|
|
96
96
|
/**
|
|
97
|
-
* @description Name of a network resource type
|
|
97
|
+
* @description Name of a network resource type.
|
|
98
98
|
*/
|
|
99
99
|
stylesheet: 'Stylesheet',
|
|
100
100
|
/**
|
|
101
|
-
* @description Text in Image
|
|
101
|
+
* @description Text in Image view of the Sources panel.
|
|
102
102
|
*/
|
|
103
103
|
image: 'Image',
|
|
104
104
|
/**
|
|
105
|
-
* @description Label for a group of JavaScript files
|
|
105
|
+
* @description Label for a group of JavaScript files.
|
|
106
106
|
*/
|
|
107
107
|
script: 'Script',
|
|
108
108
|
/**
|
|
109
|
-
* @description Name of a network resource type
|
|
109
|
+
* @description Name of a network resource type.
|
|
110
110
|
*/
|
|
111
111
|
texttrack: 'TextTrack',
|
|
112
112
|
/**
|
|
113
|
-
* @description Name of a network resource type
|
|
113
|
+
* @description Name of a network resource type.
|
|
114
114
|
*/
|
|
115
115
|
fetch: 'Fetch',
|
|
116
116
|
/**
|
|
117
|
-
* @description Name of a network resource type
|
|
117
|
+
* @description Name of a network resource type.
|
|
118
118
|
*/
|
|
119
119
|
eventsource: 'EventSource',
|
|
120
120
|
/**
|
|
121
|
-
* @description Name of a network resource type
|
|
121
|
+
* @description Name of a network resource type.
|
|
122
122
|
*/
|
|
123
123
|
websocket: 'WebSocket',
|
|
124
124
|
/**
|
|
125
|
-
* @description Name of a network resource type
|
|
125
|
+
* @description Name of a network resource type.
|
|
126
126
|
*/
|
|
127
127
|
webtransport: 'WebTransport',
|
|
128
128
|
/**
|
|
129
|
-
* @description Name of a network resource type
|
|
129
|
+
* @description Name of a network resource type.
|
|
130
130
|
*/
|
|
131
131
|
directsocket: 'DirectSocket',
|
|
132
132
|
/**
|
|
133
|
-
* @description Name of a network resource type
|
|
133
|
+
* @description Name of a network resource type.
|
|
134
134
|
*/
|
|
135
135
|
signedexchange: 'SignedExchange',
|
|
136
136
|
/**
|
|
137
|
-
* @description Name of a network resource type
|
|
137
|
+
* @description Name of a network resource type.
|
|
138
138
|
*/
|
|
139
139
|
ping: 'Ping',
|
|
140
140
|
/**
|
|
141
|
-
* @description Name of a network resource type
|
|
141
|
+
* @description Name of a network resource type.
|
|
142
142
|
*/
|
|
143
143
|
cspviolationreport: 'CSPViolationReport',
|
|
144
144
|
/**
|
|
145
|
-
* @description Name of a network initiator type
|
|
145
|
+
* @description Name of a network initiator type.
|
|
146
146
|
*/
|
|
147
147
|
preflight: 'Preflight',
|
|
148
148
|
/**
|
|
149
|
-
* @description Name of a network initiator type for FedCM requests
|
|
149
|
+
* @description Name of a network initiator type for FedCM requests.
|
|
150
150
|
*/
|
|
151
151
|
fedcm: 'FedCM',
|
|
152
152
|
} as const;
|
|
@@ -7,55 +7,55 @@ import type * as Platform from '../platform/platform.js';
|
|
|
7
7
|
|
|
8
8
|
const UIStrings = {
|
|
9
9
|
/**
|
|
10
|
-
* @description The UI destination when right
|
|
10
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
11
11
|
*/
|
|
12
12
|
elementsPanel: 'Elements panel',
|
|
13
13
|
/**
|
|
14
|
-
* @description The UI destination when right
|
|
14
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
15
15
|
*/
|
|
16
|
-
stylesSidebar: '
|
|
16
|
+
stylesSidebar: 'Styles sidebar',
|
|
17
17
|
/**
|
|
18
|
-
* @description The UI destination when right
|
|
18
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
19
19
|
*/
|
|
20
20
|
changesDrawer: 'Changes drawer',
|
|
21
21
|
/**
|
|
22
|
-
* @description The UI destination when right
|
|
22
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
23
23
|
*/
|
|
24
24
|
issuesView: 'Issues view',
|
|
25
25
|
/**
|
|
26
|
-
* @description The UI destination when right
|
|
26
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
27
27
|
*/
|
|
28
28
|
networkPanel: 'Network panel',
|
|
29
29
|
/**
|
|
30
|
-
* @description The UI destination when right
|
|
30
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
31
31
|
*/
|
|
32
32
|
requestConditionsDrawer: 'Request conditions drawer',
|
|
33
33
|
/**
|
|
34
|
-
* @description The UI destination when right
|
|
34
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
35
35
|
*/
|
|
36
36
|
applicationPanel: 'Application panel',
|
|
37
37
|
/**
|
|
38
|
-
* @description The UI destination when right
|
|
38
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
39
39
|
*/
|
|
40
40
|
sourcesPanel: 'Sources panel',
|
|
41
41
|
/**
|
|
42
|
-
* @description The UI destination when right
|
|
42
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
43
43
|
*/
|
|
44
44
|
timelinePanel: 'Performance panel',
|
|
45
45
|
/**
|
|
46
|
-
* @description The UI destination when right
|
|
46
|
+
* @description The UI destination when right-clicking an item that can be revealed.
|
|
47
47
|
*/
|
|
48
48
|
memoryInspectorPanel: 'Memory inspector panel',
|
|
49
49
|
/**
|
|
50
|
-
* @description The UI destination when revealing loaded resources through the Developer
|
|
50
|
+
* @description The UI destination when revealing loaded resources through the Developer resources panel.
|
|
51
51
|
*/
|
|
52
|
-
developerResourcesPanel: 'Developer
|
|
52
|
+
developerResourcesPanel: 'Developer resources panel',
|
|
53
53
|
/**
|
|
54
|
-
* @description The UI destination when revealing loaded resources through the Animations panel
|
|
54
|
+
* @description The UI destination when revealing loaded resources through the Animations panel.
|
|
55
55
|
*/
|
|
56
56
|
animationsPanel: 'Animations panel',
|
|
57
57
|
/**
|
|
58
|
-
* @description The UI destination when revealing an item in the Lighthouse panel
|
|
58
|
+
* @description The UI destination when revealing an item in the Lighthouse panel.
|
|
59
59
|
*/
|
|
60
60
|
lighthousePanel: 'Lighthouse panel',
|
|
61
61
|
} as const;
|
|
@@ -10,76 +10,76 @@ import type {SettingStorageType} from './Settings.js';
|
|
|
10
10
|
|
|
11
11
|
const UIStrings = {
|
|
12
12
|
/**
|
|
13
|
-
* @description Title of the Elements
|
|
13
|
+
* @description Title of the Elements panel.
|
|
14
14
|
*/
|
|
15
15
|
elements: 'Elements',
|
|
16
16
|
/**
|
|
17
|
-
* @description Text for DevTools AI
|
|
17
|
+
* @description Text for DevTools AI.
|
|
18
18
|
*/
|
|
19
19
|
ai: 'AI',
|
|
20
20
|
/**
|
|
21
|
-
* @description Text for DevTools appearance
|
|
21
|
+
* @description Text for DevTools appearance.
|
|
22
22
|
*/
|
|
23
23
|
appearance: 'Appearance',
|
|
24
24
|
/**
|
|
25
|
-
* @description
|
|
25
|
+
* @description Title of the Sources panel.
|
|
26
26
|
*/
|
|
27
27
|
sources: 'Sources',
|
|
28
28
|
/**
|
|
29
|
-
* @description Title of the Network
|
|
29
|
+
* @description Title of the Network panel.
|
|
30
30
|
*/
|
|
31
31
|
network: 'Network',
|
|
32
32
|
/**
|
|
33
|
-
* @description
|
|
33
|
+
* @description Title of the Performance panel.
|
|
34
34
|
*/
|
|
35
35
|
performance: 'Performance',
|
|
36
36
|
/**
|
|
37
|
-
* @description Title of the Console
|
|
37
|
+
* @description Title of the Console panel.
|
|
38
38
|
*/
|
|
39
39
|
console: 'Console',
|
|
40
40
|
/**
|
|
41
|
-
* @description
|
|
41
|
+
* @description Title of the Persistence setting category.
|
|
42
42
|
*/
|
|
43
43
|
persistence: 'Persistence',
|
|
44
44
|
/**
|
|
45
|
-
* @description
|
|
45
|
+
* @description Title of the Debugger setting category.
|
|
46
46
|
*/
|
|
47
47
|
debugger: 'Debugger',
|
|
48
48
|
/**
|
|
49
|
-
* @description
|
|
49
|
+
* @description Title of the Global setting category for shortcuts and settings available throughout DevTools.
|
|
50
50
|
*/
|
|
51
51
|
global: 'Global',
|
|
52
52
|
/**
|
|
53
|
-
* @description Title of the Rendering tool
|
|
53
|
+
* @description Title of the Rendering tool.
|
|
54
54
|
*/
|
|
55
55
|
rendering: 'Rendering',
|
|
56
56
|
/**
|
|
57
|
-
* @description Title of
|
|
57
|
+
* @description Title of the Grid setting category for CSS Grid tooling.
|
|
58
58
|
*/
|
|
59
59
|
grid: 'Grid',
|
|
60
60
|
/**
|
|
61
|
-
* @description
|
|
61
|
+
* @description Title of the Mobile setting category.
|
|
62
62
|
*/
|
|
63
63
|
mobile: 'Mobile',
|
|
64
64
|
/**
|
|
65
|
-
* @description
|
|
65
|
+
* @description Title of the Memory panel setting category.
|
|
66
66
|
*/
|
|
67
67
|
memory: 'Memory',
|
|
68
68
|
/**
|
|
69
|
-
* @description
|
|
69
|
+
* @description Title of the Extension setting category.
|
|
70
70
|
*/
|
|
71
71
|
extension: 'Extension',
|
|
72
72
|
/**
|
|
73
|
-
* @description
|
|
73
|
+
* @description Title of the Adorner setting category.
|
|
74
74
|
*/
|
|
75
75
|
adorner: 'Adorner',
|
|
76
76
|
/**
|
|
77
|
-
* @description Header for the
|
|
78
|
-
* section allows users see their signed
|
|
77
|
+
* @description Header for the Account section in the settings UI. The Account
|
|
78
|
+
* section allows users to see their signed-in account and configure which DevTools data is synced via Chrome Sync.
|
|
79
79
|
*/
|
|
80
80
|
account: 'Account',
|
|
81
81
|
/**
|
|
82
|
-
* @description
|
|
82
|
+
* @description Title of the Privacy setting category.
|
|
83
83
|
*/
|
|
84
84
|
privacy: 'Privacy',
|
|
85
85
|
} as const;
|
|
@@ -63,6 +63,7 @@ const AidaLanguageToMarkdown: Record<AidaInferenceLanguage, string> = {
|
|
|
63
63
|
|
|
64
64
|
export class AidaAbortError extends Error {}
|
|
65
65
|
export class AidaBlockError extends Error {}
|
|
66
|
+
export class AidaQuotaError extends Error {}
|
|
66
67
|
|
|
67
68
|
interface AiStream {
|
|
68
69
|
write: (data: string) => Promise<void>;
|
|
@@ -185,12 +186,23 @@ export class AidaClient {
|
|
|
185
186
|
debugLog('doConversation failed with error:', JSON.stringify(err));
|
|
186
187
|
if (err instanceof DispatchHttpRequestClient.DispatchHttpRequestError && err.response) {
|
|
187
188
|
const result = err.response;
|
|
189
|
+
if (result.statusCode === 429) {
|
|
190
|
+
stream.fail(new AidaQuotaError('Server responded: quota exceeded'));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
188
193
|
if (result.statusCode === 403) {
|
|
189
194
|
stream.fail(new Error('Server responded: permission denied'));
|
|
190
195
|
return;
|
|
191
196
|
}
|
|
192
197
|
if ('error' in result && result.error) {
|
|
193
|
-
|
|
198
|
+
const errorStr = typeof result.error === 'string' ? result.error : '';
|
|
199
|
+
const detailStr = typeof result.detail === 'string' ? result.detail : '';
|
|
200
|
+
if (errorStr.toLowerCase().includes('quota') || detailStr.toLowerCase().includes('quota')) {
|
|
201
|
+
stream.fail(new AidaQuotaError(
|
|
202
|
+
`Cannot send request: ${result.error}${result.detail ? ` ${result.detail}` : ''}`));
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
stream.fail(new Error(`Cannot send request: ${result.error}${result.detail ? ` ${result.detail}` : ''}`));
|
|
194
206
|
return;
|
|
195
207
|
}
|
|
196
208
|
if ('netErrorName' in result && result.netErrorName === 'net::ERR_TIMED_OUT') {
|
|
@@ -249,6 +261,9 @@ export class AidaClient {
|
|
|
249
261
|
thoughtSignature: result.functionCallChunk.functionCall.thoughtSignature,
|
|
250
262
|
});
|
|
251
263
|
} else if ('error' in result) {
|
|
264
|
+
if (typeof result.error === 'string' && result.error.toLowerCase().includes('quota')) {
|
|
265
|
+
throw new AidaQuotaError(`Server responded: ${JSON.stringify(result)}`);
|
|
266
|
+
}
|
|
252
267
|
throw new Error(`Server responded: ${JSON.stringify(result)}`);
|
|
253
268
|
} else {
|
|
254
269
|
throw new Error(`Unknown chunk result ${JSON.stringify(result)}`);
|
|
@@ -435,21 +450,32 @@ export function getClientFeatureName(feature: ClientFeature): string {
|
|
|
435
450
|
return name;
|
|
436
451
|
}
|
|
437
452
|
|
|
438
|
-
let hostConfigTrackerInstance: HostConfigTracker|undefined;
|
|
439
|
-
|
|
440
453
|
export class HostConfigTracker extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
441
454
|
#pollTimer?: ReturnType<typeof setTimeout>;
|
|
442
455
|
#aidaAvailability?: AidaAccessPreconditions;
|
|
443
456
|
|
|
444
|
-
|
|
445
|
-
|
|
457
|
+
static instance({forceNew}: {
|
|
458
|
+
forceNew: boolean,
|
|
459
|
+
} = {forceNew: false}): HostConfigTracker {
|
|
460
|
+
if (!Root.DevToolsContext.globalInstance().has(HostConfigTracker) || forceNew) {
|
|
461
|
+
Root.DevToolsContext.globalInstance().set(
|
|
462
|
+
HostConfigTracker,
|
|
463
|
+
new HostConfigTracker(),
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
return Root.DevToolsContext.globalInstance().get(HostConfigTracker);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
dispose(): void {
|
|
470
|
+
clearTimeout(this.#pollTimer);
|
|
471
|
+
this.listeners = undefined;
|
|
446
472
|
}
|
|
447
473
|
|
|
448
|
-
static
|
|
449
|
-
if (
|
|
450
|
-
|
|
474
|
+
static removeInstance(): void {
|
|
475
|
+
if (Root.DevToolsContext.globalInstance().has(HostConfigTracker)) {
|
|
476
|
+
Root.DevToolsContext.globalInstance().get(HostConfigTracker).dispose();
|
|
477
|
+
Root.DevToolsContext.globalInstance().delete(HostConfigTracker);
|
|
451
478
|
}
|
|
452
|
-
return hostConfigTrackerInstance;
|
|
453
479
|
}
|
|
454
480
|
|
|
455
481
|
override addEventListener(eventType: Events, listener: Common.EventTarget.EventListener<EventTypes, Events>):
|
|
@@ -98,21 +98,24 @@ async function makeHttpRequest<R>(request: DispatchHttpRequestRequest): Promise<
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
const SERVICE_NAME = 'gdpService';
|
|
101
|
-
let gdpClientInstance: GdpClient|null = null;
|
|
102
101
|
export class GdpClient {
|
|
103
102
|
#cachedProfilePromise?: Promise<Profile>;
|
|
104
103
|
#cachedEligibilityPromise?: Promise<CheckElibigilityResponse>;
|
|
105
104
|
|
|
106
|
-
private constructor() {
|
|
107
|
-
}
|
|
108
|
-
|
|
109
105
|
static instance({forceNew}: {
|
|
110
106
|
forceNew: boolean,
|
|
111
107
|
} = {forceNew: false}): GdpClient {
|
|
112
|
-
if (!
|
|
113
|
-
|
|
108
|
+
if (!Root.DevToolsContext.globalInstance().has(GdpClient) || forceNew) {
|
|
109
|
+
Root.DevToolsContext.globalInstance().set(
|
|
110
|
+
GdpClient,
|
|
111
|
+
new GdpClient(),
|
|
112
|
+
);
|
|
114
113
|
}
|
|
115
|
-
return
|
|
114
|
+
return Root.DevToolsContext.globalInstance().get(GdpClient);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static removeInstance(): void {
|
|
118
|
+
Root.DevToolsContext.globalInstance().delete(GdpClient);
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/**
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import type {Brand} from './Brand.js';
|
|
6
6
|
|
|
7
|
+
let graphemeSegmenter: Intl.Segmenter|null = null;
|
|
8
|
+
|
|
7
9
|
export const escapeCharacters = (inputString: string, charsToEscape: string): string => {
|
|
8
10
|
let foundChar = false;
|
|
9
11
|
for (let i = 0; i < charsToEscape.length; ++i) {
|
|
@@ -447,6 +449,39 @@ export const trimEndWithMaxLength = (str: string, maxLength: number): string =>
|
|
|
447
449
|
return str.slice(0, lastSegmentIndex) + ellipsis;
|
|
448
450
|
};
|
|
449
451
|
|
|
452
|
+
/**
|
|
453
|
+
* Truncates a string to not exceed a maximum number of UTF-16 code units (as measured by JS `string.length`).
|
|
454
|
+
*
|
|
455
|
+
* Unlike simple character limiters, this helper is grapheme-aware and uses `Intl.Segmenter` to prevent
|
|
456
|
+
* slicing inside surrogate pairs (e.g. Plane 1+ characters or emojis like '𠜎' / '🥳') or combining characters
|
|
457
|
+
* (e.g. 'é' represented in NFD as 'e' + combining acute accent). If the limit falls in the middle of a
|
|
458
|
+
* grapheme cluster, the function backs off to drop the entire cluster, ensuring the result is always a valid
|
|
459
|
+
* Unicode string.
|
|
460
|
+
*
|
|
461
|
+
* @param str The string to truncate.
|
|
462
|
+
* @param maxCodeUnits The maximum allowed code unit length (must be >= 0).
|
|
463
|
+
* @returns The truncated string, guaranteed to be <= maxCodeUnits in length and grapheme-safe.
|
|
464
|
+
*/
|
|
465
|
+
export const truncateToCodeUnitLength = (str: string, maxCodeUnits: number): string => {
|
|
466
|
+
if (isNaN(maxCodeUnits) || maxCodeUnits <= 0) {
|
|
467
|
+
return '';
|
|
468
|
+
}
|
|
469
|
+
if (str.length <= maxCodeUnits) {
|
|
470
|
+
return str;
|
|
471
|
+
}
|
|
472
|
+
if (!graphemeSegmenter) {
|
|
473
|
+
graphemeSegmenter = new Intl.Segmenter(undefined, {granularity: 'grapheme'});
|
|
474
|
+
}
|
|
475
|
+
let lastSafeIndex = 0;
|
|
476
|
+
for (const {index, segment} of graphemeSegmenter.segment(str)) {
|
|
477
|
+
if (index + segment.length > maxCodeUnits) {
|
|
478
|
+
break;
|
|
479
|
+
}
|
|
480
|
+
lastSafeIndex = index + segment.length;
|
|
481
|
+
}
|
|
482
|
+
return str.slice(0, lastSafeIndex);
|
|
483
|
+
};
|
|
484
|
+
|
|
450
485
|
export const escapeForRegExp = (str: string): string => {
|
|
451
486
|
return escapeCharacters(str, SPECIAL_REGEX_CHARACTERS);
|
|
452
487
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Title: AccessibilityModel axNodeToText correctly formats an accessibility node tree to text
|
|
2
|
+
Content:
|
|
3
|
+
dialog "Confirmation"
|
|
4
|
+
button "Submit" focusable: true
|
|
5
|
+
=== end content
|
|
6
|
+
|
|
7
|
+
Title: AccessibilityModel axNodeToText correctly formats when the root node is ignored
|
|
8
|
+
Content:
|
|
9
|
+
Ignored
|
|
10
|
+
button "Submit" focusable: true
|
|
11
|
+
=== end content
|
|
12
|
+
|
|
13
|
+
Title: AccessibilityModel axNodeToText correctly formats when a nested node is ignored
|
|
14
|
+
Content:
|
|
15
|
+
dialog "Confirmation"
|
|
16
|
+
button "Submit" focusable: true
|
|
17
|
+
=== end content
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
|
-
import
|
|
6
|
+
import * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
|
|
8
|
-
import {DeferredDOMNode, DOMModel, type DOMNode, Events as DOMModelEvents} from './DOMModel.js';
|
|
8
|
+
import {DeferredDOMNode, DOMDocument, DOMModel, type DOMNode, Events as DOMModelEvents} from './DOMModel.js';
|
|
9
|
+
import type {FrameManager} from './FrameManager.js';
|
|
9
10
|
import {SDKModel} from './SDKModel.js';
|
|
10
11
|
import {Capability, type Target} from './Target.js';
|
|
11
12
|
|
|
@@ -23,6 +24,7 @@ export interface CoreOrProtocolAxProperty {
|
|
|
23
24
|
|
|
24
25
|
export class AccessibilityNode {
|
|
25
26
|
readonly #accessibilityModel: AccessibilityModel;
|
|
27
|
+
readonly #frameManager: FrameManager;
|
|
26
28
|
readonly #id: Protocol.Accessibility.AXNodeId;
|
|
27
29
|
readonly #backendDOMNodeId: Protocol.DOM.BackendNodeId|null;
|
|
28
30
|
readonly #deferredDOMNode: DeferredDOMNode|null;
|
|
@@ -39,6 +41,7 @@ export class AccessibilityNode {
|
|
|
39
41
|
|
|
40
42
|
constructor(accessibilityModel: AccessibilityModel, payload: Protocol.Accessibility.AXNode) {
|
|
41
43
|
this.#accessibilityModel = accessibilityModel;
|
|
44
|
+
this.#frameManager = accessibilityModel.target().targetManager().getFrameManager();
|
|
42
45
|
|
|
43
46
|
this.#id = payload.nodeId;
|
|
44
47
|
accessibilityModel.setAXNodeForAXId(this.#id, this);
|
|
@@ -190,6 +193,63 @@ export class AccessibilityNode {
|
|
|
190
193
|
getFrameId(): Protocol.Page.FrameId|null {
|
|
191
194
|
return this.#frameId || this.parentNode()?.getFrameId() || null;
|
|
192
195
|
}
|
|
196
|
+
|
|
197
|
+
isLeafNode(): boolean {
|
|
198
|
+
return this.numChildren() === 0 && this.role()?.value !== 'Iframe';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getNodeId(): string {
|
|
202
|
+
return this.getFrameId() + '#' + this.id();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async getChildren(): Promise<AccessibilityNode[]> {
|
|
206
|
+
if (this.role()?.value === 'Iframe') {
|
|
207
|
+
const domNode = await this.deferredDOMNode()?.resolvePromise();
|
|
208
|
+
if (!domNode) {
|
|
209
|
+
throw new Error('Could not find corresponding DOMNode');
|
|
210
|
+
}
|
|
211
|
+
const frameId = domNode.frameOwnerFrameId();
|
|
212
|
+
if (!frameId) {
|
|
213
|
+
throw new Error('No owner frameId on iframe node');
|
|
214
|
+
}
|
|
215
|
+
const localRoot = await getRootNode(frameId, this.#frameManager);
|
|
216
|
+
return [localRoot];
|
|
217
|
+
}
|
|
218
|
+
return await this.accessibilityModel().requestAXChildren(this.id(), this.getFrameId() || undefined);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async axNodeToText(depth = 0): Promise<string> {
|
|
222
|
+
const indent = ' '.repeat(depth);
|
|
223
|
+
const role = this.role()?.value || '';
|
|
224
|
+
const name = this.name()?.value || '';
|
|
225
|
+
const properties = this.properties() || [];
|
|
226
|
+
const ignored = this.ignored();
|
|
227
|
+
let childDepth = depth + 1;
|
|
228
|
+
|
|
229
|
+
const lines = [];
|
|
230
|
+
if (ignored) {
|
|
231
|
+
if (depth === 0) {
|
|
232
|
+
lines.push('Ignored\n');
|
|
233
|
+
} else {
|
|
234
|
+
childDepth = depth;
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
let line = `${indent}${role} "${name}"`;
|
|
238
|
+
for (const prop of properties) {
|
|
239
|
+
if (prop.value && isPrintableType(prop.value.type)) {
|
|
240
|
+
line += ` ${prop.name}: ${prop.value.value}`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
lines.push(line + '\n');
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const children = await this.getChildren();
|
|
247
|
+
for (const child of children) {
|
|
248
|
+
lines.push(await child.axNodeToText(childDepth));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return lines.join('');
|
|
252
|
+
}
|
|
193
253
|
}
|
|
194
254
|
|
|
195
255
|
export const enum Events {
|
|
@@ -363,3 +423,73 @@ export class AccessibilityModel extends SDKModel<EventTypes> implements Protocol
|
|
|
363
423
|
}
|
|
364
424
|
|
|
365
425
|
SDKModel.register(AccessibilityModel, {capabilities: Capability.DOM, autostart: false});
|
|
426
|
+
|
|
427
|
+
function getModel(frameId: Protocol.Page.FrameId, frameManager: FrameManager): AccessibilityModel {
|
|
428
|
+
const frame = frameManager.getFrame(frameId);
|
|
429
|
+
const model = frame?.resourceTreeModel().target().model(AccessibilityModel);
|
|
430
|
+
if (!model) {
|
|
431
|
+
throw new Error('Could not instantiate model for frameId');
|
|
432
|
+
}
|
|
433
|
+
return model;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export async function getRootNode(frameId: Protocol.Page.FrameId,
|
|
437
|
+
frameManager: FrameManager): Promise<AccessibilityNode> {
|
|
438
|
+
const model = getModel(frameId, frameManager);
|
|
439
|
+
const root = await model.requestRootNode(frameId);
|
|
440
|
+
if (!root) {
|
|
441
|
+
throw new Error('No accessibility root for frame');
|
|
442
|
+
}
|
|
443
|
+
return root;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function getFrameIdForNodeOrDocument(node: DOMNode): Protocol.Page.FrameId {
|
|
447
|
+
let frameId;
|
|
448
|
+
if (node instanceof DOMDocument) {
|
|
449
|
+
frameId = node.body?.frameId();
|
|
450
|
+
} else {
|
|
451
|
+
frameId = node.frameId();
|
|
452
|
+
}
|
|
453
|
+
if (!frameId) {
|
|
454
|
+
throw new Error('No frameId for DOM node');
|
|
455
|
+
}
|
|
456
|
+
return frameId;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export async function getNodeAndAncestorsFromDOMNode(domNode: DOMNode): Promise<AccessibilityNode[]> {
|
|
460
|
+
const frameManager = domNode.domModel().target().targetManager().getFrameManager();
|
|
461
|
+
let frameId = getFrameIdForNodeOrDocument(domNode);
|
|
462
|
+
const model = getModel(frameId, frameManager);
|
|
463
|
+
const result = await model.requestAndLoadSubTreeToNode(domNode);
|
|
464
|
+
if (!result) {
|
|
465
|
+
throw new Error('Could not retrieve accessibility node for inspected DOM node');
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const outermostFrameId = frameManager.getOutermostFrame()?.id;
|
|
469
|
+
if (!outermostFrameId) {
|
|
470
|
+
return result;
|
|
471
|
+
}
|
|
472
|
+
while (frameId !== outermostFrameId) {
|
|
473
|
+
const node = await frameManager.getFrame(frameId)?.getOwnerDOMNodeOrDocument();
|
|
474
|
+
if (!node) {
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
frameId = getFrameIdForNodeOrDocument(node);
|
|
478
|
+
const model = getModel(frameId, frameManager);
|
|
479
|
+
const ancestors = await model.requestAndLoadSubTreeToNode(node);
|
|
480
|
+
result.push(...ancestors || []);
|
|
481
|
+
}
|
|
482
|
+
return result;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export function isPrintableType(valueType: Protocol.Accessibility.AXValueType): boolean {
|
|
486
|
+
switch (valueType) {
|
|
487
|
+
case Protocol.Accessibility.AXValueType.Boolean:
|
|
488
|
+
case Protocol.Accessibility.AXValueType.BooleanOrUndefined:
|
|
489
|
+
case Protocol.Accessibility.AXValueType.String:
|
|
490
|
+
case Protocol.Accessibility.AXValueType.Number:
|
|
491
|
+
return true;
|
|
492
|
+
default:
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
@@ -19,7 +19,10 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
19
19
|
super();
|
|
20
20
|
this.#targetManager = targetManager;
|
|
21
21
|
this.#cpuThrottlingRate = 1; // No throttling
|
|
22
|
-
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
initialize(): void {
|
|
25
|
+
this.#targetManager.observeModels(EmulationModel, this);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
static instance(opts: {
|
|
@@ -29,10 +32,10 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
29
32
|
} = {forceNew: null}): CPUThrottlingManager {
|
|
30
33
|
const {forceNew} = opts;
|
|
31
34
|
if (!Root.DevToolsContext.globalInstance().has(CPUThrottlingManager) || forceNew) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const manager = new CPUThrottlingManager(opts.settings ?? Common.Settings.Settings.instance(),
|
|
36
|
+
opts.targetManager ?? TargetManager.instance());
|
|
37
|
+
manager.initialize();
|
|
38
|
+
Root.DevToolsContext.globalInstance().set(CPUThrottlingManager, manager);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
return Root.DevToolsContext.globalInstance().get(CPUThrottlingManager);
|