chrome-devtools-frontend 1.0.1690116 → 1.0.1695017
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-model-management/SKILL.md +3 -3
- package/.agents/skills/foundation-test-migration/SKILL.md +2 -2
- package/.agents/skills/merging-devtools-module/SKILL.md +5 -5
- package/AUTHORS +3 -0
- package/config/typescript/tsconfig.base.json +1 -0
- package/docs/get_the_code.md +4 -9
- package/front_end/Images/src/comment-mode-cursor.svg +23 -0
- package/front_end/Tests.js +1 -1
- package/front_end/application_tokens.css +5 -0
- package/front_end/core/common/ColorConverter.ts +3 -3
- package/front_end/core/host/UserMetrics.ts +27 -0
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +0 -46
- package/front_end/core/protocol_client/InspectorBackend.ts +6 -6
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/CSSLocation.ts +32 -0
- package/front_end/core/sdk/CSSModel.ts +2 -22
- package/front_end/core/sdk/CSSQuery.ts +2 -1
- package/front_end/core/sdk/CSSRule.ts +29 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -1
- package/front_end/core/sdk/NetworkManager.ts +2 -0
- package/front_end/core/sdk/NetworkRequest.ts +63 -4
- package/front_end/core/sdk/NetworkRequestAccess.ts +191 -0
- package/front_end/core/sdk/ResourceTreeModel.ts +72 -23
- package/front_end/core/sdk/SecurityOrigin.ts +97 -12
- package/front_end/core/sdk/Target.ts +18 -0
- package/front_end/core/sdk/sdk.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/foundation/Universe.ts +14 -11
- package/front_end/generated/Deprecation.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +9 -8
- package/front_end/generated/SupportedCSSProperties.ts +14 -4
- package/front_end/generated/protocol.ts +24 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +46 -10
- package/front_end/models/ai_assistance/AiConversation.ts +35 -24
- package/front_end/models/ai_assistance/README.md +5 -3
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +1 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +28 -34
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +13 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +5 -3
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +16 -10
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +3 -4
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -2
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +11 -2
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +17 -5
- package/front_end/models/ai_assistance/contexts/FileContext.ts +13 -6
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +52 -25
- package/front_end/models/ai_assistance/contexts/RequestContext.ts +18 -34
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +14 -3
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +2 -5
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +135 -58
- package/front_end/models/ai_assistance/tools/CookieUtils.ts +25 -35
- package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +6 -3
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +9 -2
- package/front_end/models/ai_assistance/tools/GetCookieValues.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +3 -5
- package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +8 -11
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +2 -4
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +6 -13
- package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetStorageValues.ts +9 -9
- package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -2
- package/front_end/models/ai_assistance/tools/ListCookies.ts +1 -1
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +6 -14
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +10 -15
- package/front_end/models/ai_assistance/tools/ListSources.ts +5 -7
- package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +9 -9
- package/front_end/models/ai_assistance/tools/README.md +4 -2
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +3 -2
- package/front_end/models/ai_assistance/tools/Tool.ts +27 -3
- package/front_end/models/comment_manager/CD4ABridge.ts +128 -0
- package/front_end/models/comment_manager/CommentManager.ts +50 -8
- package/front_end/models/comment_manager/comment_manager.ts +2 -0
- package/front_end/models/emulation/DeviceModeModel.ts +37 -47
- package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -1
- package/front_end/models/live-metrics/web-vitals-injected/README.md +1 -1
- package/front_end/models/source_map_scopes/NamesResolver.ts +9 -7
- package/front_end/models/trace/ModelImpl.ts +2 -0
- package/front_end/models/trace/Processor.ts +6 -4
- package/front_end/models/trace/handlers/LayerTreeHandler.ts +3 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +1 -1
- package/front_end/models/trace/helpers/SyntheticEvents.ts +23 -1
- package/front_end/models/trace/types/Configuration.ts +7 -0
- package/front_end/models/trace/types/TraceEvents.ts +20 -4
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -0
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingListView.ts +177 -0
- package/front_end/panels/accessibility/accessibility.ts +2 -0
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingListView.css +33 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +25 -15
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +6 -35
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +4 -3
- package/front_end/panels/ai_assistance/components/chatMessage.css +3 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -0
- package/front_end/panels/application/CrashReportContextView.ts +0 -1
- package/front_end/panels/application/FrameDetailsView.ts +5 -4
- package/front_end/panels/application/IndexedDBViews.ts +4 -4
- package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +2 -1
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +1 -1
- package/front_end/panels/application/indexedDBViews.css +0 -14
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +12 -6
- package/front_end/panels/common/DOMLinkifier.ts +1 -1
- package/front_end/panels/common/ExtensionView.ts +2 -1
- package/front_end/panels/console/ConsoleContextSelector.ts +12 -5
- package/front_end/panels/console/ConsolePinPane.ts +4 -2
- package/front_end/panels/console/ConsoleSidebar.ts +6 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +12 -8
- package/front_end/panels/console/PromptBuilder.ts +1 -1
- package/front_end/panels/coverage/CoverageListView.ts +1 -1
- package/front_end/panels/coverage/CoverageModel.ts +6 -4
- package/front_end/panels/coverage/coverageView.css +8 -8
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +13 -14
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewStartView.ts +3 -3
- package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
- package/front_end/panels/developer_resources/developerResourcesView.css +3 -3
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +43 -15
- package/front_end/panels/elements/ElementsTreeOutline.ts +185 -109
- package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
- package/front_end/panels/elements/PropertyNameCategories.ts +1 -1
- package/front_end/panels/elements/ShortcutTreeElement.ts +6 -1
- package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +2 -35
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
- package/front_end/panels/elements/components/CSSPropertyIconResolver.ts +5 -4
- package/front_end/panels/elements/components/StylePropertyEditor.ts +161 -148
- package/front_end/panels/elements/components/computedStyleProperty.css +5 -5
- package/front_end/panels/elements/components/computedStyleTrace.css +5 -5
- package/front_end/panels/elements/components/cssHintDetailsView.css +1 -1
- package/front_end/panels/elements/components/cssPropertyDocsView.css +3 -3
- package/front_end/panels/elements/components/cssVariableValueView.css +4 -4
- package/front_end/panels/elements/components/elementsBreadcrumbs.css +3 -3
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +5 -5
- package/front_end/panels/elements/components/queryContainer.css +2 -2
- package/front_end/panels/elements/elementsTreeOutline.css +20 -4
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -1
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/issues/AffectedElementsView.ts +3 -0
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +1 -1
- package/front_end/panels/issues/issues.ts +2 -0
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +12 -10
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +1 -0
- package/front_end/panels/layer_viewer/Layers3DView.ts +13 -11
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspectorUtils.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +11 -11
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryNavigator.css +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +5 -5
- package/front_end/panels/linear_memory_inspector/components/linearMemoryViewer.css +6 -6
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +6 -6
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +2 -2
- package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
- package/front_end/panels/media/TickingFlameChart.ts +3 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +2 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +2 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +11 -9
- package/front_end/panels/network/NetworkLogView.ts +4 -1
- package/front_end/panels/network/NetworkLogViewColumns.ts +5 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +47 -11
- package/front_end/panels/network/RequestPayloadView.ts +1 -1
- package/front_end/panels/network/RequestResponseView.ts +1 -1
- package/front_end/panels/network/RequestTimingView.ts +1 -1
- package/front_end/panels/network/ShowMoreDetailsWidget.ts +1 -1
- package/front_end/panels/network/components/RequestHeadersView.css +12 -0
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +3 -3
- package/front_end/panels/recorder/RecordingListView.ts +0 -6
- package/front_end/panels/recorder/RecordingView.ts +0 -6
- package/front_end/panels/recorder/controlButton.css +10 -10
- package/front_end/panels/recorder/startView.css +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +4 -2
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +46 -35
- package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -6
- package/front_end/panels/sources/ProfilePlugin.ts +2 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/timeline/IsolateSelector.ts +1 -1
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/NetworkTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +0 -32
- package/front_end/panels/timeline/TimelineHistoryManager.ts +1 -1
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +7 -3
- package/front_end/panels/timeline/TimelinePanel.ts +3 -20
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +4 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +25 -24
- package/front_end/panels/timeline/components/RelatedInsightChips.ts +4 -3
- package/front_end/panels/timeline/components/Sidebar.ts +1 -1
- package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +4 -3
- package/front_end/panels/timeline/components/cwvMetrics.css +2 -2
- package/front_end/panels/timeline/components/insights/checklist.css +1 -1
- package/front_end/panels/timeline/components/insights/table.css +3 -3
- package/front_end/panels/timeline/overlays/components/entriesLinkOverlay.css +4 -4
- package/front_end/panels/timeline/overlays/components/entryLabelOverlay.css +4 -4
- package/front_end/panels/timeline/overlays/components/timeRangeOverlay.css +2 -2
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +4 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -74
- package/front_end/panels/timeline/utils/Helpers.ts +1 -1
- package/front_end/panels/timeline/utils/ImageCache.ts +5 -3
- package/front_end/panels/web_audio/WebAudioView.ts +3 -3
- package/front_end/panels/web_audio/webAudio.css +5 -5
- package/front_end/panels/webauthn/WebauthnPane.ts +5 -11
- package/front_end/third_party/acorn/acorn.ts +3 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/chromium/ahem/ahem.d.ts +1 -0
- package/front_end/third_party/csp_evaluator/package/csp.ts +4 -4
- package/front_end/third_party/csp_evaluator/package/parser.ts +3 -1
- package/front_end/third_party/csp_evaluator/package/tsconfig.json +1 -0
- package/front_end/third_party/csp_evaluator/package/utils.ts +1 -1
- package/front_end/third_party/diff/DiffWrapper.ts +1 -8
- package/front_end/third_party/diff/diff_match_patch.d.ts +10 -0
- package/front_end/third_party/json5/json5.ts +2 -2
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +183 -4
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +708 -122
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +85 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +84 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.d.ts +75 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.js +102 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/ScreenRecording.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.d.ts +31 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.js +138 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ScreenRecording.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/bidi.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +23 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +6 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.d.ts +31 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js +131 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ScreenRecording.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +7 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +42 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.js +265 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Device.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +24 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts +23 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +49 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +183 -4
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +143 -11
- package/front_end/third_party/puppeteer/package/src/api/ScreenRecording.ts +145 -0
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/bidi/ScreenRecording.ts +106 -0
- package/front_end/third_party/puppeteer/package/src/bidi/bidi.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +41 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ScreenRecording.ts +101 -0
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +17 -9
- package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +46 -0
- package/front_end/third_party/puppeteer/package/src/common/Device.ts +287 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +30 -1
- package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +73 -2
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +3 -0
- package/front_end/tsconfig.json +1 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +8 -3
- package/front_end/ui/comments/CommentOverlayManager.ts +53 -12
- package/front_end/ui/comments/CommentsOverlayWidget.ts +3 -3
- package/front_end/ui/comments/CommentsStatusBarPill.ts +96 -0
- package/front_end/ui/comments/comments-meta.ts +21 -0
- package/front_end/ui/comments/comments.ts +2 -0
- package/front_end/ui/comments/commentsOverlay.css +22 -3
- package/front_end/ui/components/buttons/floatingButton.css +25 -0
- package/front_end/ui/components/markdown_view/MarkdownView.ts +31 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +45 -25
- package/front_end/ui/kit/icons/Icon.ts +0 -1
- package/front_end/ui/kit/link/Link.ts +8 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/DropTarget.ts +6 -1
- package/front_end/ui/legacy/EmptyWidget.ts +1 -1
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +17 -1
- package/front_end/ui/legacy/ShortcutRegistry.ts +2 -2
- package/front_end/ui/legacy/SplitWidget.ts +18 -3
- package/front_end/ui/legacy/StackedPane.ts +1 -1
- package/front_end/ui/legacy/StatusBar.ts +78 -0
- package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -1
- package/front_end/ui/legacy/TextPrompt.ts +2 -1
- package/front_end/ui/legacy/Toolbar.ts +5 -1
- package/front_end/ui/legacy/Treeoutline.ts +91 -48
- package/front_end/ui/legacy/UIUtils.ts +8 -4
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/ViewRegistration.ts +1 -0
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +7 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -2
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +23 -23
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +48 -44
- package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.docs.ts +83 -0
- package/front_end/ui/legacy/components/inline_editor/PositionAreaEditor.ts +600 -0
- package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/colorMixSwatch.css +4 -4
- package/front_end/ui/legacy/components/inline_editor/cssAngleSwatch.css +3 -3
- package/front_end/ui/legacy/components/inline_editor/inline_editor.ts +2 -0
- package/front_end/ui/legacy/components/inline_editor/linkSwatch.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/positionAreaEditor.css +154 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +224 -127
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +10 -7
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +25 -106
- package/front_end/ui/legacy/components/object_ui/customPreviewComponent.css +7 -3
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -66
- package/front_end/ui/legacy/components/perf_ui/perf_ui.ts +0 -2
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +7 -5
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +8 -5
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -5
- package/front_end/ui/legacy/inspectorCommon.css +41 -6
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/legacy/statusBar.css +18 -0
- package/front_end/ui/visual_logging/Debugging.ts +2 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -1
- package/front_end/ui/visual_logging/LoggingDriver.ts +3 -3
- package/front_end/ui/visual_logging/LoggingEvents.ts +5 -5
- package/front_end/ui/visual_logging/LoggingState.ts +1 -1
- package/front_end/ui/visual_logging/visual_logging.ts +67 -56
- package/inspector_overlay/main.ts +8 -8
- package/mcp/mcp.ts +5 -0
- package/package.json +2 -8
- package/front_end/Images/generate-css-vars.js +0 -52
- package/front_end/Images/rollup.config.mjs +0 -36
- package/front_end/models/ai_assistance/AiOrigins.ts +0 -107
- package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +0 -20
- package/front_end/panels/recorder/injected/rollup.config.mjs +0 -20
- package/front_end/panels/timeline/EasterEgg.d.ts +0 -6
- package/front_end/panels/timeline/easter-egg-tsconfig.json +0 -8
- package/front_end/panels/timeline/enable-easter-egg.js +0 -20
- package/front_end/third_party/acorn/acorn-tsconfig.json +0 -12
- package/front_end/third_party/acorn/estree-tsconfig.json +0 -8
- package/front_end/third_party/chromium/client-variations/client-variations-tsconfig.json +0 -8
- package/front_end/third_party/codemirror/codemirror-legacy-types-tsconfig.json +0 -8
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +0 -15
- package/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
- package/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
- package/front_end/third_party/json5/json5-tsconfig.json +0 -8
- package/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
- package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +0 -11
- package/front_end/third_party/lighthouse/report/bundle-tsconfig.json +0 -8
- package/front_end/third_party/lit/lit-tsconfig.json +0 -15
- package/front_end/third_party/marked/marked-tsconfig.json +0 -8
- package/front_end/third_party/puppeteer-replay/puppeteer-replay-tsconfig.json +0 -8
- package/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
- package/front_end/third_party/wasmparser/wasmparser-tsconfig.json +0 -9
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +0 -47
- package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +0 -606
- package/inspector_overlay/loadCSS.rollup.js +0 -29
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
type BaseToolCapability,
|
|
14
14
|
type DataHandlerResult,
|
|
15
15
|
type DataTool,
|
|
16
|
+
isOriginAllowedByLock,
|
|
17
|
+
type OriginLockCapability,
|
|
16
18
|
type PageExecutionCapability,
|
|
17
19
|
type StyleMutationCapability,
|
|
18
20
|
type ToolArgs,
|
|
@@ -30,7 +32,8 @@ export interface ExecuteJavaScriptArgs extends ToolArgs {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export class ExecuteJavaScriptTool implements
|
|
33
|
-
DataTool<ExecuteJavaScriptArgs, unknown,
|
|
35
|
+
DataTool<ExecuteJavaScriptArgs, unknown,
|
|
36
|
+
BaseToolCapability&PageExecutionCapability&StyleMutationCapability&OriginLockCapability> {
|
|
34
37
|
readonly name: ToolName = ToolName.EXECUTE_JAVASCRIPT;
|
|
35
38
|
|
|
36
39
|
readonly description: string =
|
|
@@ -120,7 +123,7 @@ const data = {
|
|
|
120
123
|
|
|
121
124
|
async handler(
|
|
122
125
|
params: ExecuteJavaScriptArgs,
|
|
123
|
-
context: BaseToolCapability&PageExecutionCapability&StyleMutationCapability,
|
|
126
|
+
context: BaseToolCapability&PageExecutionCapability&StyleMutationCapability&OriginLockCapability,
|
|
124
127
|
options?: FunctionHandlerOptions,
|
|
125
128
|
): Promise<DataHandlerResult<unknown>> {
|
|
126
129
|
const executionNode = context.getExecutionContextNode();
|
|
@@ -128,6 +131,10 @@ const data = {
|
|
|
128
131
|
return {error: 'Error: Could not find the context node for execution.'};
|
|
129
132
|
}
|
|
130
133
|
|
|
134
|
+
if (!isOriginAllowedByLock(context.getEstablishedOrigin(), executionNode.securityOrigin())) {
|
|
135
|
+
return {error: 'Error: Cannot execute JavaScript on cross-origin target.'};
|
|
136
|
+
}
|
|
137
|
+
|
|
131
138
|
if (Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled) {
|
|
132
139
|
const validationResult = await ExecuteJavaScriptTool.validateAndFormatCode(params.code);
|
|
133
140
|
if (validationResult.error) {
|
|
@@ -110,7 +110,7 @@ export class GetCookieValuesTool implements DataTool<GetCookieValuesArgs, GetCoo
|
|
|
110
110
|
const cookiesByOrigin: GetCookieValuesResult['cookiesByOrigin'] = {};
|
|
111
111
|
|
|
112
112
|
await Promise.all(targetOrigins.map(async origin => {
|
|
113
|
-
const result = await getCookiesForOrigin(origin,
|
|
113
|
+
const result = await getCookiesForOrigin(origin, primaryPageTarget);
|
|
114
114
|
if ('error' in result) {
|
|
115
115
|
cookiesByOrigin[origin] = {error: result.error};
|
|
116
116
|
return;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type BaseToolCapability,
|
|
13
13
|
type DataHandlerResult,
|
|
14
14
|
type DataTool,
|
|
15
|
+
isOriginAllowedByLock,
|
|
15
16
|
type OriginLockCapability,
|
|
16
17
|
type TargetCapability,
|
|
17
18
|
type ToolArgs,
|
|
@@ -81,7 +82,7 @@ export class GetElementAccessibilityDetailsTool implements
|
|
|
81
82
|
context: BaseToolCapability&TargetCapability&OriginLockCapability,
|
|
82
83
|
): Promise<DataHandlerResult<string>> {
|
|
83
84
|
const establishedOrigin = context.getEstablishedOrigin();
|
|
84
|
-
if (!establishedOrigin) {
|
|
85
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
85
86
|
return {error: 'Error: Origin lock is not established.'};
|
|
86
87
|
}
|
|
87
88
|
|
|
@@ -101,7 +102,7 @@ export class GetElementAccessibilityDetailsTool implements
|
|
|
101
102
|
|
|
102
103
|
const nodeContext = new DOMNodeContext(resolved);
|
|
103
104
|
// Security check: Ensure the element matches the active conversation's origin lock.
|
|
104
|
-
if (!nodeContext.
|
|
105
|
+
if (!isOriginAllowedByLock(establishedOrigin, nodeContext.getOrigin())) {
|
|
105
106
|
return {error: 'Error: Node does not belong to the locked origin.'};
|
|
106
107
|
}
|
|
107
108
|
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
|
-
import {canResourceContentsBeReadForTrace} from '../AiOrigins.js';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
type BaseToolCapability,
|
|
@@ -77,7 +76,7 @@ export class GetFunctionCodeTool implements
|
|
|
77
76
|
return {error: 'Performance trace context is not available.'};
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
if (performanceTraceContext.
|
|
79
|
+
if (performanceTraceContext.isImported()) {
|
|
81
80
|
return {error: 'Cannot use this tool on an imported file.'};
|
|
82
81
|
}
|
|
83
82
|
|
|
@@ -85,9 +84,8 @@ export class GetFunctionCodeTool implements
|
|
|
85
84
|
return {error: 'Missing arg: scriptUrl'};
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return {error: 'Script not found'};
|
|
87
|
+
if (!performanceTraceContext.canAccessResource(params.scriptUrl)) {
|
|
88
|
+
return {error: 'Resource not found'};
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
if (params.line === undefined) {
|
|
@@ -205,7 +205,7 @@ export class GetInsightDetailsTool implements
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
const widgets: AiWidget[] = [];
|
|
208
|
-
const isImportedTrace = performanceTraceContext.
|
|
208
|
+
const isImportedTrace = performanceTraceContext.isImported();
|
|
209
209
|
if (!isImportedTrace) {
|
|
210
210
|
const domTreeWidget = await this.#generateDOMTreeWidget(insight, insightSet, capabilities.getTarget());
|
|
211
211
|
if (domTreeWidget) {
|
|
@@ -6,14 +6,13 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import * as Logs from '../../logs/logs.js';
|
|
8
8
|
import * as NetworkTimeCalculator from '../../network_time_calculator/network_time_calculator.js';
|
|
9
|
-
import {isOpaqueOrigin} from '../AiOrigins.js';
|
|
10
|
-
import {getRequestContextOrigin} from '../contexts/RequestContext.js';
|
|
11
9
|
import {NetworkRequestFormatter} from '../data_formatters/NetworkRequestFormatter.js';
|
|
12
10
|
|
|
13
11
|
import {
|
|
14
12
|
type BaseToolCapability,
|
|
15
13
|
type DataHandlerResult,
|
|
16
14
|
type DataTool,
|
|
15
|
+
isOriginAllowedByLock,
|
|
17
16
|
type OriginLockCapability,
|
|
18
17
|
type ToolArgs,
|
|
19
18
|
ToolName,
|
|
@@ -78,10 +77,10 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
78
77
|
): Promise<DataHandlerResult<unknown>> {
|
|
79
78
|
// A conversation is locked to an origin once the first query is made.
|
|
80
79
|
// We only allow inspecting requests matching the conversation's established origin.
|
|
81
|
-
const
|
|
80
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
82
81
|
|
|
83
82
|
// Opaque origins are never allowed to be used as context.
|
|
84
|
-
if (
|
|
83
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
85
84
|
return {
|
|
86
85
|
error: 'Opaque origin not allowed',
|
|
87
86
|
};
|
|
@@ -94,13 +93,8 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
94
93
|
return false;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
|
-
// To prevent cross-origin prompt injection attacks, HAR-imported requests
|
|
98
|
-
// are assigned a virtual origin (e.g., `imported-har://${domain}`) rather than
|
|
99
|
-
// sharing the origin of live pages.
|
|
100
|
-
const requestOrigin = getRequestContextOrigin(req);
|
|
101
|
-
|
|
102
96
|
// If the conversation is locked to an origin, only allow accessing requests from that origin.
|
|
103
|
-
return
|
|
97
|
+
return isOriginAllowedByLock(establishedOrigin, req.initiatorSecurityOrigin());
|
|
104
98
|
});
|
|
105
99
|
|
|
106
100
|
if (!request) {
|
|
@@ -110,7 +104,10 @@ export class GetNetworkRequestDetailsTool implements
|
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
const calculator = new NetworkTimeCalculator.NetworkTransferTimeCalculator();
|
|
113
|
-
const formatter = new NetworkRequestFormatter(request, calculator,
|
|
107
|
+
const formatter = new NetworkRequestFormatter(request, calculator, {
|
|
108
|
+
accessingSecurityOrigin: establishedOrigin,
|
|
109
|
+
networkLog,
|
|
110
|
+
});
|
|
114
111
|
const formattedDetails = await formatter.formatNetworkRequest();
|
|
115
112
|
|
|
116
113
|
return {
|
|
@@ -8,7 +8,6 @@ import type * as Platform from '../../../core/platform/platform.js';
|
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
10
|
import * as TextUtils from '../../../core/text_utils/text_utils.js';
|
|
11
|
-
import {canResourceContentsBeReadForTrace} from '../AiOrigins.js';
|
|
12
11
|
|
|
13
12
|
import {
|
|
14
13
|
type BaseToolCapability,
|
|
@@ -69,12 +68,11 @@ export class GetResourceContentTool implements DataTool<
|
|
|
69
68
|
return {error: 'Performance trace context is not available.'};
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
if (performanceTraceContext.
|
|
71
|
+
if (performanceTraceContext.isImported()) {
|
|
73
72
|
return {error: 'Cannot use this tool on an imported file.'};
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
if (!canResourceContentsBeReadForTrace(params.url, allowedOrigin)) {
|
|
75
|
+
if (!performanceTraceContext.canAccessResource(params.url)) {
|
|
78
76
|
return {error: 'Resource not found'};
|
|
79
77
|
}
|
|
80
78
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../../core/common/common.js';
|
|
6
5
|
import * as Host from '../../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
7
|
import * as TextUtils from '../../../core/text_utils/text_utils.js';
|
|
8
|
+
import {FileContext} from '../contexts/FileContext.js';
|
|
9
9
|
import {FileFormatter} from '../data_formatters/FileFormatter.js';
|
|
10
10
|
|
|
11
11
|
import {ListSourcesTool} from './ListSources.js';
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
type BaseToolCapability,
|
|
14
14
|
type DataHandlerResult,
|
|
15
15
|
type DataTool,
|
|
16
|
+
isOriginAllowedByLock,
|
|
16
17
|
type OriginLockCapability,
|
|
17
18
|
type ToolArgs,
|
|
18
19
|
ToolName,
|
|
@@ -65,10 +66,10 @@ export class GetSourceContentTool implements
|
|
|
65
66
|
args: GetSourceContentArgs,
|
|
66
67
|
context: BaseToolCapability&OriginLockCapability,
|
|
67
68
|
): Promise<DataHandlerResult<{content: string}>> {
|
|
68
|
-
const
|
|
69
|
-
const file = ListSourcesTool.getUISourceCodes()
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
70
|
+
const file = ListSourcesTool.getUISourceCodes()
|
|
71
|
+
.filter(f => isOriginAllowedByLock(establishedOrigin, FileContext.originForUISourceCode(f)))
|
|
72
|
+
.find(f => ListSourcesTool.uiSourceCodeId.get(f) === args.id);
|
|
72
73
|
|
|
73
74
|
if (!file) {
|
|
74
75
|
return {
|
|
@@ -76,14 +77,6 @@ export class GetSourceContentTool implements
|
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
const fileUrl = file.url();
|
|
80
|
-
const fileOrigin = Common.ParsedURL.ParsedURL.extractOrigin(fileUrl);
|
|
81
|
-
if (origin && fileOrigin !== origin) {
|
|
82
|
-
return {
|
|
83
|
-
error: 'Cross-origin access blocked.',
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
80
|
const contentData = await file.requestContentData();
|
|
88
81
|
if (TextUtils.ContentData.ContentData.isError(contentData)) {
|
|
89
82
|
return {
|
|
@@ -78,7 +78,7 @@ export class GetStorageBreakdownTool implements
|
|
|
78
78
|
primaryPageTarget.storageAgent().invoke_getUsageAndQuota({origin: pageOrigin}),
|
|
79
79
|
calculateDOMStoragesUsage(localStorages),
|
|
80
80
|
calculateDOMStoragesUsage(sessionStorages),
|
|
81
|
-
getCookiesForOrigin(pageOrigin,
|
|
81
|
+
getCookiesForOrigin(pageOrigin, primaryPageTarget),
|
|
82
82
|
]);
|
|
83
83
|
|
|
84
84
|
if (response.getError()) {
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../../core/common/common.js';
|
|
6
5
|
import * as Host from '../../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
7
|
import * as Platform from '../../../core/platform/platform.js';
|
|
9
8
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
9
|
import type {FunctionHandlerOptions} from '../agents/AiAgent.js';
|
|
11
|
-
import {areOriginsEquivalent, extractContextOrigin, isOpaqueOrigin} from '../AiOrigins.js';
|
|
12
10
|
|
|
13
11
|
import {MAX_TARGET_ORIGINS, resolveDOMStorages} from './DOMStorageUtils.js';
|
|
14
12
|
import {
|
|
@@ -116,8 +114,8 @@ export class GetStorageValuesTool implements DataTool<GetStorageValuesArgs, GetS
|
|
|
116
114
|
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
117
115
|
const primaryPageTarget = targetManager.primaryPageTarget();
|
|
118
116
|
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
117
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
118
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
121
119
|
return {error: 'No origin available or not allowed.'};
|
|
122
120
|
}
|
|
123
121
|
|
|
@@ -125,14 +123,16 @@ export class GetStorageValuesTool implements DataTool<GetStorageValuesArgs, GetS
|
|
|
125
123
|
return {error: 'No origin available or not allowed.'};
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
const pageOrigin =
|
|
129
|
-
if (!pageOrigin
|
|
126
|
+
const pageOrigin = primaryPageTarget.inspectedSecurityOrigin();
|
|
127
|
+
if (!pageOrigin.isSameOriginWith(establishedOrigin)) {
|
|
130
128
|
return {error: 'No origin available or not allowed.'};
|
|
131
129
|
}
|
|
132
130
|
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
const candidateOrigins: SDK.SecurityOrigin.SecurityOrigin[] = (args.origins && args.origins.length > 0) ?
|
|
132
|
+
args.origins.map(origin => SDK.SecurityOrigin.SecurityOrigin.create(origin)) :
|
|
133
|
+
[establishedOrigin];
|
|
134
|
+
const validOrigins =
|
|
135
|
+
candidateOrigins.filter(origin => origin.isSameOriginWith(establishedOrigin)).map(origin => origin.siteId());
|
|
136
136
|
const targetOrigins = Array.from(new Set(validOrigins)).slice(0, MAX_TARGET_ORIGINS);
|
|
137
137
|
if (targetOrigins.length === 0) {
|
|
138
138
|
return {error: 'No valid origins found.'};
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type BaseToolCapability,
|
|
13
13
|
type DataHandlerResult,
|
|
14
14
|
type DataTool,
|
|
15
|
+
isOriginAllowedByLock,
|
|
15
16
|
type OriginLockCapability,
|
|
16
17
|
type TargetCapability,
|
|
17
18
|
type ToolArgs,
|
|
@@ -92,7 +93,7 @@ export class GetStylesTool implements
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
const establishedOrigin = context.getEstablishedOrigin();
|
|
95
|
-
if (!establishedOrigin) {
|
|
96
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
96
97
|
return {error: 'Error: Origin lock is not established.'};
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -104,7 +105,7 @@ export class GetStylesTool implements
|
|
|
104
105
|
return {error: 'Error: Could not find the element with uid=' + uid};
|
|
105
106
|
}
|
|
106
107
|
const newContext = new DOMNodeContext(resolved);
|
|
107
|
-
if (!newContext.
|
|
108
|
+
if (!isOriginAllowedByLock(establishedOrigin, newContext.getOrigin())) {
|
|
108
109
|
return {error: 'Error: Node does not belong to the current origin.'};
|
|
109
110
|
}
|
|
110
111
|
const styles = await resolved.domModel().cssModel().getComputedStyle(resolved.id);
|
|
@@ -78,7 +78,7 @@ export class ListCookiesTool implements
|
|
|
78
78
|
const cookieNamesByOrigin: ListCookiesResult['cookieNamesByOrigin'] = {};
|
|
79
79
|
|
|
80
80
|
await Promise.all(targetOrigins.map(async origin => {
|
|
81
|
-
const result = await getCookiesForOrigin(origin,
|
|
81
|
+
const result = await getCookiesForOrigin(origin, primaryPageTarget);
|
|
82
82
|
if ('error' in result) {
|
|
83
83
|
cookieNamesByOrigin[origin] = {error: result.error};
|
|
84
84
|
return;
|
|
@@ -6,14 +6,13 @@ import * as Host from '../../../core/host/host.js';
|
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
8
8
|
import * as Logs from '../../logs/logs.js';
|
|
9
|
-
import {isOpaqueOrigin} from '../AiOrigins.js';
|
|
10
|
-
import {getRequestContextOrigin} from '../contexts/RequestContext.js';
|
|
11
9
|
import {formatBytesToKb, seconds} from '../data_formatters/UnitFormatters.js';
|
|
12
10
|
|
|
13
11
|
import {
|
|
14
12
|
type BaseToolCapability,
|
|
15
13
|
type DataHandlerResult,
|
|
16
14
|
type DataTool,
|
|
15
|
+
isOriginAllowedByLock,
|
|
17
16
|
type OriginLockCapability,
|
|
18
17
|
ToolName,
|
|
19
18
|
} from './Tool.js';
|
|
@@ -77,10 +76,8 @@ export class ListNetworkRequestsTool implements
|
|
|
77
76
|
const requests: NetworkRequestSummary[] = [];
|
|
78
77
|
// A conversation is locked to an origin once the first query is made.
|
|
79
78
|
// We only allow inspecting requests matching the conversation's established origin.
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
// Opaque origins are never allowed to be used as context.
|
|
83
|
-
if (origin && isOpaqueOrigin(origin)) {
|
|
79
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
80
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
84
81
|
return {
|
|
85
82
|
error: 'Opaque origin not allowed',
|
|
86
83
|
};
|
|
@@ -91,13 +88,8 @@ export class ListNetworkRequestsTool implements
|
|
|
91
88
|
let hasCrossOriginRequest = false;
|
|
92
89
|
const requestsToShow: SDK.NetworkRequest.NetworkRequest[] = [];
|
|
93
90
|
for (const request of networkLog.requests()) {
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
// sharing the origin of live pages.
|
|
97
|
-
const requestOrigin = getRequestContextOrigin(request);
|
|
98
|
-
|
|
99
|
-
// If the conversation is locked to an origin, skip requests from other origins.
|
|
100
|
-
if (origin && requestOrigin !== origin) {
|
|
91
|
+
// If the request's initiator origin does not match the locked origin, skip it.
|
|
92
|
+
if (!isOriginAllowedByLock(establishedOrigin, request.initiatorSecurityOrigin())) {
|
|
101
93
|
hasCrossOriginRequest = true;
|
|
102
94
|
continue;
|
|
103
95
|
}
|
|
@@ -115,7 +107,7 @@ export class ListNetworkRequestsTool implements
|
|
|
115
107
|
if (requests.length === 0) {
|
|
116
108
|
if (hasCrossOriginRequest) {
|
|
117
109
|
return {
|
|
118
|
-
error: `No requests showing with origin ${
|
|
110
|
+
error: `No requests showing with origin ${establishedOrigin.siteId()}. Tell the user to start a new chat`,
|
|
119
111
|
};
|
|
120
112
|
}
|
|
121
113
|
return {
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../../core/common/common.js';
|
|
6
5
|
import * as Host from '../../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
7
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
9
|
-
import {areOriginsEquivalent, isOpaqueOrigin} from '../AiOrigins.js';
|
|
10
8
|
|
|
11
9
|
import {
|
|
12
10
|
type BaseToolCapability,
|
|
@@ -59,37 +57,34 @@ export class ListPageOriginsTool implements
|
|
|
59
57
|
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
60
58
|
const primaryPageTarget = targetManager.primaryPageTarget();
|
|
61
59
|
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
60
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
61
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
64
62
|
return {error: 'No origin available or not allowed.'};
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
const pageOrigin =
|
|
68
|
-
primaryPageTarget ?
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!isAllowed) {
|
|
66
|
+
primaryPageTarget ? SDK.SecurityOrigin.SecurityOrigin.create(primaryPageTarget.inspectedURL()) : null;
|
|
67
|
+
if (!pageOrigin || !pageOrigin.isSameOriginWith(establishedOrigin)) {
|
|
72
68
|
return {error: 'No origin available or not allowed.'};
|
|
73
69
|
}
|
|
74
70
|
|
|
75
|
-
const origins =
|
|
71
|
+
const origins: SDK.SecurityOrigin.SecurityOrigin[] = [];
|
|
76
72
|
for (const frame of SDK.ResourceTreeModel.ResourceTreeModel.frames(targetManager)) {
|
|
77
73
|
if (frame.resourceTreeModel().target().outermostTarget() !== primaryPageTarget) {
|
|
78
74
|
continue;
|
|
79
75
|
}
|
|
80
|
-
const
|
|
76
|
+
const frameOrigin = frame.securityOrigin();
|
|
81
77
|
// Filter out frames that are not same-origin to the page's allowed origin.
|
|
82
78
|
// Under site isolation, frames can be hosted on different targets/processes,
|
|
83
79
|
// so we check the security origin of the frame directly instead of the target.
|
|
84
|
-
if (!
|
|
80
|
+
if (!frameOrigin.isSameOriginWith(establishedOrigin)) {
|
|
85
81
|
continue;
|
|
86
82
|
}
|
|
87
|
-
if (origins.
|
|
88
|
-
|
|
83
|
+
if (!origins.some(existing => existing.isSameOriginWith(frameOrigin))) {
|
|
84
|
+
origins.push(frameOrigin);
|
|
89
85
|
}
|
|
90
|
-
origins.add(origin);
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
return {result: {origins:
|
|
88
|
+
return {result: {origins: origins.map(o => o.siteId())}};
|
|
94
89
|
}
|
|
95
90
|
}
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../../core/common/common.js';
|
|
6
5
|
import * as Host from '../../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
7
|
import * as Workspace from '../../workspace/workspace.js';
|
|
9
|
-
import {
|
|
8
|
+
import {FileContext} from '../contexts/FileContext.js';
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
type BaseToolCapability,
|
|
13
12
|
type DataHandlerResult,
|
|
14
13
|
type DataTool,
|
|
14
|
+
isOriginAllowedByLock,
|
|
15
15
|
type OriginLockCapability,
|
|
16
16
|
ToolName,
|
|
17
17
|
} from './Tool.js';
|
|
@@ -93,17 +93,15 @@ export class ListSourcesTool implements
|
|
|
93
93
|
_params: Record<string, never>,
|
|
94
94
|
context: BaseToolCapability&OriginLockCapability,
|
|
95
95
|
): Promise<DataHandlerResult<{files: SourceSummary[]}>> {
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
96
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
97
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
98
98
|
return {
|
|
99
99
|
error: 'Opaque origin not allowed',
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const files = ListSourcesTool.getUISourceCodes().filter(file => {
|
|
104
|
-
|
|
105
|
-
const fileOrigin = Common.ParsedURL.ParsedURL.extractOrigin(fileUrl);
|
|
106
|
-
return !origin || fileOrigin === origin;
|
|
104
|
+
return isOriginAllowedByLock(establishedOrigin, FileContext.originForUISourceCode(file));
|
|
107
105
|
});
|
|
108
106
|
|
|
109
107
|
return {
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../../core/common/common.js';
|
|
6
5
|
import * as Host from '../../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
7
|
import * as Platform from '../../../core/platform/platform.js';
|
|
9
8
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
|
-
import {areOriginsEquivalent, extractContextOrigin, isOpaqueOrigin} from '../AiOrigins.js';
|
|
11
9
|
|
|
12
10
|
import {MAX_TARGET_ORIGINS, resolveDOMStorages} from './DOMStorageUtils.js';
|
|
13
11
|
import {
|
|
@@ -102,8 +100,8 @@ export class ListStorageKeysTool implements DataTool<ListStorageKeysArgs, ListSt
|
|
|
102
100
|
const targetManager = SDK.TargetManager.TargetManager.instance();
|
|
103
101
|
const primaryPageTarget = targetManager.primaryPageTarget();
|
|
104
102
|
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
103
|
+
const establishedOrigin = context.getEstablishedOrigin();
|
|
104
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
107
105
|
return {error: 'No origin available or not allowed.'};
|
|
108
106
|
}
|
|
109
107
|
|
|
@@ -111,14 +109,16 @@ export class ListStorageKeysTool implements DataTool<ListStorageKeysArgs, ListSt
|
|
|
111
109
|
return {error: 'No origin available or not allowed.'};
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
const pageOrigin =
|
|
115
|
-
if (!pageOrigin
|
|
112
|
+
const pageOrigin = primaryPageTarget.inspectedSecurityOrigin();
|
|
113
|
+
if (!pageOrigin.isSameOriginWith(establishedOrigin)) {
|
|
116
114
|
return {error: 'No origin available or not allowed.'};
|
|
117
115
|
}
|
|
118
116
|
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
const candidateOrigins: SDK.SecurityOrigin.SecurityOrigin[] = (args.origins && args.origins.length > 0) ?
|
|
118
|
+
args.origins.map(origin => SDK.SecurityOrigin.SecurityOrigin.create(origin)) :
|
|
119
|
+
[establishedOrigin];
|
|
120
|
+
const validOrigins =
|
|
121
|
+
candidateOrigins.filter(origin => origin.isSameOriginWith(establishedOrigin)).map(origin => origin.siteId());
|
|
122
122
|
const targetOrigins = Array.from(new Set(validOrigins)).slice(0, MAX_TARGET_ORIGINS);
|
|
123
123
|
if (targetOrigins.length === 0) {
|
|
124
124
|
return {error: 'No valid origins found.'};
|
|
@@ -16,8 +16,10 @@ Instead of passing a monolithic "grab-bag" context object to all tool handlers,
|
|
|
16
16
|
- `BaseToolCapability`: Base interface providing access to the top-level conversation context step.
|
|
17
17
|
- `PageExecutionCapability`: For tools executing JavaScript code on the inspected page.
|
|
18
18
|
- `StyleMutationCapability`: For tools managing and applying style mutations via a `ChangeManager`.
|
|
19
|
-
- `
|
|
20
|
-
-
|
|
19
|
+
- `OriginLockCapability`: Enforces origin boundaries for tools that access inspected page state or resources. Tools verify targets against the established origin before reading data to prevent unauthorized cross-origin access.
|
|
20
|
+
- For DOM nodes and source files: wrap the target in a context helper (such as `DOMNodeContext` or `FileContext`) and call `isOriginAllowed(establishedOrigin)`.
|
|
21
|
+
- For cookies and DOM storage: validate target origins using `resolveAllowedTargetOrigins()`.
|
|
22
|
+
- For network requests: compare `request.initiatorSecurityOrigin()` to the established origin.
|
|
21
23
|
|
|
22
24
|
### Unified Context
|
|
23
25
|
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type BaseToolCapability,
|
|
11
11
|
type DataHandlerResult,
|
|
12
12
|
type DataTool,
|
|
13
|
+
isOriginAllowedByLock,
|
|
13
14
|
type OriginLockCapability,
|
|
14
15
|
type TargetCapability,
|
|
15
16
|
type ToolArgs,
|
|
@@ -85,7 +86,7 @@ export class ResolveDevtoolsNodePathTool implements DataTool<ResolveDevtoolsNode
|
|
|
85
86
|
context: BaseToolCapability&TargetCapability&OriginLockCapability,
|
|
86
87
|
): Promise<DataHandlerResult<{backendNodeId: number}>> {
|
|
87
88
|
const establishedOrigin = context.getEstablishedOrigin();
|
|
88
|
-
if (!establishedOrigin) {
|
|
89
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
89
90
|
return {error: 'Error: Origin lock is not established.'};
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -115,7 +116,7 @@ export class ResolveDevtoolsNodePathTool implements DataTool<ResolveDevtoolsNode
|
|
|
115
116
|
const nodeContext = new DOMNodeContext(node);
|
|
116
117
|
// Security check: Ensure the resolved node belongs to the same origin
|
|
117
118
|
// that this AI assistance session is locked to, preventing cross-origin access.
|
|
118
|
-
if (!nodeContext.
|
|
119
|
+
if (!isOriginAllowedByLock(establishedOrigin, nodeContext.getOrigin())) {
|
|
119
120
|
return {error: 'Error: Node does not belong to the locked origin.'};
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -112,13 +112,37 @@ export interface TargetCapability {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
* Capability for tools that
|
|
115
|
+
* Capability for tools that enforce conversation origin boundaries.
|
|
116
116
|
*/
|
|
117
117
|
export interface OriginLockCapability {
|
|
118
118
|
/**
|
|
119
|
-
* Returns the origin
|
|
119
|
+
* Returns the security origin locked for the current conversation.
|
|
120
|
+
*
|
|
121
|
+
* TODO: When V1 agents (StylingAgent, AccessibilityAgent) are removed,
|
|
122
|
+
* simplify getEstablishedOrigin() to return SDK.SecurityOrigin.SecurityOrigin
|
|
123
|
+
* non-optionally.
|
|
124
|
+
*
|
|
125
|
+
* @returns The established {@link SDK.SecurityOrigin.SecurityOrigin}, or `undefined`
|
|
126
|
+
* if the conversation is not yet locked to an origin (e.g. before the first query).
|
|
120
127
|
*/
|
|
121
|
-
getEstablishedOrigin():
|
|
128
|
+
getEstablishedOrigin(): SDK.SecurityOrigin.SecurityOrigin|undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Checks whether a target origin matches the established conversation origin lock.
|
|
133
|
+
* Fails closed (returns false) if established origin is missing/opaque or target is cross-origin.
|
|
134
|
+
*/
|
|
135
|
+
export function isOriginAllowedByLock(
|
|
136
|
+
establishedOrigin: SDK.SecurityOrigin.SecurityOrigin|undefined,
|
|
137
|
+
targetOrigin: SDK.SecurityOrigin.SecurityOrigin|null|undefined,
|
|
138
|
+
): boolean {
|
|
139
|
+
if (!establishedOrigin || establishedOrigin.isOpaque()) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (!targetOrigin || targetOrigin.isOpaque()) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
return targetOrigin.isSameOriginWith(establishedOrigin);
|
|
122
146
|
}
|
|
123
147
|
|
|
124
148
|
/**
|