chrome-devtools-frontend 1.0.1689415 → 1.0.1690531
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/.gitmodules +4 -0
- package/eslint.config.mjs +8 -2
- package/front_end/core/common/Object.ts +10 -4
- package/front_end/core/i18n/collect-ui-strings.js +5 -5
- package/front_end/core/i18n/generate-locales-js.js +1 -1
- package/front_end/core/i18n/i18n.ts +6 -0
- package/front_end/core/root/Runtime.ts +1 -5
- package/front_end/core/sdk/CSSMetadata.ts +3 -5
- package/front_end/core/sdk/DOMModel.ts +46 -11
- package/front_end/core/sdk/EmulationModel.ts +18 -0
- package/front_end/core/sdk/NetworkRequest.ts +50 -4
- package/front_end/core/sdk/NetworkRequestAccess.ts +172 -0
- package/front_end/core/sdk/SDKSettings.ts +9 -0
- package/front_end/core/sdk/Script.ts +0 -1
- package/front_end/core/sdk/SecurityOrigin.ts +160 -25
- package/front_end/core/sdk/Target.ts +1 -5
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/generated/SupportedCSSProperties.ts +1 -1
- package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
- package/front_end/models/ai_assistance/AiConversation.ts +29 -18
- package/front_end/models/ai_assistance/AiUtils.ts +0 -10
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +6 -10
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -1
- package/front_end/models/ai_assistance/injected.ts +0 -2
- package/front_end/models/javascript_metadata/NativeFunctions.ts +1 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
- package/front_end/models/trace/insights/Cache.ts +1 -3
- package/front_end/models/trace/insights/CharacterSet.ts +1 -3
- package/front_end/models/trace/insights/DOMSize.ts +1 -3
- package/front_end/models/trace/insights/DocumentLatency.ts +1 -3
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -3
- package/front_end/models/trace/insights/FontDisplay.ts +1 -2
- package/front_end/models/trace/insights/ForcedReflow.ts +1 -2
- package/front_end/models/trace/insights/INPBreakdown.ts +1 -3
- package/front_end/models/trace/insights/ImageDelivery.ts +1 -3
- package/front_end/models/trace/insights/LCPBreakdown.ts +1 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -3
- package/front_end/models/trace/insights/LegacyJavaScript.ts +1 -3
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -2
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -2
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -3
- package/front_end/models/trace/insights/SlowCSSSelector.ts +1 -3
- package/front_end/models/trace/insights/ThirdParties.ts +1 -3
- package/front_end/models/trace/insights/Viewport.ts +1 -2
- package/front_end/panels/accessibility/ARIAAttributesView.ts +1 -1
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -2
- package/front_end/panels/accessibility/AccessibilityStrings.ts +7 -3
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -2
- package/front_end/panels/ai_assistance/components/AccessibilityAgentMarkdownRenderer.ts +1 -3
- package/front_end/panels/ai_assistance/components/chatMessage.css +3 -1
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/AnimationUI.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +6 -2
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +1 -1
- package/front_end/panels/application/FrameDetailsView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +3 -2
- package/front_end/panels/application/ReportingApiTreeElement.ts +1 -1
- package/front_end/panels/application/ReportingApiView.ts +2 -2
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/StorageItemsToolbar.ts +6 -2
- package/front_end/panels/application/StorageView.ts +9 -8
- package/front_end/panels/application/TrustTokensTreeElement.ts +1 -1
- package/front_end/panels/application/WebMCPView.ts +2 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +1 -1
- package/front_end/panels/application/components/CrashReportContextGrid.ts +1 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +3 -2
- package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +1 -1
- package/front_end/panels/application/components/TrustTokensView.ts +2 -2
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +7 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +2 -0
- package/front_end/panels/autofill/AutofillView.ts +2 -2
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -3
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +56 -15
- package/front_end/panels/changes/ChangesView.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/ConsolePinPane.ts +4 -2
- package/front_end/panels/console/ConsolePrompt.ts +6 -2
- package/front_end/panels/console/ConsoleSidebar.ts +12 -4
- 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/css_overview/CSSOverviewCompletedView.ts +9 -9
- 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/elements/ComputedStyleWidget.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +16 -3
- package/front_end/panels/elements/ElementsTreeOutline.ts +402 -130
- package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
- package/front_end/panels/elements/PropertyNameCategories.ts +1 -1
- package/front_end/panels/elements/PropertyRenderer.ts +22 -15
- package/front_end/panels/elements/ShortcutTreeElement.ts +2 -1
- package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -3
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +75 -26
- package/front_end/panels/elements/StylesSidebarPane.ts +9 -4
- package/front_end/panels/elements/components/StylePropertyEditor.ts +160 -148
- package/front_end/panels/elements/elementsTreeOutline.css +4 -0
- package/front_end/panels/emulation/DeviceModeView.ts +6 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +6 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -1
- package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +1 -1
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +6 -2
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +7 -2
- package/front_end/panels/layer_viewer/Layers3DView.ts +8 -1
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +6 -2
- package/front_end/panels/lighthouse/lighthousePanel.css +5 -5
- package/front_end/panels/lighthouse/lighthouseStartView.css +13 -13
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +6 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +6 -2
- 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/mobile_throttling/NetworkThrottlingSelector.ts +6 -2
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +25 -54
- package/front_end/panels/network/NetworkDataGridNode.ts +11 -9
- package/front_end/panels/network/NetworkLogView.ts +12 -4
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- 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 +5 -0
- package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
- package/front_end/panels/network/networkLogView.css +4 -0
- package/front_end/panels/network/requestInitiatorViewTree.css +2 -0
- package/front_end/panels/performance_monitor/performanceMonitor.css +3 -3
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +7 -2
- package/front_end/panels/profiler/HeapProfileView.ts +7 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +8 -4
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +8 -4
- package/front_end/panels/profiler/HeapSnapshotView.ts +15 -6
- package/front_end/panels/profiler/HeapTimelineOverview.ts +6 -2
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +12 -5
- package/front_end/panels/profiler/ProfileLauncherView.ts +6 -2
- package/front_end/panels/profiler/profilesPanel.css +8 -9
- package/front_end/panels/profiler/profilesSidebarTree.css +13 -13
- package/front_end/panels/protocol_monitor/JSONEditor.css +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +6 -1
- package/front_end/panels/protocol_monitor/protocolMonitor.css +2 -2
- 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/sources/SourcesView.ts +7 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +6 -2
- package/front_end/panels/sources/UISourceCodeFrame.ts +10 -3
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/AnnotationHelpers.ts +9 -9
- package/front_end/panels/timeline/CountersGraph.ts +8 -8
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
- package/front_end/panels/timeline/GPUTrackAppender.ts +1 -1
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/IsolateSelector.ts +3 -3
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +4 -4
- package/front_end/panels/timeline/NetworkTrackAppender.ts +2 -2
- package/front_end/panels/timeline/StatusDialog.ts +5 -6
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +4 -4
- package/front_end/panels/timeline/ThreadAppender.ts +12 -14
- package/front_end/panels/timeline/TimelineController.ts +5 -8
- package/front_end/panels/timeline/TimelineDetailsView.ts +13 -9
- package/front_end/panels/timeline/TimelineEventOverview.ts +4 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +18 -18
- package/front_end/panels/timeline/TimelineFlameChartView.ts +8 -3
- package/front_end/panels/timeline/TimelineHistoryManager.ts +9 -9
- package/front_end/panels/timeline/TimelineLoader.ts +1 -1
- package/front_end/panels/timeline/TimelineMiniMap.ts +7 -2
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +7 -3
- package/front_end/panels/timeline/TimelinePanel.ts +60 -62
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +27 -27
- package/front_end/panels/timeline/TimelineTreeView.ts +47 -45
- package/front_end/panels/timeline/TimelineUIUtils.ts +146 -120
- package/front_end/panels/timeline/TimingsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TrackConfigBanner.ts +4 -4
- package/front_end/panels/timeline/UIDevtoolsUtils.ts +15 -15
- 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/insights/Table.ts +1 -1
- package/front_end/panels/timeline/enable-easter-egg.js +1 -1
- package/front_end/panels/timeline/timeline-meta.ts +30 -30
- package/front_end/panels/timeline/timelineFlameChartView.css +10 -10
- package/front_end/panels/timeline/timelineFlamechartPopover.css +5 -5
- package/front_end/panels/timeline/timelineHistoryManager.css +7 -7
- package/front_end/panels/timeline/timelinePaintProfiler.css +2 -2
- package/front_end/panels/timeline/utils/Helpers.ts +1 -1
- package/front_end/panels/timeline/utils/IgnoreList.ts +4 -4
- package/front_end/panels/timeline/utils/ImageCache.ts +5 -3
- package/front_end/panels/web_audio/WebAudioView.ts +3 -3
- 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/utils.ts +1 -1
- 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/ui/comments/CommentAnchorResolver.ts +12 -3
- package/front_end/ui/comments/CommentOverlayManager.ts +9 -1
- package/front_end/ui/components/buttons/Button.docs.ts +1 -1
- package/front_end/ui/components/buttons/button.css +21 -0
- package/front_end/ui/components/buttons/floatingButton.css +25 -0
- package/front_end/ui/components/report_view/ReportView.docs.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/spinners/Spinners.docs.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +46 -27
- package/front_end/ui/components/switch/Switch.docs.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +10 -8
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +2 -1
- package/front_end/ui/components/text_editor/ExecutionPositionHighlighter.ts +2 -2
- package/front_end/ui/components/text_editor/TextEditor.ts +19 -0
- package/front_end/ui/components/text_editor/config.ts +109 -96
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +1 -1
- package/front_end/ui/components/text_editor/theme.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.docs.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutlineUtils.ts +4 -1
- package/front_end/ui/kit/cards/Card.ts +1 -1
- package/front_end/ui/kit/icons/Icon.ts +1 -1
- package/front_end/ui/kit/link/Link.docs.ts +1 -1
- package/front_end/ui/kit/link/Link.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.docs.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +2 -2
- package/front_end/ui/legacy/Dialog.ts +10 -2
- package/front_end/ui/legacy/DropTarget.ts +6 -1
- package/front_end/ui/legacy/EmptyWidget.ts +1 -1
- package/front_end/ui/legacy/FilterBar.ts +6 -1
- package/front_end/ui/legacy/GlassPane.ts +1 -1
- package/front_end/ui/legacy/RadioButton.docs.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +1 -1
- package/front_end/ui/legacy/ShortcutRegistry.ts +2 -2
- package/front_end/ui/legacy/Slider.docs.ts +1 -1
- package/front_end/ui/legacy/SplitWidget.ts +7 -2
- package/front_end/ui/legacy/StackedPane.ts +1 -1
- package/front_end/ui/legacy/TabbedPane.ts +5 -1
- 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 +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +13 -37
- package/front_end/ui/legacy/UIUtils.ts +6 -3
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +13 -2
- 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/ViewportDataGrid.ts +6 -2
- package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +54 -45
- package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +6 -2
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +141 -106
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -10
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +2 -0
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +6 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +6 -2
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -4
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +7 -5
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +6 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +15 -7
- 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 +11 -0
- package/front_end/ui/visual_logging/Debugging.ts +2 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -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/package.json +3 -2
- 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/puppeteer-tsconfig.json +0 -191
- 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
|
@@ -2,47 +2,182 @@
|
|
|
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 '../common/common.js';
|
|
6
|
+
import type * as Platform from '../platform/platform.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal representation of a security origin:
|
|
10
|
+
* - `origin`: A comparable origin string (`<scheme>://<host>[:<port>]` or path-scoped `file://<host>/<path>`).
|
|
11
|
+
* - `opaque`: An isolated opaque origin uniquely identified by a UUID that never matches any other origin.
|
|
12
|
+
*/
|
|
13
|
+
type InternalOrigin =
|
|
14
|
+
|{readonly type: 'origin', readonly value: string}|{readonly type: 'opaque', readonly uuid: string};
|
|
15
|
+
|
|
16
|
+
/** Exact string matches that represent an invalid or opaque origin. */
|
|
17
|
+
const OPAQUE_EXACT_MATCHES = new Set([
|
|
18
|
+
'',
|
|
19
|
+
'null',
|
|
20
|
+
'undefined',
|
|
21
|
+
'data:',
|
|
22
|
+
'detached',
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
/** String prefixes for origins that must be treated as opaque (e.g. `about:blank`, `blob:data`). */
|
|
26
|
+
const OPAQUE_PREFIXES = [
|
|
27
|
+
'about:',
|
|
28
|
+
'blob:about',
|
|
29
|
+
'blob:data',
|
|
30
|
+
'blob:null',
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* String prefixes for imported artifact schemes (e.g., HAR recordings, traces).
|
|
35
|
+
* Imported entities operate in an isolated origin domain (`imported-har://${domain}`)
|
|
36
|
+
* that never matches live web origins (`https://${domain}`).
|
|
37
|
+
*/
|
|
38
|
+
export const IMPORTED_ORIGIN_PREFIXES: ReadonlySet<string> = new Set([
|
|
39
|
+
'imported-har:',
|
|
40
|
+
]);
|
|
41
|
+
|
|
42
|
+
function isOpaqueUrlString(url: string): boolean {
|
|
43
|
+
const lower = url.trim().toLowerCase();
|
|
44
|
+
if (OPAQUE_EXACT_MATCHES.has(lower)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return OPAQUE_PREFIXES.some(prefix => lower.startsWith(prefix));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* An immutable security origin for an entity in DevTools (such as a document,
|
|
52
|
+
* network request, or storage key).
|
|
53
|
+
*
|
|
54
|
+
* DevTools features that handle user data or execute commands on behalf of the user
|
|
55
|
+
* (such as DevTools AI Assistance and Extensions) must enforce strict origin boundaries
|
|
56
|
+
* to prevent prompt injection and cross-origin data exfiltration.
|
|
57
|
+
*
|
|
58
|
+
* This class serves as the single source of truth for origin comparison and classification:
|
|
59
|
+
*
|
|
60
|
+
* 1. **Standard Origins**: Web URLs (HTTP, HTTPS, WSS) resolve to `<scheme>://<host>[:<port>]`.
|
|
61
|
+
* Two standard origins are same-origin if their scheme, host, and port match.
|
|
62
|
+
*
|
|
63
|
+
* 2. **File URLs (`file://`)**: In the WHATWG web security model, `file://` URLs are assigned
|
|
64
|
+
* opaque origins. In DevTools, however, users frequently debug local files (`file:///path/index.html`).
|
|
65
|
+
* Treating all `file://` URLs as opaque would block the user from inspecting elements or styles within
|
|
66
|
+
* the same file. Conversely, treating all `file://` URLs as a single shared origin would allow a malicious
|
|
67
|
+
* local file to traverse into other local files via iframes (b/524362513).
|
|
68
|
+
* Therefore, DevTools treats `file://` URLs as **path-scoped origins** (`file://<authority><path>`).
|
|
69
|
+
* `isOpaque()` returns `false` for `file://` URLs, and two `file://` URLs are considered same-origin
|
|
70
|
+
* only if their full file path and host match exactly.
|
|
71
|
+
*
|
|
72
|
+
* 3. **Opaque Origins**: Opaque contexts (`data:`, `about:blank`, invalid URLs, or synthetic
|
|
73
|
+
* opaque origins) are backed by unique UUIDs. An opaque origin never matches any other origin,
|
|
74
|
+
* even another opaque origin created from the same URL string.
|
|
75
|
+
*/
|
|
5
76
|
export class SecurityOrigin {
|
|
6
|
-
#
|
|
7
|
-
#opaqueUuid?: string;
|
|
77
|
+
readonly #origin: InternalOrigin;
|
|
8
78
|
|
|
9
|
-
private constructor(
|
|
10
|
-
this.#
|
|
11
|
-
this.#opaqueUuid = opaqueUuid;
|
|
79
|
+
private constructor(origin: InternalOrigin) {
|
|
80
|
+
this.#origin = origin;
|
|
12
81
|
}
|
|
13
82
|
|
|
14
|
-
|
|
15
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Creates a `SecurityOrigin` instance from a raw URL or origin string.
|
|
85
|
+
*
|
|
86
|
+
* - If the URL is determined to be opaque (e.g. `data:`, `about:blank`, empty, `null`),
|
|
87
|
+
* a new unique opaque origin is returned.
|
|
88
|
+
* - If the URL is a `file://` URL, a path-scoped origin (`file://<authority><path>`) is returned.
|
|
89
|
+
* - Otherwise, the standard origin (`<scheme>://<host>[:<port>]`) is extracted and returned.
|
|
90
|
+
*
|
|
91
|
+
* @param rawUrl The raw URL or origin string to evaluate.
|
|
92
|
+
*/
|
|
93
|
+
static create(rawUrl: string): SecurityOrigin {
|
|
94
|
+
if (isOpaqueUrlString(rawUrl)) {
|
|
95
|
+
return SecurityOrigin.createUniqueOpaque();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Custom imported schemes (e.g. `imported-har:`) are not supported by standard URL parsers.
|
|
99
|
+
// We extract the host to construct a domain-scoped origin (`imported-har://${host}`).
|
|
100
|
+
// This isolates imported artifacts from live web pages (`imported-har://example.com` != `https://example.com`),
|
|
101
|
+
// while enabling same-origin comparison between requests within the same imported session domain.
|
|
102
|
+
for (const prefix of IMPORTED_ORIGIN_PREFIXES) {
|
|
103
|
+
if (rawUrl.toLowerCase().startsWith(prefix)) {
|
|
104
|
+
const afterScheme = rawUrl.substring(prefix.length).replace(/^\/+/, '');
|
|
105
|
+
const slashIndex = afterScheme.indexOf('/');
|
|
106
|
+
const host = slashIndex === -1 ? afterScheme : afterScheme.substring(0, slashIndex);
|
|
107
|
+
if (!host) {
|
|
108
|
+
return SecurityOrigin.createUniqueOpaque();
|
|
109
|
+
}
|
|
110
|
+
return new SecurityOrigin({type: 'origin', value: `${prefix}//${host.toLowerCase()}`});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (rawUrl.toLowerCase().startsWith('file://')) {
|
|
115
|
+
const parsed = Common.ParsedURL.ParsedURL.fromString(rawUrl as Platform.DevToolsPath.UrlString);
|
|
116
|
+
if (!parsed) {
|
|
117
|
+
return SecurityOrigin.createUniqueOpaque();
|
|
118
|
+
}
|
|
119
|
+
const authority = parsed.host + (parsed.port ? ':' + parsed.port : '');
|
|
120
|
+
return new SecurityOrigin({type: 'origin', value: `file://${authority}${parsed.path}`});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const origin = Common.ParsedURL.ParsedURL.extractOrigin(rawUrl as Platform.DevToolsPath.UrlString);
|
|
124
|
+
if (!origin || isOpaqueUrlString(origin)) {
|
|
125
|
+
return SecurityOrigin.createUniqueOpaque();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return new SecurityOrigin({type: 'origin', value: origin});
|
|
16
129
|
}
|
|
17
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Creates a synthetic, unique opaque origin.
|
|
133
|
+
*
|
|
134
|
+
* Useful when an entity (like a sandboxed iframe or detached DOM tree) needs an
|
|
135
|
+
* isolated origin that will never match any other origin in the session.
|
|
136
|
+
*/
|
|
18
137
|
static createUniqueOpaque(): SecurityOrigin {
|
|
19
|
-
return new SecurityOrigin(
|
|
138
|
+
return new SecurityOrigin({type: 'opaque', uuid: crypto.randomUUID()});
|
|
20
139
|
}
|
|
21
140
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Checks whether this security origin is equivalent to another security origin.
|
|
143
|
+
*
|
|
144
|
+
* - Standard origins return `true` if their scheme, host, and port match.
|
|
145
|
+
* - File origins return `true` if their full file path and host match.
|
|
146
|
+
* - Opaque origins return `true` only if both instances have identical UUIDs.
|
|
147
|
+
* - Passing `null` always returns `false`.
|
|
148
|
+
*
|
|
149
|
+
* @param other The other `SecurityOrigin` to compare with.
|
|
150
|
+
*/
|
|
151
|
+
isSameOriginWith(other: SecurityOrigin|null): boolean {
|
|
152
|
+
if (!other) {
|
|
27
153
|
return false;
|
|
28
154
|
}
|
|
29
|
-
|
|
155
|
+
if (this.#origin.type === 'opaque' || other.#origin.type === 'opaque') {
|
|
156
|
+
return this.#origin.type === 'opaque' && other.#origin.type === 'opaque' &&
|
|
157
|
+
this.#origin.uuid === other.#origin.uuid;
|
|
158
|
+
}
|
|
159
|
+
return this.#origin.value === other.#origin.value;
|
|
30
160
|
}
|
|
31
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Returns whether this origin is opaque.
|
|
164
|
+
*
|
|
165
|
+
* Opaque origins include `data:` URLs, `about:blank`, invalid URLs, and instances
|
|
166
|
+
* created via `createUniqueOpaque()`.
|
|
167
|
+
*/
|
|
32
168
|
isOpaque(): boolean {
|
|
33
|
-
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
if (this.#urlOrigin) {
|
|
37
|
-
const lower = this.#urlOrigin.toLowerCase();
|
|
38
|
-
return lower === '' || lower === 'null' || lower === 'data:' || lower.startsWith('about') ||
|
|
39
|
-
lower.startsWith('blob:about') || lower.startsWith('blob:data') || lower.startsWith('blob:null') ||
|
|
40
|
-
lower.startsWith('detached') || lower.startsWith('undefined');
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
169
|
+
return this.#origin.type === 'opaque';
|
|
43
170
|
}
|
|
44
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Returns a stable string representation of this origin for identification, storage keys,
|
|
174
|
+
* or debugging logs.
|
|
175
|
+
*
|
|
176
|
+
* - For standard origins, returns the serialized origin string (e.g. `https://example.com:8080`).
|
|
177
|
+
* - For file origins, returns the path-scoped origin (e.g. `file:///path/to/file.html`).
|
|
178
|
+
* - For opaque origins, returns the unique UUID string.
|
|
179
|
+
*/
|
|
45
180
|
siteId(): string {
|
|
46
|
-
return this.#
|
|
181
|
+
return this.#origin.type === 'opaque' ? this.#origin.uuid : this.#origin.value;
|
|
47
182
|
}
|
|
48
183
|
}
|
|
@@ -6,7 +6,6 @@ import type * as Protocol from '../../generated/protocol.js';
|
|
|
6
6
|
import * as Common from '../common/common.js';
|
|
7
7
|
import * as Platform from '../platform/platform.js';
|
|
8
8
|
import * as ProtocolClient from '../protocol_client/protocol_client.js';
|
|
9
|
-
import * as Root from '../root/root.js';
|
|
10
9
|
|
|
11
10
|
import {SDKModel, type SDKModelConstructor} from './SDKModel.js';
|
|
12
11
|
import type {TargetManager} from './TargetManager.js';
|
|
@@ -50,10 +49,7 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
|
|
|
50
49
|
this.#capabilitiesMask = Capability.BROWSER | Capability.STORAGE | Capability.DOM | Capability.JS |
|
|
51
50
|
Capability.LOG | Capability.NETWORK | Capability.TARGET | Capability.TRACING | Capability.EMULATION |
|
|
52
51
|
Capability.INPUT | Capability.INSPECTOR | Capability.AUDITS | Capability.WEB_AUTHN | Capability.IO |
|
|
53
|
-
Capability.MEDIA | Capability.EVENT_BREAKPOINTS | Capability.DOM_STORAGE;
|
|
54
|
-
if (Root.Runtime.hostConfig.devToolsWebMCPSupport?.enabled) {
|
|
55
|
-
this.#capabilitiesMask |= Capability.WEB_MCP;
|
|
56
|
-
}
|
|
52
|
+
Capability.MEDIA | Capability.EVENT_BREAKPOINTS | Capability.DOM_STORAGE | Capability.WEB_MCP;
|
|
57
53
|
if (parentTarget?.type() !== Type.FRAME) {
|
|
58
54
|
// This matches backend exposing certain capabilities only for the main frame.
|
|
59
55
|
this.#capabilitiesMask |=
|
|
@@ -58,6 +58,7 @@ import * as LayerTreeBase from './LayerTreeBase.js';
|
|
|
58
58
|
import * as LogModel from './LogModel.js';
|
|
59
59
|
import * as NetworkManager from './NetworkManager.js';
|
|
60
60
|
import * as NetworkRequest from './NetworkRequest.js';
|
|
61
|
+
import * as NetworkRequestAccess from './NetworkRequestAccess.js';
|
|
61
62
|
import * as OverlayColorGenerator from './OverlayColorGenerator.js';
|
|
62
63
|
import * as OverlayModel from './OverlayModel.js';
|
|
63
64
|
import * as OverlayPersistentHighlighter from './OverlayPersistentHighlighter.js';
|
|
@@ -146,6 +147,7 @@ export {
|
|
|
146
147
|
LogModel,
|
|
147
148
|
NetworkManager,
|
|
148
149
|
NetworkRequest,
|
|
150
|
+
NetworkRequestAccess,
|
|
149
151
|
OverlayColorGenerator,
|
|
150
152
|
OverlayModel,
|
|
151
153
|
OverlayPersistentHighlighter,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../core/host/host.js';
|
|
6
|
+
import * as Root from '../../core/root/root.js';
|
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
8
|
import type * as LHModel from '../lighthouse/lighthouse.js';
|
|
8
9
|
import type * as Trace from '../trace/trace.js';
|
|
@@ -78,7 +79,9 @@ export class AiAgent2 extends AiAgent<unknown> {
|
|
|
78
79
|
// TODO: The static preamble is a placeholder and will eventually live server-side.
|
|
79
80
|
readonly preamble: string = preamble;
|
|
80
81
|
readonly clientFeature: Host.AidaClient.ClientFeature = Host.AidaClient.ClientFeature.CHROME_DEVTOOLS_V2_AGENT;
|
|
81
|
-
|
|
82
|
+
get userTier(): string|undefined {
|
|
83
|
+
return Root.Runtime.hostConfig.devToolsAiV2Architecture?.userTier;
|
|
84
|
+
}
|
|
82
85
|
|
|
83
86
|
#changes: ChangeManager;
|
|
84
87
|
#execJs: typeof executeJsCode;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2024 The Chromium Authors
|
|
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
|
-
import * as Common from '../../core/common/common.js';
|
|
5
4
|
import * as Host from '../../core/host/host.js';
|
|
6
5
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
6
|
import * as Root from '../../core/root/root.js';
|
|
@@ -46,14 +45,13 @@ export const NOT_FOUND_IMAGE_DATA = '';
|
|
|
46
45
|
export const CONTEXT_TITLE = 'Analyzing data';
|
|
47
46
|
const MAX_TITLE_LENGTH = 80;
|
|
48
47
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* - `about
|
|
52
|
-
* - `chrome://terms`:
|
|
53
|
-
* audit.
|
|
48
|
+
* Page URL prefixes permitted during an AI agent run.
|
|
49
|
+
* Agents trigger these navigations internally:
|
|
50
|
+
* - `about:blank`: Used before recording a performance trace to ensure a clean state.
|
|
51
|
+
* - `chrome://terms`: Used by Lighthouse during Back-Forward Cache audits.
|
|
54
52
|
*/
|
|
55
53
|
export const ALLOWED_PAGE_NAVIGATIONS: Platform.DevToolsPath.UrlString[] = [
|
|
56
|
-
Platform.DevToolsPath.urlString`about
|
|
54
|
+
Platform.DevToolsPath.urlString`about:blank`,
|
|
57
55
|
Platform.DevToolsPath.urlString`chrome://terms`,
|
|
58
56
|
];
|
|
59
57
|
|
|
@@ -431,14 +429,17 @@ export class AiConversation {
|
|
|
431
429
|
} = {},
|
|
432
430
|
): AsyncGenerator<ResponseData, void, void> {
|
|
433
431
|
this.#navigationOccurredDuringRun = false;
|
|
434
|
-
const originAtRunStart =
|
|
432
|
+
const originAtRunStart = getPrimaryPageSecurityOrigin(this.#targetManager);
|
|
435
433
|
const listener = (): void => {
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
|
|
434
|
+
// Prevent the agent from executing tools or reading data from an untrusted origin
|
|
435
|
+
// if the page navigates unexpectedly during execution.
|
|
436
|
+
const newInspectedURL = this.#targetManager.primaryPageTarget()?.inspectedURL();
|
|
437
|
+
const newOrigin = newInspectedURL ? SDK.SecurityOrigin.SecurityOrigin.create(newInspectedURL) : undefined;
|
|
438
|
+
const isSameOrigin = Boolean(originAtRunStart && newOrigin && originAtRunStart.isSameOriginWith(newOrigin));
|
|
439
|
+
const isAllowedNavigation =
|
|
440
|
+
Boolean(newInspectedURL && ALLOWED_PAGE_NAVIGATIONS.some(allowed => newInspectedURL.startsWith(allowed)));
|
|
441
|
+
|
|
442
|
+
if (!isSameOrigin && !isAllowedNavigation) {
|
|
442
443
|
this.#navigationOccurredDuringRun = true;
|
|
443
444
|
}
|
|
444
445
|
};
|
|
@@ -551,6 +552,10 @@ export class AiConversation {
|
|
|
551
552
|
return this.#type;
|
|
552
553
|
}
|
|
553
554
|
|
|
555
|
+
/**
|
|
556
|
+
* Returns the permitted origin for agent tool execution, or blocks execution
|
|
557
|
+
* if an unapproved cross-origin navigation occurred during the current run.
|
|
558
|
+
*/
|
|
554
559
|
allowedOrigin = (): AllowedOriginResult => {
|
|
555
560
|
if (this.#navigationOccurredDuringRun) {
|
|
556
561
|
return {blocked: true};
|
|
@@ -558,7 +563,7 @@ export class AiConversation {
|
|
|
558
563
|
if (this.#origin) {
|
|
559
564
|
return {origin: this.origin};
|
|
560
565
|
}
|
|
561
|
-
this.#origin =
|
|
566
|
+
this.#origin = getPrimaryPageSecurityOrigin(this.#targetManager);
|
|
562
567
|
|
|
563
568
|
return {origin: this.origin};
|
|
564
569
|
};
|
|
@@ -574,10 +579,16 @@ function isAiAssistanceServerSideLoggingAllowed(): boolean {
|
|
|
574
579
|
return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
|
|
575
580
|
}
|
|
576
581
|
|
|
577
|
-
|
|
582
|
+
/**
|
|
583
|
+
* Returns the security origin of the primary page target.
|
|
584
|
+
*
|
|
585
|
+
* @param targetManager Target manager used to locate the primary page target.
|
|
586
|
+
* @returns The parsed SecurityOrigin, or undefined if no target or inspected URL exists.
|
|
587
|
+
*/
|
|
588
|
+
function getPrimaryPageSecurityOrigin(
|
|
578
589
|
targetManager: SDK.TargetManager.TargetManager,
|
|
579
|
-
):
|
|
590
|
+
): SDK.SecurityOrigin.SecurityOrigin|undefined {
|
|
580
591
|
const target = targetManager.primaryPageTarget();
|
|
581
592
|
const inspectedURL = target?.inspectedURL();
|
|
582
|
-
return inspectedURL ?
|
|
593
|
+
return inspectedURL ? SDK.SecurityOrigin.SecurityOrigin.create(inspectedURL) : undefined;
|
|
583
594
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
-
import type * as Platform from '../../core/platform/platform.js';
|
|
9
8
|
import * as Root from '../../core/root/root.js';
|
|
10
9
|
|
|
11
10
|
import {debugLog} from './debug.js';
|
|
@@ -187,15 +186,6 @@ export function getIconName(): string {
|
|
|
187
186
|
return isGeminiBranding() ? 'spark' : 'smart-assistant';
|
|
188
187
|
}
|
|
189
188
|
|
|
190
|
-
export function isSameOrigin(url1: Platform.DevToolsPath.UrlString, url2: Platform.DevToolsPath.UrlString): boolean {
|
|
191
|
-
if (url1.startsWith('data:') || url2.startsWith('data:')) {
|
|
192
|
-
return url1 === url2;
|
|
193
|
-
}
|
|
194
|
-
const origin1 = Common.ParsedURL.ParsedURL.extractOrigin(url1);
|
|
195
|
-
const origin2 = Common.ParsedURL.ParsedURL.extractOrigin(url2);
|
|
196
|
-
return origin1 !== '' && origin1 === origin2;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
189
|
export interface OneShotPromptRequest {
|
|
200
190
|
aidaClient: Host.AidaClient.AidaClient;
|
|
201
191
|
preamble: string;
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../../core/host/host.js';
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
7
|
import * as Root from '../../../core/root/root.js';
|
|
9
8
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
10
9
|
import type * as LHModel from '../../lighthouse/lighthouse.js';
|
|
11
|
-
import {isSameOrigin} from '../AiUtils.js';
|
|
12
10
|
import {ChangeManager} from '../ChangeManager.js';
|
|
13
11
|
import {LighthouseFormatter} from '../data_formatters/LighthouseFormatter.js';
|
|
14
12
|
import {debugLog} from '../debug.js';
|
|
@@ -155,11 +153,15 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
155
153
|
return;
|
|
156
154
|
}
|
|
157
155
|
|
|
158
|
-
const details = await
|
|
156
|
+
const [details, widgets] = await Promise.all([
|
|
157
|
+
lhr.getUserFacingDetails(),
|
|
158
|
+
lhr.getWidgets(),
|
|
159
|
+
]);
|
|
159
160
|
if (details) {
|
|
160
161
|
yield {
|
|
161
162
|
type: ResponseType.CONTEXT,
|
|
162
163
|
details,
|
|
164
|
+
widgets,
|
|
163
165
|
};
|
|
164
166
|
}
|
|
165
167
|
}
|
|
@@ -183,13 +185,7 @@ export class AccessibilityAgent extends AiAgent<LHModel.ReporterTypes.ReportJSON
|
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
const mainDocument = domModel.existingDocument();
|
|
186
|
-
if (!mainDocument) {
|
|
187
|
-
return null;
|
|
188
|
-
}
|
|
189
|
-
const mainDocumentURL = mainDocument.documentURL;
|
|
190
|
-
const nodeDocumentURL = node.ownerDocument?.documentURL ?? '' as Platform.DevToolsPath.UrlString;
|
|
191
|
-
|
|
192
|
-
if (!isSameOrigin(mainDocumentURL, nodeDocumentURL)) {
|
|
188
|
+
if (!mainDocument || !mainDocument.securityOrigin().isSameOriginWith(node.securityOrigin())) {
|
|
193
189
|
return null;
|
|
194
190
|
}
|
|
195
191
|
|
|
@@ -94,7 +94,6 @@ const MULTIMODAL_ENHANCEMENT_PROMPTS: Record<MultimodalInputType, string> = {
|
|
|
94
94
|
[MultimodalInputType.UPLOADED_IMAGE]: promptForUploadedImage + considerationsForMultimodalInputEvaluation,
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
98
97
|
export const AI_ASSISTANCE_FILTER_REGEX: string = `\\.${AI_ASSISTANCE_CSS_CLASS_NAME}-.*&`;
|
|
99
98
|
|
|
100
99
|
/**
|
|
@@ -90,7 +90,6 @@ function freestylerBindingFunc(bindingName: string): void {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
94
93
|
export const freestylerBinding: string = `(${String(freestylerBindingFunc)})('${FREESTYLER_BINDING_NAME}')`;
|
|
95
94
|
|
|
96
95
|
export const PAGE_EXPOSED_FUNCTIONS: string[] = ['setElementStyles'];
|
|
@@ -172,5 +171,4 @@ const setupSetElementStyles = `function setupSetElementStyles(prefix) {
|
|
|
172
171
|
global.setElementStyles = setElementStyles;
|
|
173
172
|
}`;
|
|
174
173
|
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
176
174
|
export const injectedFunctions: string = `(${setupSetElementStyles})('${AI_ASSISTANCE_CSS_CLASS_NAME}')`;
|
|
@@ -7282,7 +7282,7 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
|
|
|
7282
7282
|
},
|
|
7283
7283
|
{
|
|
7284
7284
|
name: "RTCDTMFToneChangeEvent",
|
|
7285
|
-
signatures: [["type","eventInitDict"]]
|
|
7285
|
+
signatures: [["type","?eventInitDict"]]
|
|
7286
7286
|
},
|
|
7287
7287
|
{
|
|
7288
7288
|
name: "RTCEncodedAudioFrame",
|
|
@@ -72,8 +72,7 @@ export const UIStrings = {
|
|
|
72
72
|
} as const;
|
|
73
73
|
|
|
74
74
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/CLSCulprits.ts', UIStrings);
|
|
75
|
-
export const i18nString:
|
|
76
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
75
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
77
76
|
|
|
78
77
|
export type CLSCulpritsInsightModel = InsightModel<typeof UIStrings, {
|
|
79
78
|
animationFailures: readonly NoncompositedAnimationFailure[],
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import * as Protocol from '../../../generated/protocol.js';
|
|
8
7
|
import type * as Handlers from '../handlers/handlers.js';
|
|
9
8
|
import * as Helpers from '../helpers/helpers.js';
|
|
@@ -49,8 +48,7 @@ export const UIStrings = {
|
|
|
49
48
|
} as const;
|
|
50
49
|
|
|
51
50
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/Cache.ts', UIStrings);
|
|
52
|
-
export const i18nString:
|
|
53
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
51
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
54
52
|
|
|
55
53
|
export type CacheInsightModel = InsightModel<typeof UIStrings, {
|
|
56
54
|
requests: Array<{
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import type * as Handlers from '../handlers/handlers.js';
|
|
8
7
|
import type * as Types from '../types/types.js';
|
|
9
8
|
|
|
@@ -54,8 +53,7 @@ export const UIStrings = {
|
|
|
54
53
|
} as const;
|
|
55
54
|
|
|
56
55
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/CharacterSet.ts', UIStrings);
|
|
57
|
-
export const i18nString:
|
|
58
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
56
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
59
57
|
|
|
60
58
|
const CHARSET_HTTP_REGEX = /charset\s*=\s*[a-zA-Z0-9\-_:.()]{2,}/i;
|
|
61
59
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as Common from '../../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
8
7
|
import * as Handlers from '../handlers/handlers.js';
|
|
9
8
|
import * as Helpers from '../helpers/helpers.js';
|
|
10
9
|
import * as Types from '../types/types.js';
|
|
@@ -73,8 +72,7 @@ export const UIStrings = {
|
|
|
73
72
|
} as const;
|
|
74
73
|
|
|
75
74
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DOMSize.ts', UIStrings);
|
|
76
|
-
export const i18nString:
|
|
77
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
75
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
78
76
|
|
|
79
77
|
const DOM_SIZE_DURATION_THRESHOLD = Helpers.Timing.milliToMicro(Types.Timing.Milli(40));
|
|
80
78
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import type * as Handlers from '../handlers/handlers.js';
|
|
8
7
|
import * as Helpers from '../helpers/helpers.js';
|
|
9
8
|
import * as Types from '../types/types.js';
|
|
@@ -72,8 +71,7 @@ export const UIStrings = {
|
|
|
72
71
|
} as const;
|
|
73
72
|
|
|
74
73
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DocumentLatency.ts', UIStrings);
|
|
75
|
-
export const i18nString:
|
|
76
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
74
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
77
75
|
|
|
78
76
|
// Due to the way that DevTools throttling works we cannot see if server response took less than ~570ms.
|
|
79
77
|
// We set our failure threshold to 600ms to avoid those false positives but we want devs to shoot for 100ms.
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import * as Extras from '../extras/extras.js';
|
|
8
7
|
import type * as Handlers from '../handlers/handlers.js';
|
|
9
8
|
import * as Helpers from '../helpers/helpers.js';
|
|
@@ -43,8 +42,7 @@ export const UIStrings = {
|
|
|
43
42
|
} as const;
|
|
44
43
|
|
|
45
44
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/DuplicatedJavaScript.ts', UIStrings);
|
|
46
|
-
export const i18nString:
|
|
47
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
45
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
48
46
|
|
|
49
47
|
export type DuplicatedJavaScriptInsightModel = InsightModel<typeof UIStrings, {
|
|
50
48
|
duplication: Extras.ScriptDuplication.ScriptDuplication,
|
|
@@ -41,8 +41,7 @@ export const UIStrings = {
|
|
|
41
41
|
} as const;
|
|
42
42
|
|
|
43
43
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/FontDisplay.ts', UIStrings);
|
|
44
|
-
export const i18nString:
|
|
45
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
44
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
46
45
|
|
|
47
46
|
export interface RemoteFont {
|
|
48
47
|
name?: string;
|
|
@@ -51,8 +51,7 @@ export const UIStrings = {
|
|
|
51
51
|
} as const;
|
|
52
52
|
|
|
53
53
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ForcedReflow.ts', UIStrings);
|
|
54
|
-
export const i18nString:
|
|
55
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
54
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
56
55
|
|
|
57
56
|
export type ForcedReflowInsightModel = InsightModel<typeof UIStrings, {
|
|
58
57
|
topLevelFunctionCallData: ForcedReflowAggregatedData | undefined,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import * as Handlers from '../handlers/handlers.js';
|
|
8
7
|
import * as Helpers from '../helpers/helpers.js';
|
|
9
8
|
import type * as Types from '../types/types.js';
|
|
@@ -55,8 +54,7 @@ export const UIStrings = {
|
|
|
55
54
|
} as const;
|
|
56
55
|
|
|
57
56
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/INPBreakdown.ts', UIStrings);
|
|
58
|
-
export const i18nString:
|
|
59
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
57
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
60
58
|
|
|
61
59
|
export type INPBreakdownInsightModel = InsightModel<typeof UIStrings, {
|
|
62
60
|
longestInteractionEvent?: Types.Events.SyntheticInteractionPair,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import type * as Platform from '../../../core/platform/platform.js';
|
|
7
6
|
import type * as Handlers from '../handlers/handlers.js';
|
|
8
7
|
import * as Helpers from '../helpers/helpers.js';
|
|
9
8
|
import type * as Types from '../types/types.js';
|
|
@@ -69,8 +68,7 @@ export const UIStrings = {
|
|
|
69
68
|
} as const;
|
|
70
69
|
|
|
71
70
|
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ImageDelivery.ts', UIStrings);
|
|
72
|
-
export const i18nString:
|
|
73
|
-
Platform.UIString.LocalizedString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
71
|
+
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
74
72
|
|
|
75
73
|
/**
|
|
76
74
|
* Even JPEGs with lots of detail can usually be compressed down to <1 byte per pixel
|