chrome-devtools-frontend 1.0.1726686 → 1.0.1730971
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/rules/tests/test-strict-assertions-and-literal-expectations.md +1 -1
- package/.agents/rules/tests/test-view-and-presenter-isolation.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-declarative-child-widget-composition.md +5 -5
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-localization-and-uistrings-hygiene.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +3 -3
- package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +2 -2
- package/.agents/skills/code-review/SKILL.md +63 -12
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +38 -10
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +1 -0
- package/.agents/skills/ui-widgets/SKILL.md +8 -2
- package/.agents/skills/write-ai-eval-test/SKILL.md +106 -0
- package/AUTHORS +2 -0
- package/DIR_METADATA +1 -2
- package/README.md +48 -26
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +1 -0
- package/docs/contributing/changes.md +25 -0
- package/docs/ui_engineering.md +13 -4
- package/eslint.config.mjs +323 -41
- package/front_end/core/common/Color.ts +7 -7
- package/front_end/core/common/ParsedURL.ts +3 -3
- package/front_end/core/common/ResolverBase.ts +3 -3
- package/front_end/core/common/SegmentedRange.ts +3 -3
- package/front_end/core/common/SimpleHistoryManager.ts +14 -14
- package/front_end/core/common/Trie.ts +3 -3
- package/front_end/core/common/VersionController.ts +7 -7
- package/front_end/core/host/InspectorFrontendHost.ts +2 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -1
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +4 -0
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/platform/StringUtilities.ts +54 -13
- package/front_end/core/platform/node/HostRuntime.ts +13 -7
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +4 -5
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AccessibilityModel.ts +5 -5
- package/front_end/core/sdk/AnimationModel.ts +17 -19
- package/front_end/core/sdk/CPUProfilerModel.ts +3 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +7 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +73 -13
- package/front_end/core/sdk/CSSMetadata.ts +7 -7
- package/front_end/core/sdk/CSSModel.ts +33 -33
- package/front_end/core/sdk/CSSProperty.ts +5 -5
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +4 -4
- package/front_end/core/sdk/Connections.ts +16 -16
- package/front_end/core/sdk/ConsoleModel.ts +44 -47
- package/front_end/core/sdk/CookieParser.ts +11 -11
- package/front_end/core/sdk/EmulationModel.ts +35 -36
- package/front_end/core/sdk/EventBreakpointsModel.ts +11 -11
- package/front_end/core/sdk/FrameManager.ts +16 -16
- package/front_end/core/sdk/IsolateManager.ts +2 -2
- package/front_end/core/sdk/IssuesModel.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -19
- package/front_end/core/sdk/PageResourceLoader.ts +14 -16
- package/front_end/core/sdk/RemoteObject.ts +9 -9
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/RuntimeModel.ts +7 -7
- package/front_end/core/sdk/Script.ts +6 -6
- package/front_end/core/sdk/ServiceWorkerManager.ts +36 -10
- package/front_end/core/sdk/SourceMap.ts +18 -20
- package/front_end/core/sdk/SourceMapManager.ts +2 -2
- package/front_end/core/sdk/TargetManager.ts +2 -2
- package/front_end/devtools_compatibility.js +7 -3
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -2
- package/front_end/entrypoints/node_app/app/NodeConnectionsPanel.ts +203 -115
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +1 -3
- package/front_end/generated/protocol.ts +1 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +36 -12
- package/front_end/models/ai_assistance/AiConversation.ts +8 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +137 -62
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +149 -2
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +269 -42
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +3 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +9 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +13 -2
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +23 -7
- package/front_end/models/ai_assistance/tools/Tool.ts +7 -5
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +22 -24
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +60 -60
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +24 -24
- package/front_end/models/bindings/DefaultScriptMapping.ts +8 -8
- package/front_end/models/bindings/FileUtils.ts +13 -13
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +23 -23
- package/front_end/models/comment_manager/CommentManager.ts +3 -3
- package/front_end/models/comment_manager/CommentThread.ts +50 -5
- package/front_end/models/cpu_profile/CPUProfileDataModel.ts +14 -14
- package/front_end/models/cpu_profile/ProfileTreeModel.ts +4 -4
- package/front_end/models/elements/StyleChanges.ts +38 -0
- package/front_end/models/emulation/EmulatedDevices.ts +12 -12
- package/front_end/models/har/HARFormat.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.ts +5 -1
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +57 -3
- package/front_end/models/lighthouse/RunTypes.ts +9 -1
- package/front_end/models/logs/LogManager.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +3 -0
- package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +24 -24
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +8 -3
- package/front_end/models/trace/LanternComputationData.ts +37 -11
- package/front_end/models/trace/Processor.ts +2 -1
- package/front_end/models/trace/extras/TraceTree.ts +36 -10
- package/front_end/models/trace/handlers/InitiatorsHandler.ts +27 -34
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -6
- package/front_end/models/trace/handlers/SamplesHandler.ts +9 -6
- package/front_end/models/workspace/FileManager.ts +6 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +8 -1
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +15 -17
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/ExternalHandler.ts +10 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +27 -22
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +19 -23
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +2 -2
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +23 -9
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +37 -17
- package/front_end/panels/animation/animationTimeline.css +19 -3
- package/front_end/panels/application/AppManifestView.ts +1 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +143 -128
- package/front_end/panels/application/DOMStorageItemsView.ts +14 -14
- package/front_end/panels/application/DeviceBoundSessionsView.ts +10 -13
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -4
- package/front_end/panels/application/IndexedDBViews.ts +8 -4
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -5
- package/front_end/panels/application/PrivateVerificationTokensView.ts +53 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +12 -8
- package/front_end/panels/application/ServiceWorkersView.ts +1 -2
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +91 -109
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/StorageMetadataView.ts +6 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +70 -37
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +3 -3
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +10 -11
- package/front_end/panels/application/privateVerificationTokensView.css +20 -0
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +24 -24
- package/front_end/panels/changes/ChangesSidebar.ts +5 -5
- package/front_end/panels/changes/ChangesView.ts +10 -11
- package/front_end/panels/comments/CommentsPane.ts +292 -102
- package/front_end/panels/comments/commentsPane.css +93 -12
- package/front_end/panels/common/CommentThreadWidget.ts +69 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +108 -29
- package/front_end/panels/common/CommentsStatusBarPill.ts +17 -6
- package/front_end/panels/common/DOMLinkifier.ts +37 -12
- package/front_end/panels/common/ExtensionPanel.ts +13 -4
- package/front_end/panels/common/ExtensionServer.ts +27 -3
- package/front_end/panels/common/PersistenceUtils.ts +3 -3
- package/front_end/panels/common/commentThreadWidget.css +25 -1
- package/front_end/panels/common/common-meta.ts +10 -0
- package/front_end/panels/console/ConsolePinPane.ts +13 -15
- package/front_end/panels/console/ConsolePrompt.ts +173 -95
- package/front_end/panels/console/ConsoleSidebar.ts +2 -2
- package/front_end/panels/console/ConsoleView.ts +75 -79
- package/front_end/panels/console/ConsoleViewMessage.ts +52 -4
- package/front_end/panels/console/SymbolizedErrorWidget.ts +8 -4
- package/front_end/panels/console/consolePrompt.css +1 -1
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +3 -4
- package/front_end/panels/coverage/CoverageListView.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +20 -5
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +4 -3
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewUnusedDeclarations.ts +8 -8
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +2 -3
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +4 -5
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +6 -7
- package/front_end/panels/elements/CSSValueTraceView.ts +3 -3
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +15 -14
- package/front_end/panels/elements/DOMTreeElementWidget.ts +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +2 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -0
- package/front_end/panels/elements/EventListenersWidget.ts +2 -2
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +3 -3
- package/front_end/panels/elements/PropertiesWidget.ts +9 -10
- package/front_end/panels/elements/PropertyRenderer.ts +72 -11
- package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -10
- package/front_end/panels/elements/StyleEditorWidget.ts +30 -16
- package/front_end/panels/elements/StylePropertiesSection.ts +93 -44
- package/front_end/panels/elements/StylePropertyTreeElement.ts +230 -302
- package/front_end/panels/elements/StylesContainer.ts +2 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -13
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +66 -37
- package/front_end/panels/elements/components/CSSHintDetailsView.ts +51 -41
- package/front_end/panels/elements/components/CSSPropertyDocsView.ts +75 -65
- package/front_end/panels/elements/components/CSSQuery.ts +112 -74
- package/front_end/panels/elements/components/CSSVariableValueView.ts +109 -68
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +64 -45
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +35 -28
- package/front_end/panels/elements/components/QueryContainer.ts +104 -74
- package/front_end/panels/elements/components/accessibilityTreeNode.css +22 -20
- package/front_end/panels/elements/components/computedStyleProperty.css +2 -0
- package/front_end/panels/elements/components/cssHintDetailsView.css +23 -21
- package/front_end/panels/elements/components/cssPropertyDocsView.css +38 -36
- package/front_end/panels/elements/components/cssVariableValueView.css +42 -40
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -2
- package/front_end/panels/elements/components/queryContainer.css +23 -21
- package/front_end/panels/elements/stylesSidebarPane.css +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +2 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +9 -10
- package/front_end/panels/emulation/mediaQueryInspector.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +2 -2
- package/front_end/panels/issues/AffectedCookiesView.ts +144 -101
- package/front_end/panels/issues/AffectedDescendantsWithinSelectElementView.ts +83 -31
- package/front_end/panels/issues/AffectedDirectivesView.ts +218 -135
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +84 -34
- package/front_end/panels/issues/AffectedElementsView.ts +86 -23
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +2 -2
- package/front_end/panels/issues/AffectedMetadataAllowedSitesView.ts +2 -2
- package/front_end/panels/issues/AffectedPartitioningBlobURLView.ts +36 -11
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +135 -58
- package/front_end/panels/issues/AffectedSourcesView.ts +49 -28
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +490 -269
- package/front_end/panels/issues/GenericIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +63 -48
- package/front_end/panels/issues/IssueView.ts +14 -18
- package/front_end/panels/issues/components/ElementsPanelLink.ts +70 -34
- package/front_end/panels/issues/components/HideIssuesMenu.ts +56 -32
- package/front_end/panels/issues/components/elementsPanelLink.css +10 -6
- package/front_end/panels/issues/components/hideIssuesMenu.css +16 -14
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/issues/issuesTree.css +4 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +12 -13
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -1
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +159 -161
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorView.ts +228 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +32 -41
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector.ts +2 -0
- package/front_end/panels/media/EventDisplayTable.ts +2 -2
- package/front_end/panels/media/MainView.ts +132 -66
- package/front_end/panels/media/PlayerDetailView.ts +32 -14
- package/front_end/panels/media/PlayerListView.ts +83 -23
- package/front_end/panels/media/PlayerPropertiesView.ts +2 -2
- package/front_end/panels/media/TickingFlameChart.ts +153 -63
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +615 -464
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +43 -0
- package/front_end/panels/network/EventSourceMessagesView.ts +3 -3
- package/front_end/panels/network/NetworkConfigView.ts +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/NetworkItemView.ts +27 -26
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +236 -97
- package/front_end/panels/network/NetworkOverview.ts +8 -10
- package/front_end/panels/network/RequestConditionsDrawer.ts +8 -4
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -4
- package/front_end/panels/network/RequestHTMLView.ts +26 -7
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/RequestInitiatorView.ts +21 -22
- package/front_end/panels/network/RequestPayloadView.ts +2 -16
- package/front_end/panels/network/RequestPreviewView.ts +5 -5
- package/front_end/panels/network/RequestTimingView.ts +6 -6
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +5 -6
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +4 -3
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +11 -12
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/networkLogView.css +2 -2
- package/front_end/panels/network/networkManageCustomHeadersView.css +27 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -1
- package/front_end/panels/network/requestInitiatorView.css +5 -3
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -2
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +1 -2
- package/front_end/panels/profiler/HeapTimelineOverview.ts +77 -15
- package/front_end/panels/profiler/IsolateSelector.ts +258 -187
- package/front_end/panels/profiler/ProfileLauncherView.ts +7 -29
- package/front_end/panels/profiler/profileLauncherView.css +6 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -5
- package/front_end/panels/recorder/ControlButton.ts +1 -1
- package/front_end/panels/recorder/RecordingListView.ts +2 -4
- package/front_end/panels/recorder/RecordingView.ts +1 -2
- package/front_end/panels/recorder/SelectorPicker.ts +2 -4
- package/front_end/panels/recorder/StepView.ts +24 -10
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/recordingView.css +1 -1
- package/front_end/panels/screencast/ScreencastApp.ts +1 -1
- package/front_end/panels/search/SearchResultsPane.ts +11 -12
- package/front_end/panels/search/SearchView.ts +8 -10
- package/front_end/panels/security/SecurityPanel.ts +1 -8
- package/front_end/panels/security/SecurityPanelSidebar.ts +2 -2
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -2
- package/front_end/panels/settings/AISettingsTab.ts +1 -1
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +34 -20
- package/front_end/panels/settings/EditFileSystemView.ts +2 -2
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +375 -197
- package/front_end/panels/settings/KeybindsSettingsTab.ts +570 -414
- package/front_end/panels/settings/SettingsScreen.ts +312 -114
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +2 -2
- package/front_end/panels/settings/aiSettingsTab.css +1 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +924 -578
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +9 -2
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +39 -0
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +37 -8
- package/front_end/panels/settings/settingsScreen.css +0 -24
- package/front_end/panels/sources/BreakpointEditDialog.ts +9 -6
- package/front_end/panels/sources/BreakpointsView.ts +25 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/panels/sources/GoToLineQuickOpen.ts +8 -8
- package/front_end/panels/sources/NavigatorView.ts +521 -439
- package/front_end/panels/sources/PersistenceActions.ts +11 -12
- package/front_end/panels/sources/ProfilePlugin.ts +28 -17
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesNavigator.ts +9 -9
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
- package/front_end/panels/sources/components/HeadersView.ts +1 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +5 -6
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +73 -34
- package/front_end/panels/timeline/IsolateSelector.ts +25 -37
- package/front_end/panels/timeline/StatusDialog.ts +5 -7
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +40 -21
- package/front_end/panels/timeline/TimelineEventOverview.ts +130 -34
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +255 -103
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +19 -11
- package/front_end/panels/timeline/TimelinePanel.ts +1 -0
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +11 -12
- package/front_end/panels/timeline/TimelineTreeView.ts +240 -122
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -0
- package/front_end/panels/timeline/components/BreadcrumbsUI.ts +5 -4
- package/front_end/panels/timeline/components/DetailsView.ts +97 -65
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +2 -2
- package/front_end/panels/timeline/components/MetricCard.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +11 -12
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +57 -50
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
- package/front_end/panels/timeline/components/Sidebar.ts +161 -109
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +33 -12
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +3 -0
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +11 -11
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +6 -7
- package/front_end/panels/timeline/components/networkTrackWidget.css +24 -22
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -1
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +15 -10
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +1 -1
- package/front_end/panels/timeline/timelinePanel.css +5 -0
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/WebAudioView.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/legacy-javascript/README.chromium +2 -2
- package/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +2 -2
- package/front_end/third_party/legacy-javascript/package.json +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1983 -2022
- package/front_end/third_party/lighthouse/locales/ar-XB.json +157 -142
- package/front_end/third_party/lighthouse/locales/ar.json +157 -142
- package/front_end/third_party/lighthouse/locales/bg.json +154 -139
- package/front_end/third_party/lighthouse/locales/ca.json +157 -142
- package/front_end/third_party/lighthouse/locales/cs.json +148 -133
- package/front_end/third_party/lighthouse/locales/da.json +153 -138
- package/front_end/third_party/lighthouse/locales/de.json +152 -137
- package/front_end/third_party/lighthouse/locales/el.json +153 -138
- package/front_end/third_party/lighthouse/locales/en-GB.json +160 -145
- package/front_end/third_party/lighthouse/locales/en-US.json +239 -218
- package/front_end/third_party/lighthouse/locales/en-XL.json +239 -218
- package/front_end/third_party/lighthouse/locales/es-419.json +150 -135
- package/front_end/third_party/lighthouse/locales/es.json +149 -134
- package/front_end/third_party/lighthouse/locales/fi.json +151 -136
- package/front_end/third_party/lighthouse/locales/fil.json +154 -139
- package/front_end/third_party/lighthouse/locales/fr.json +150 -135
- package/front_end/third_party/lighthouse/locales/he.json +160 -145
- package/front_end/third_party/lighthouse/locales/hi.json +156 -141
- package/front_end/third_party/lighthouse/locales/hr.json +154 -139
- package/front_end/third_party/lighthouse/locales/hu.json +111 -96
- package/front_end/third_party/lighthouse/locales/id.json +153 -138
- package/front_end/third_party/lighthouse/locales/it.json +153 -138
- package/front_end/third_party/lighthouse/locales/ja.json +150 -135
- package/front_end/third_party/lighthouse/locales/ko.json +42 -27
- package/front_end/third_party/lighthouse/locales/lt.json +152 -137
- package/front_end/third_party/lighthouse/locales/lv.json +93 -78
- package/front_end/third_party/lighthouse/locales/nl.json +149 -134
- package/front_end/third_party/lighthouse/locales/no.json +152 -137
- package/front_end/third_party/lighthouse/locales/pl.json +153 -138
- package/front_end/third_party/lighthouse/locales/pt-PT.json +152 -137
- package/front_end/third_party/lighthouse/locales/pt.json +157 -142
- package/front_end/third_party/lighthouse/locales/ro.json +149 -134
- package/front_end/third_party/lighthouse/locales/ru.json +76 -61
- package/front_end/third_party/lighthouse/locales/sk.json +153 -138
- package/front_end/third_party/lighthouse/locales/sl.json +149 -134
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +151 -136
- package/front_end/third_party/lighthouse/locales/sr.json +151 -136
- package/front_end/third_party/lighthouse/locales/sv.json +152 -137
- package/front_end/third_party/lighthouse/locales/ta.json +156 -141
- package/front_end/third_party/lighthouse/locales/te.json +157 -142
- package/front_end/third_party/lighthouse/locales/th.json +111 -96
- package/front_end/third_party/lighthouse/locales/tr.json +153 -138
- package/front_end/third_party/lighthouse/locales/uk.json +149 -134
- package/front_end/third_party/lighthouse/locales/vi.json +162 -147
- package/front_end/third_party/lighthouse/locales/zh-HK.json +150 -135
- package/front_end/third_party/lighthouse/locales/zh-TW.json +154 -139
- package/front_end/third_party/lighthouse/locales/zh.json +152 -137
- package/front_end/third_party/lighthouse/report/bundle.d.ts +9 -8
- package/front_end/third_party/lighthouse/report/bundle.js +10 -10
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -7
- package/front_end/tsconfig.compatibility.json +1 -0
- package/front_end/tsconfig.json +3 -2
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +0 -2
- package/front_end/ui/components/dialogs/typeToAllowDialog.css +0 -4
- package/front_end/ui/components/icon_button/fileSourceIcon.css +1 -1
- package/front_end/ui/components/input/textInput.css +1 -1
- package/front_end/ui/components/lists/List.ts +26 -14
- package/front_end/ui/components/menus/menus.ts +0 -2
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +351 -138
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +6 -6
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaser.ts +2 -3
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +53 -4
- package/front_end/ui/components/tree_outline/treeOutline.css +7 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +8 -3
- package/front_end/ui/legacy/EmptyWidget.ts +4 -4
- package/front_end/ui/legacy/ForwardedInputEventHandler.ts +2 -2
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/KeyboardShortcut.ts +7 -7
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +198 -66
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +71 -68
- package/front_end/ui/legacy/View.ts +7 -4
- package/front_end/ui/legacy/ViewManager.ts +49 -37
- package/front_end/ui/legacy/Widget.ts +32 -12
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -3
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingUI.ts +8 -8
- package/front_end/ui/legacy/components/inline_editor/BezierUI.ts +8 -9
- package/front_end/ui/legacy/components/inline_editor/LinkSwatch.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +45 -11
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +10 -12
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +102 -29
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +148 -122
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +20 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -1
- package/front_end/ui/legacy/components/source_frame/FontView.ts +29 -5
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +79 -12
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +20 -2
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +6 -10
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +11 -11
- package/front_end/ui/legacy/components/source_frame/fontView.css +7 -0
- package/front_end/ui/legacy/components/source_frame/imageView.css +7 -0
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +14 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +126 -2
- package/front_end/ui/legacy/emptyWidget.css +2 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -3
- package/front_end/ui/legacy/smallBubble.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -0
- package/front_end/ui/lit/Directives.ts +35 -18
- package/front_end/ui/lit/lit.ts +0 -2
- package/front_end/ui/lit/render.ts +0 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
- package/package.json +1 -1
- package/vpython.toml +8 -0
- package/vpython.toml.uv.lock +3 -0
- package/.agents/skills/review-models-core/SKILL.md +0 -73
- package/.agents/skills/review-tests/SKILL.md +0 -67
- package/.agents/skills/review-ui-widgets/SKILL.md +0 -115
- package/front_end/generated/ARIAProperties.ts +0 -2686
- package/front_end/ui/components/menus/README.md +0 -119
- package/front_end/ui/components/menus/SelectMenu.ts +0 -473
- package/front_end/ui/components/menus/selectMenu.css +0 -54
- package/front_end/ui/components/menus/selectMenuButton.css +0 -108
|
@@ -23,10 +23,10 @@ export class IssuesModel extends SDKModel<EventTypes> implements ProtocolProxyAp
|
|
|
23
23
|
|
|
24
24
|
constructor(target: Target) {
|
|
25
25
|
super(target);
|
|
26
|
-
void this
|
|
26
|
+
void this.#ensureEnabled();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
async #ensureEnabled(): Promise<void> {
|
|
30
30
|
if (this.#enabled) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
@@ -124,14 +124,14 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
124
124
|
this.#debuggerModel = target.model(DebuggerModel);
|
|
125
125
|
if (this.#debuggerModel) {
|
|
126
126
|
settings.resolve(disablePausedStateOverlaySettingDescriptor)
|
|
127
|
-
.addChangeListener(this
|
|
128
|
-
this.#debuggerModel.addEventListener(
|
|
129
|
-
|
|
130
|
-
this.#debuggerModel.addEventListener(
|
|
131
|
-
|
|
127
|
+
.addChangeListener(this.#updatePausedInDebuggerMessage, this);
|
|
128
|
+
this.#debuggerModel.addEventListener(DebuggerModelEvents.DebuggerPaused, this.#updatePausedInDebuggerMessage,
|
|
129
|
+
this);
|
|
130
|
+
this.#debuggerModel.addEventListener(DebuggerModelEvents.DebuggerResumed, this.#updatePausedInDebuggerMessage,
|
|
131
|
+
this);
|
|
132
132
|
// TODO(dgozman): we should get DebuggerResumed on navigations instead of listening to GlobalObjectCleared.
|
|
133
|
-
this.#debuggerModel.addEventListener(
|
|
134
|
-
|
|
133
|
+
this.#debuggerModel.addEventListener(DebuggerModelEvents.GlobalObjectCleared, this.#updatePausedInDebuggerMessage,
|
|
134
|
+
this);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
this.#defaultHighlighter = new DefaultHighlighter(this);
|
|
@@ -146,7 +146,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
146
146
|
|
|
147
147
|
if (!target.suspended()) {
|
|
148
148
|
void this.overlayAgent.invoke_enable();
|
|
149
|
-
void this
|
|
149
|
+
void this.#wireAgentToSettings();
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
this.#persistentHighlighter = new OverlayPersistentHighlighter(this, settings, {
|
|
@@ -204,7 +204,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
204
204
|
|
|
205
205
|
static hideDOMNodeHighlight(targetManager: TargetManager): void {
|
|
206
206
|
for (const overlayModel of targetManager.models(OverlayModel)) {
|
|
207
|
-
overlayModel
|
|
207
|
+
overlayModel.#delayedHideHighlight(0);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
@@ -244,7 +244,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
244
244
|
return this.overlayAgent.invoke_hideHighlight();
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
async #wireAgentToSettings(): Promise<void> {
|
|
248
248
|
this.#registeredListeners = [
|
|
249
249
|
this.#showPaintRectsSetting.addChangeListener(
|
|
250
250
|
() => this.overlayAgent.invoke_setShowPaintRects({result: this.#showPaintRectsSetting.get()})),
|
|
@@ -281,7 +281,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
281
281
|
void this.overlayAgent.invoke_setShowScrollBottleneckRects({show: true});
|
|
282
282
|
}
|
|
283
283
|
if (this.#debuggerModel && this.#debuggerModel.isPaused()) {
|
|
284
|
-
this
|
|
284
|
+
this.#updatePausedInDebuggerMessage();
|
|
285
285
|
}
|
|
286
286
|
await this.overlayAgent.invoke_setShowViewportSizeOnResize({show: this.#showViewportSizeOnResize});
|
|
287
287
|
this.#persistentHighlighter?.resetOverlay();
|
|
@@ -293,7 +293,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
override async resumeModel(): Promise<void> {
|
|
296
|
-
await Promise.all([this.overlayAgent.invoke_enable(), this
|
|
296
|
+
await Promise.all([this.overlayAgent.invoke_enable(), this.#wireAgentToSettings()]);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
setShowViewportSizeOnResize(show: boolean): void {
|
|
@@ -308,7 +308,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
308
308
|
void this.overlayAgent.invoke_setShowViewportSizeOnResize({show});
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
|
|
311
|
+
#updatePausedInDebuggerMessage(): void {
|
|
312
312
|
if (this.target().suspended()) {
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
@@ -329,7 +329,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
329
329
|
await this.#domModel.requestDocument();
|
|
330
330
|
this.#inspectModeEnabled = mode !== Protocol.Overlay.InspectMode.None;
|
|
331
331
|
this.dispatchEventToListeners(Events.INSPECT_MODE_WILL_BE_TOGGLED, this);
|
|
332
|
-
void this.#highlighter.setInspectMode(mode, this
|
|
332
|
+
void this.#highlighter.setInspectMode(mode, this.#buildHighlightConfig('all', showDetailedTooltip));
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
inspectModeEnabled(): boolean {
|
|
@@ -345,7 +345,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
345
345
|
clearTimeout(this.#hideHighlightTimeout);
|
|
346
346
|
this.#hideHighlightTimeout = undefined;
|
|
347
347
|
|
|
348
|
-
const highlightConfig = this
|
|
348
|
+
const highlightConfig = this.#buildHighlightConfig(mode);
|
|
349
349
|
if (typeof showInfo !== 'undefined') {
|
|
350
350
|
highlightConfig.showInfo = showInfo;
|
|
351
351
|
}
|
|
@@ -354,7 +354,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
354
354
|
|
|
355
355
|
highlightInOverlayForTwoSeconds(data: HighlightData): void {
|
|
356
356
|
this.highlightInOverlay(data);
|
|
357
|
-
this
|
|
357
|
+
this.#delayedHideHighlight(2000);
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
highlightGridInPersistentOverlay(nodeId: Protocol.DOM.NodeId): void {
|
|
@@ -495,7 +495,7 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
495
495
|
this.#sourceOrderModeActive = isActive;
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
|
|
498
|
+
#delayedHideHighlight(delay: number): void {
|
|
499
499
|
clearTimeout(this.#hideHighlightTimeout);
|
|
500
500
|
this.#hideHighlightTimeout = globalThis.setTimeout(
|
|
501
501
|
() => this.highlightInOverlay({clear: true}),
|
|
@@ -570,8 +570,8 @@ export class OverlayModel extends SDKModel<EventTypes> implements ProtocolProxyA
|
|
|
570
570
|
this.setShowViewportSizeOnResize(!show);
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
#buildHighlightConfig(mode: string|undefined = 'all',
|
|
574
|
+
showDetailedToolip: boolean|undefined = false): Protocol.Overlay.HighlightConfig {
|
|
575
575
|
const settings = this.target().targetManager().settings;
|
|
576
576
|
const showRulers = settings.resolve(showMetricsRulersSettingDescriptor).get();
|
|
577
577
|
const highlightConfig: Protocol.Overlay.HighlightConfig = {
|
|
@@ -225,7 +225,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
225
225
|
return {loading: loadingCount, resources: this.getScopedResourcesLoaded().size};
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
async #acquireLoadSlot(target: Target|null): Promise<void> {
|
|
229
229
|
this.#currentlyLoading++;
|
|
230
230
|
if (target) {
|
|
231
231
|
const currentCount = this.#currentlyLoadingPerTarget.get(target.id()) || 0;
|
|
@@ -242,7 +242,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
#releaseLoadSlot(target: Target|null): void {
|
|
246
246
|
this.#currentlyLoading--;
|
|
247
247
|
if (target) {
|
|
248
248
|
const currentCount = this.#currentlyLoadingPerTarget.get(target.id());
|
|
@@ -318,8 +318,8 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
318
318
|
this.dispatchEventToListeners(Events.UPDATE);
|
|
319
319
|
const startTime = performance.now();
|
|
320
320
|
try {
|
|
321
|
-
await this
|
|
322
|
-
const resultPromise = this
|
|
321
|
+
await this.#acquireLoadSlot(effectiveInitiator.target);
|
|
322
|
+
const resultPromise = this.#dispatchLoad(url, effectiveInitiator, isBinary, hasExplicitTarget);
|
|
323
323
|
const result = await resultPromise;
|
|
324
324
|
pageResource.errorMessage = result.errorDescription.message;
|
|
325
325
|
pageResource.success = result.success;
|
|
@@ -338,7 +338,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
338
338
|
throw e;
|
|
339
339
|
} finally {
|
|
340
340
|
pageResource.duration = performance.now() - startTime;
|
|
341
|
-
this
|
|
341
|
+
this.#releaseLoadSlot(effectiveInitiator.target);
|
|
342
342
|
this.dispatchEventToListeners(Events.UPDATE);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
@@ -435,8 +435,8 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
435
435
|
return mainFrame.securityOrigin().isSameOriginWith(SecurityOrigin.create(initiator.initiatorUrl));
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
async #dispatchLoad(url: Platform.DevToolsPath.UrlString, initiator: PageResourceLoadInitiator, isBinary: boolean,
|
|
439
|
+
hasExplicitTarget: boolean): Promise<{
|
|
440
440
|
success: boolean,
|
|
441
441
|
content: string|Uint8Array<ArrayBuffer>,
|
|
442
442
|
errorDescription: Host.ResourceLoader.LoadErrorDescription,
|
|
@@ -455,7 +455,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
455
455
|
const eligibleForLoadFromTarget =
|
|
456
456
|
Boolean(loadThroughTarget && parsedURL && parsedURL.scheme !== 'file' && parsedURL.scheme !== 'data' &&
|
|
457
457
|
parsedURL.scheme !== 'devtools' && initiator.target);
|
|
458
|
-
Host.userMetrics.developerResourceScheme(this
|
|
458
|
+
Host.userMetrics.developerResourceScheme(this.#getDeveloperResourceScheme(parsedURL));
|
|
459
459
|
if (eligibleForLoadFromTarget && initiator.target) {
|
|
460
460
|
// Default to enforcing CSP for http(s) resources (fail-closed). Only relax
|
|
461
461
|
// if the isolation-status query positively confirms no connect-src/default-src
|
|
@@ -489,7 +489,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
489
489
|
|
|
490
490
|
try {
|
|
491
491
|
Host.userMetrics.developerResourceLoaded(Host.UserMetrics.DeveloperResourceLoaded.LOAD_THROUGH_PAGE_VIA_TARGET);
|
|
492
|
-
const result = await this
|
|
492
|
+
const result = await this.#loadFromTarget(frameTarget ?? initiator.target, frameId, url, isBinary);
|
|
493
493
|
return result;
|
|
494
494
|
} catch (e) {
|
|
495
495
|
if (e instanceof Error) {
|
|
@@ -526,7 +526,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
const result = await this
|
|
529
|
+
const result = await this.#loadFromHostBindings(url);
|
|
530
530
|
if (eligibleForLoadFromTarget && !result.success) {
|
|
531
531
|
Host.userMetrics.developerResourceLoaded(Host.UserMetrics.DeveloperResourceLoaded.FALLBACK_FAILURE);
|
|
532
532
|
}
|
|
@@ -538,8 +538,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
538
538
|
return result;
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
|
|
542
|
-
Host.UserMetrics.DeveloperResourceScheme {
|
|
541
|
+
#getDeveloperResourceScheme(parsedURL: Common.ParsedURL.ParsedURL|null): Host.UserMetrics.DeveloperResourceScheme {
|
|
543
542
|
if (!parsedURL || parsedURL.scheme === '') {
|
|
544
543
|
return Host.UserMetrics.DeveloperResourceScheme.UKNOWN;
|
|
545
544
|
}
|
|
@@ -561,9 +560,8 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
561
560
|
return Host.UserMetrics.DeveloperResourceScheme.OTHER;
|
|
562
561
|
}
|
|
563
562
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
isBinary: boolean): Promise<{
|
|
563
|
+
async #loadFromTarget(target: Target, frameId: Protocol.Page.FrameId|null, url: Platform.DevToolsPath.UrlString,
|
|
564
|
+
isBinary: boolean): Promise<{
|
|
567
565
|
success: boolean,
|
|
568
566
|
content: string|Uint8Array<ArrayBuffer>,
|
|
569
567
|
errorDescription: {
|
|
@@ -600,7 +598,7 @@ export class PageResourceLoader extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
|
600
598
|
}
|
|
601
599
|
}
|
|
602
600
|
|
|
603
|
-
|
|
601
|
+
async #loadFromHostBindings(url: Platform.DevToolsPath.UrlString): Promise<{
|
|
604
602
|
success: boolean,
|
|
605
603
|
content: string,
|
|
606
604
|
errorDescription: Host.ResourceLoader.LoadErrorDescription,
|
|
@@ -773,7 +773,7 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
773
773
|
}
|
|
774
774
|
|
|
775
775
|
function formatArrayItem(this: LocalJSONObject, property: RemoteObjectProperty): string {
|
|
776
|
-
return this
|
|
776
|
+
return this.#formatValue(property.value || null);
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
function formatObjectItem(this: LocalJSONObject, property: RemoteObjectProperty): string {
|
|
@@ -781,13 +781,13 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
781
781
|
if (/^\s|\s$|^$|\n/.test(name)) {
|
|
782
782
|
name = '"' + name.replace(/\n/g, '\u21B5') + '"';
|
|
783
783
|
}
|
|
784
|
-
return name + ': ' + this
|
|
784
|
+
return name + ': ' + this.#formatValue(property.value || null);
|
|
785
785
|
}
|
|
786
786
|
|
|
787
787
|
if (this.type === 'object') {
|
|
788
788
|
switch (this.subtype) {
|
|
789
789
|
case 'array':
|
|
790
|
-
this.#cachedDescription = this
|
|
790
|
+
this.#cachedDescription = this.#concatenate('[', ']', formatArrayItem.bind(this));
|
|
791
791
|
break;
|
|
792
792
|
case 'date':
|
|
793
793
|
this.#cachedDescription = String(this.#value);
|
|
@@ -796,7 +796,7 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
796
796
|
this.#cachedDescription = 'null';
|
|
797
797
|
break;
|
|
798
798
|
default:
|
|
799
|
-
this.#cachedDescription = this
|
|
799
|
+
this.#cachedDescription = this.#concatenate('{', '}', formatObjectItem.bind(this));
|
|
800
800
|
}
|
|
801
801
|
} else {
|
|
802
802
|
this.#cachedDescription = String(this.#value);
|
|
@@ -805,7 +805,7 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
805
805
|
return this.#cachedDescription;
|
|
806
806
|
}
|
|
807
807
|
|
|
808
|
-
|
|
808
|
+
#formatValue(value: RemoteObject|null): string {
|
|
809
809
|
if (!value) {
|
|
810
810
|
return 'undefined';
|
|
811
811
|
}
|
|
@@ -816,11 +816,11 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
816
816
|
return description;
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
|
|
819
|
+
#concatenate(prefix: string, suffix: string, formatProperty: (arg0: RemoteObjectProperty) => string): string {
|
|
820
820
|
const previewChars = 100;
|
|
821
821
|
|
|
822
822
|
let buffer = prefix;
|
|
823
|
-
const children = this
|
|
823
|
+
const children = this.#children();
|
|
824
824
|
for (let i = 0; i < children.length; ++i) {
|
|
825
825
|
const itemDescription = formatProperty(children[i]);
|
|
826
826
|
if (buffer.length + itemDescription.length > previewChars) {
|
|
@@ -874,7 +874,7 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
874
874
|
return String(index) === name && index < 4294967295;
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
-
let properties = this
|
|
877
|
+
let properties = this.#children();
|
|
878
878
|
if (nonIndexedPropertiesOnly) {
|
|
879
879
|
properties = properties.filter(property => !isArrayIndex(property.name));
|
|
880
880
|
}
|
|
@@ -890,7 +890,7 @@ export class LocalJSONObject extends RemoteObject {
|
|
|
890
890
|
return await this.getOwnProperties(generatePreview, nonIndexedPropertiesOnly);
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
-
|
|
893
|
+
#children(): RemoteObjectProperty[] {
|
|
894
894
|
if (!this.hasChildren) {
|
|
895
895
|
return [];
|
|
896
896
|
}
|
|
@@ -170,7 +170,7 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
|
|
|
170
170
|
if (this.#pendingContentData) {
|
|
171
171
|
return await this.#pendingContentData;
|
|
172
172
|
}
|
|
173
|
-
this.#pendingContentData = this
|
|
173
|
+
this.#pendingContentData = this.#innerRequestContent().then(contentData => {
|
|
174
174
|
// If an error happended we don't set `this.#contentData` so future `requestContentData` will
|
|
175
175
|
// attempt again to hit the backend for this Resource.
|
|
176
176
|
if (!TextUtils.ContentData.ContentData.isError(contentData)) {
|
|
@@ -208,7 +208,7 @@ export class Resource implements TextUtils.ContentProvider.ContentProvider {
|
|
|
208
208
|
image.src = imageSrc ?? ''; // Empty the image if we cannot generate a preview URL
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
async #innerRequestContent(): Promise<TextUtils.ContentData.ContentDataOrError> {
|
|
212
212
|
if (this.request) {
|
|
213
213
|
// The `contentData` promise only resolves once the request is done.
|
|
214
214
|
return await this.request.requestContentData();
|
|
@@ -41,11 +41,11 @@ export class RuntimeModel extends SDKModel<EventTypes> {
|
|
|
41
41
|
void this.agent.invoke_setCustomObjectFormatterEnabled({enabled: true});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
this.#customFormattersSetting.addChangeListener(this
|
|
44
|
+
this.#customFormattersSetting.addChangeListener(this.#customFormattersStateChanged, this);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
override dispose(): void {
|
|
48
|
-
this.#customFormattersSetting.removeChangeListener(this
|
|
48
|
+
this.#customFormattersSetting.removeChangeListener(this.#customFormattersStateChanged, this);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
static isSideEffectFailure(response: Protocol.Runtime.EvaluateResponse|EvaluationResult): boolean {
|
|
@@ -176,7 +176,7 @@ export class RuntimeModel extends SDKModel<EventTypes> {
|
|
|
176
176
|
void this.agent.invoke_runIfWaitingForDebugger();
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
#customFormattersStateChanged({data: enabled}: Common.EventTarget.EventTargetEvent<boolean>): void {
|
|
180
180
|
void this.agent.invoke_setCustomObjectFormatterEnabled({enabled});
|
|
181
181
|
}
|
|
182
182
|
|
|
@@ -258,12 +258,12 @@ export class RuntimeModel extends SDKModel<EventTypes> {
|
|
|
258
258
|
|
|
259
259
|
if (hints !== null && typeof hints === 'object') {
|
|
260
260
|
if ('copyToClipboard' in hints && Boolean(hints.copyToClipboard)) {
|
|
261
|
-
this
|
|
261
|
+
this.#copyRequested(object);
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
if ('queryObjects' in hints && hints.queryObjects) {
|
|
266
|
-
void this
|
|
266
|
+
void this.#queryObjectsRequested(object, executionContextId);
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -301,7 +301,7 @@ export class RuntimeModel extends SDKModel<EventTypes> {
|
|
|
301
301
|
this.dispatchEventToListeners(Events.BindingCalled, event);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
|
|
304
|
+
#copyRequested(object: RemoteObject): void {
|
|
305
305
|
if (!object.objectId) {
|
|
306
306
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(
|
|
307
307
|
object.unserializableValue() || (object.value as string));
|
|
@@ -324,7 +324,7 @@ export class RuntimeModel extends SDKModel<EventTypes> {
|
|
|
324
324
|
Host.InspectorFrontendHost.InspectorFrontendHostInstance));
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
async #queryObjectsRequested(object: RemoteObject, executionContextId?: number): Promise<void> {
|
|
328
328
|
const result = await this.queryObjects(object);
|
|
329
329
|
object.release();
|
|
330
330
|
if ('error' in result) {
|
|
@@ -150,7 +150,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
|
150
150
|
return this.debuggerModel.target();
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
static #trimSourceURLComment(source: string): string {
|
|
154
154
|
let sourceURLIndex = source.lastIndexOf('//# sourceURL=');
|
|
155
155
|
if (sourceURLIndex === -1) {
|
|
156
156
|
sourceURLIndex = source.lastIndexOf('//@ sourceURL=');
|
|
@@ -201,7 +201,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
|
201
201
|
return Common.ResourceType.resourceTypes.Script;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
async #loadTextContent(): Promise<TextUtils.ContentData.ContentData> {
|
|
205
205
|
const result = await this.debuggerModel.target().debuggerAgent().invoke_getScriptSource({scriptId: this.scriptId});
|
|
206
206
|
if (result.getError()) {
|
|
207
207
|
throw new Error(result.getError());
|
|
@@ -214,12 +214,12 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
|
214
214
|
if (this.hasSourceURL && Common.ParsedURL.schemeIs(this.sourceURL, 'snippet:')) {
|
|
215
215
|
// TODO(crbug.com/1330846): Find a better way to establish the snippet automapping binding then adding
|
|
216
216
|
// a sourceURL comment before evaluation and removing it here.
|
|
217
|
-
content = Script
|
|
217
|
+
content = Script.#trimSourceURLComment(content);
|
|
218
218
|
}
|
|
219
219
|
return new TextUtils.ContentData.ContentData(content, /* isBase64 */ false, 'text/javascript');
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
|
|
222
|
+
async #loadWasmContent(): Promise<TextUtils.ContentData.ContentDataOrError> {
|
|
223
223
|
if (!this.isWasm()) {
|
|
224
224
|
throw new Error('Not a wasm script');
|
|
225
225
|
}
|
|
@@ -229,7 +229,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
|
229
229
|
if (result.getError()) {
|
|
230
230
|
// Fall through to text content loading if v8-based disassembly fails. This is to ensure backwards compatibility with
|
|
231
231
|
// older v8 versions.
|
|
232
|
-
const contentData = await this
|
|
232
|
+
const contentData = await this.#loadTextContent();
|
|
233
233
|
return await disassembleWasm(contentData.base64);
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -316,7 +316,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
|
|
316
316
|
return {error: i18nString(UIStrings.scriptRemovedOrDeleted)};
|
|
317
317
|
}
|
|
318
318
|
try {
|
|
319
|
-
return this.isWasm() ? await this
|
|
319
|
+
return this.isWasm() ? await this.#loadWasmContent() : await this.#loadTextContent();
|
|
320
320
|
} catch {
|
|
321
321
|
// TODO(bmeurer): Propagate errors as exceptions / rejections.
|
|
322
322
|
return {error: i18nString(UIStrings.unableToFetchScriptSource)};
|
|
@@ -478,19 +478,45 @@ export class ServiceWorkerVersion {
|
|
|
478
478
|
return urlPattern;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
private parseCondition(condition: Protocol.ServiceWorker.ServiceWorkerRouterCondition): Record<string, unknown>|null {
|
|
482
|
+
const result: Record<string, unknown> = {...condition};
|
|
483
|
+
// "urlPattern" condition can have structural URLPatternInit encoded into a JSON string.
|
|
484
|
+
// If `condition` is directly stringified, such JSON strings are double-escaped (`"abc"` -> `\"abc\""`).
|
|
485
|
+
// Expand "urlPattern" condition to native object and stringify whole conditions in such cases to avoid this.
|
|
486
|
+
if (condition.urlPattern !== undefined) {
|
|
487
|
+
result.urlPattern = this.parseURLPatternCondition(condition.urlPattern);
|
|
488
|
+
if (result.urlPattern === null) {
|
|
489
|
+
console.error('Parse error: Invalid "urlPattern" condition in `typedRouterRules` in ServiceWorkerVersion');
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (condition.or !== undefined) {
|
|
494
|
+
const parsedOr: Array<Record<string, unknown>> = [];
|
|
495
|
+
for (const subCondition of condition.or) {
|
|
496
|
+
const parsedSub = this.parseCondition(subCondition);
|
|
497
|
+
if (parsedSub === null) {
|
|
498
|
+
return null;
|
|
499
|
+
}
|
|
500
|
+
parsedOr.push(parsedSub);
|
|
501
|
+
}
|
|
502
|
+
result.or = parsedOr;
|
|
503
|
+
}
|
|
504
|
+
if (condition.not !== undefined) {
|
|
505
|
+
const parsedNot = this.parseCondition(condition.not);
|
|
506
|
+
if (parsedNot === null) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
result.not = parsedNot;
|
|
510
|
+
}
|
|
511
|
+
return result;
|
|
512
|
+
}
|
|
513
|
+
|
|
481
514
|
private parseTypedRules(rules: Protocol.ServiceWorker.ServiceWorkerRouterRule[]): ServiceWorkerRouterRule[]|null {
|
|
482
515
|
const routerRules: ServiceWorkerRouterRule[] = [];
|
|
483
516
|
for (const rule of rules) {
|
|
484
|
-
const condition
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
// Expand "urlPattern" condition to native object and stringify whole conditions in such cases to avoid this.
|
|
488
|
-
if (rule.condition.urlPattern) {
|
|
489
|
-
condition.urlPattern = this.parseURLPatternCondition(rule.condition.urlPattern);
|
|
490
|
-
if (condition.urlPattern === null) {
|
|
491
|
-
console.error('Parse error: Invalid "urlPattern" condition in `typedRouterRules` in ServiceWorkerVersion');
|
|
492
|
-
return null;
|
|
493
|
-
}
|
|
517
|
+
const condition = this.parseCondition(rule.condition);
|
|
518
|
+
if (condition === null) {
|
|
519
|
+
return null;
|
|
494
520
|
}
|
|
495
521
|
let source: Protocol.ServiceWorker.ServiceWorkerRouterSourceType|
|
|
496
522
|
Protocol.ServiceWorker.ServiceWorkerRouterSourceDict;
|
|
@@ -184,7 +184,7 @@ export class SourceMap {
|
|
|
184
184
|
this.#console.warn(`SourceMap "${sourceMappingURL}" contains unsupported "URL" field in one of its sections.`);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
this
|
|
187
|
+
this.#eachSection(this.#parseSources.bind(this));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
provenance(): SourceMapProvenance {
|
|
@@ -313,7 +313,7 @@ export class SourceMap {
|
|
|
313
313
|
mappings[startIndex].lineNumber, mappings[startIndex].columnNumber, endLine, endColumn);
|
|
314
314
|
|
|
315
315
|
// Now try to find the corresponding token in the original code.
|
|
316
|
-
const reverseMappings = this
|
|
316
|
+
const reverseMappings = this.#reversedMappings(sourceURL);
|
|
317
317
|
const startSourceLine = mappings[startIndex].sourceLineNumber;
|
|
318
318
|
const startSourceColumn = mappings[startIndex].sourceColumnNumber;
|
|
319
319
|
const endReverseIndex = Platform.ArrayUtilities.upperBound(
|
|
@@ -337,7 +337,7 @@ export class SourceMap {
|
|
|
337
337
|
sourceLineMapping(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number):
|
|
338
338
|
SourceMapEntry|null {
|
|
339
339
|
const mappings = this.mappings();
|
|
340
|
-
const reverseMappings = this
|
|
340
|
+
const reverseMappings = this.#reversedMappings(sourceURL);
|
|
341
341
|
const first = Platform.ArrayUtilities.lowerBound(reverseMappings, lineNumber, lineComparator);
|
|
342
342
|
const last = Platform.ArrayUtilities.upperBound(reverseMappings, lineNumber, lineComparator);
|
|
343
343
|
if (first >= reverseMappings.length || mappings[reverseMappings[first]].sourceLineNumber !== lineNumber) {
|
|
@@ -357,10 +357,9 @@ export class SourceMap {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
|
|
361
|
-
number[] {
|
|
360
|
+
#findReverseIndices(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number): number[] {
|
|
362
361
|
const mappings = this.mappings();
|
|
363
|
-
const reverseMappings = this
|
|
362
|
+
const reverseMappings = this.#reversedMappings(sourceURL);
|
|
364
363
|
const endIndex = Platform.ArrayUtilities.upperBound(
|
|
365
364
|
reverseMappings, undefined,
|
|
366
365
|
(_, i) => lineNumber - mappings[i].sourceLineNumber || columnNumber - mappings[i].sourceColumnNumber);
|
|
@@ -380,7 +379,7 @@ export class SourceMap {
|
|
|
380
379
|
sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number,
|
|
381
380
|
filterContiguous = false): SourceMapEntry[] {
|
|
382
381
|
const mappings = this.mappings();
|
|
383
|
-
let indices = this
|
|
382
|
+
let indices = this.#findReverseIndices(sourceURL, lineNumber, columnNumber);
|
|
384
383
|
if (filterContiguous) {
|
|
385
384
|
indices = indices.filter((index, i) => i === 0 || index !== indices[i - 1] + 1);
|
|
386
385
|
}
|
|
@@ -390,7 +389,7 @@ export class SourceMap {
|
|
|
390
389
|
findReverseRanges(sourceURL: Platform.DevToolsPath.UrlString, lineNumber: number, columnNumber: number):
|
|
391
390
|
TextUtils.TextRange.TextRange[] {
|
|
392
391
|
const mappings = this.mappings();
|
|
393
|
-
const indices = this
|
|
392
|
+
const indices = this.#findReverseIndices(sourceURL, lineNumber, columnNumber);
|
|
394
393
|
const ranges: TextUtils.TextRange.TextRange[] = [];
|
|
395
394
|
|
|
396
395
|
for (let i = 0; i < indices.length; ++i) {
|
|
@@ -440,7 +439,7 @@ export class SourceMap {
|
|
|
440
439
|
return SourceMapScopesInfo.createFromAst(this, scopeTree, text);
|
|
441
440
|
}
|
|
442
441
|
|
|
443
|
-
|
|
442
|
+
#reversedMappings(sourceURL: Platform.DevToolsPath.UrlString): number[] {
|
|
444
443
|
this.#ensureSourceMapProcessed();
|
|
445
444
|
return this.#sourceInfoByURL.get(sourceURL)?.reverseMappings ?? [];
|
|
446
445
|
}
|
|
@@ -449,7 +448,7 @@ export class SourceMap {
|
|
|
449
448
|
if (this.#mappings === null) {
|
|
450
449
|
this.#mappings = [];
|
|
451
450
|
try {
|
|
452
|
-
this
|
|
451
|
+
this.#eachSection(this.#parseMap.bind(this));
|
|
453
452
|
if (!this.hasScopeInfo()) {
|
|
454
453
|
this.#scopesFallbackPromise = this.#buildScopesFallback().then(info => {
|
|
455
454
|
this.#scopesInfo = info;
|
|
@@ -503,7 +502,7 @@ export class SourceMap {
|
|
|
503
502
|
}
|
|
504
503
|
}
|
|
505
504
|
|
|
506
|
-
|
|
505
|
+
#eachSection(callback: (arg0: SourceMapV3Object, arg1: number, arg2: number, arg3: number) => void): void {
|
|
507
506
|
if (!this.#json) {
|
|
508
507
|
return;
|
|
509
508
|
}
|
|
@@ -520,7 +519,7 @@ export class SourceMap {
|
|
|
520
519
|
}
|
|
521
520
|
}
|
|
522
521
|
|
|
523
|
-
|
|
522
|
+
#parseSources(sourceMap: SourceMapV3Object): void {
|
|
524
523
|
const sourceRoot = sourceMap.sourceRoot ?? '';
|
|
525
524
|
const ignoreList = new Set(sourceMap.ignoreList ?? sourceMap.x_google_ignoreList);
|
|
526
525
|
for (let i = 0; i < sourceMap.sources.length; ++i) {
|
|
@@ -553,8 +552,7 @@ export class SourceMap {
|
|
|
553
552
|
}
|
|
554
553
|
}
|
|
555
554
|
|
|
556
|
-
|
|
557
|
-
void {
|
|
555
|
+
#parseMap(map: SourceMapV3Object, baseSourceIndex: number, baseLineNumber: number, baseColumnNumber: number): void {
|
|
558
556
|
let sourceIndex = baseSourceIndex;
|
|
559
557
|
let lineNumber = baseLineNumber;
|
|
560
558
|
let columnNumber = baseColumnNumber;
|
|
@@ -596,7 +594,7 @@ export class SourceMap {
|
|
|
596
594
|
}
|
|
597
595
|
|
|
598
596
|
columnNumber += tokenIter.nextVLQ();
|
|
599
|
-
if (!tokenIter.hasNext() || this
|
|
597
|
+
if (!tokenIter.hasNext() || this.#isSeparator(tokenIter.peek())) {
|
|
600
598
|
pushEntry(new SourceMapEntry(lineNumber, columnNumber));
|
|
601
599
|
continue;
|
|
602
600
|
}
|
|
@@ -609,7 +607,7 @@ export class SourceMap {
|
|
|
609
607
|
sourceLineNumber += tokenIter.nextVLQ();
|
|
610
608
|
sourceColumnNumber += tokenIter.nextVLQ();
|
|
611
609
|
|
|
612
|
-
if (!tokenIter.hasNext() || this
|
|
610
|
+
if (!tokenIter.hasNext() || this.#isSeparator(tokenIter.peek())) {
|
|
613
611
|
pushEntry(
|
|
614
612
|
new SourceMapEntry(lineNumber, columnNumber, sourceIndex, sourceURL, sourceLineNumber, sourceColumnNumber));
|
|
615
613
|
continue;
|
|
@@ -632,7 +630,7 @@ export class SourceMap {
|
|
|
632
630
|
this.#scopesInfo.addOriginalScopes(scopes.length ? scopes : new Array(map.sources.length).fill(null));
|
|
633
631
|
this.#scopesInfo.addGeneratedRanges(ranges);
|
|
634
632
|
} else if (map.x_com_bloomberg_sourcesFunctionMappings) {
|
|
635
|
-
const originalScopes = this
|
|
633
|
+
const originalScopes = this.#parseBloombergScopes(map);
|
|
636
634
|
this.#scopesInfo.addOriginalScopes(originalScopes);
|
|
637
635
|
} else {
|
|
638
636
|
// Keep the OriginalScope[] tree array consistent with sources.
|
|
@@ -678,7 +676,7 @@ export class SourceMap {
|
|
|
678
676
|
}
|
|
679
677
|
}
|
|
680
678
|
|
|
681
|
-
|
|
679
|
+
#parseBloombergScopes(map: SourceMapV3Object): Array<ScopesCodec.OriginalScope[]|null> {
|
|
682
680
|
const scopeList = map.x_com_bloomberg_sourcesFunctionMappings;
|
|
683
681
|
if (!scopeList) {
|
|
684
682
|
throw new Error('Cant decode pasta scopes without x_com_bloomberg_sourcesFunctionMappings field');
|
|
@@ -696,7 +694,7 @@ export class SourceMap {
|
|
|
696
694
|
});
|
|
697
695
|
}
|
|
698
696
|
|
|
699
|
-
|
|
697
|
+
#isSeparator(char: string): boolean {
|
|
700
698
|
return char === ',' || char === ';';
|
|
701
699
|
}
|
|
702
700
|
|
|
@@ -713,7 +711,7 @@ export class SourceMap {
|
|
|
713
711
|
*/
|
|
714
712
|
reverseMapTextRanges(url: Platform.DevToolsPath.UrlString, textRange: TextUtils.TextRange.TextRange):
|
|
715
713
|
TextUtils.TextRange.TextRange[] {
|
|
716
|
-
const reverseMappings = this
|
|
714
|
+
const reverseMappings = this.#reversedMappings(url);
|
|
717
715
|
const mappings = this.mappings();
|
|
718
716
|
if (reverseMappings.length === 0) {
|
|
719
717
|
return [];
|