chrome-devtools-frontend 1.0.1684555 → 1.0.1689415
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/gerrit-cli/SKILL.md +29 -8
- package/.agents/skills/gerrit-cli/references/commands.md +51 -18
- package/.agents/skills/gerrit-cli/references/workflows.md +6 -6
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +43 -70
- package/config/typescript/tsconfig.base.json +1 -0
- package/config/typescript/tsconfig.eslint.json +9 -0
- package/docs/contributing/issues.md +1 -1
- package/docs/styleguide/ux/writing.md +2 -2
- package/eslint.config.mjs +18 -10
- package/front_end/core/common/Base64.ts +1 -1
- package/front_end/core/common/Color.ts +28 -6
- package/front_end/core/common/ColorConverter.ts +12 -0
- package/front_end/core/common/Console.ts +2 -1
- package/front_end/core/common/Object.ts +2 -2
- package/front_end/core/common/ResourceType.ts +12 -13
- package/front_end/core/common/Revealer.ts +1 -1
- package/front_end/core/common/Settings.ts +2 -2
- package/front_end/core/common/TextDictionary.ts +2 -2
- package/front_end/core/common/Throttler.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +51 -37
- package/front_end/core/host/host.ts +1 -1
- package/front_end/core/i18n/i18nImpl.ts +1 -1
- package/front_end/core/platform/HostRuntime.ts +3 -3
- package/front_end/core/platform/KeyboardUtilities.ts +1 -1
- package/front_end/core/protocol_client/InspectorBackend.ts +7 -6
- package/front_end/core/root/Runtime.ts +4 -2
- package/front_end/core/sdk/AnimationModel.ts +1 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +198 -0
- package/front_end/core/sdk/CSSMetadata.ts +11 -6
- package/front_end/core/sdk/CSSPropertyParser.ts +5 -3
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +90 -59
- package/front_end/core/sdk/ConsoleModel.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -3
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/core/sdk/EmulationModel.ts +5 -0
- package/front_end/core/sdk/LayerTreeBase.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +1 -1
- package/front_end/core/sdk/README.md +40 -0
- package/front_end/core/sdk/RehydratingConnection.ts +1 -1
- package/front_end/core/sdk/RemoteObject.ts +1 -1
- package/front_end/core/sdk/ResourceTreeModel.ts +2 -2
- package/front_end/core/sdk/SDKModel.ts +1 -1
- package/front_end/core/sdk/SDKSettings.ts +6 -0
- package/front_end/core/sdk/Script.ts +2 -1
- package/front_end/core/sdk/SecurityOrigin.ts +48 -0
- package/front_end/core/sdk/ServiceWorkerManager.ts +75 -17
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/core/text_utils/ContentData.ts +1 -1
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +3 -1
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -1
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +1 -1
- package/front_end/entrypoints/inspector_main/nodeIcon.css +1 -1
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +3 -3
- package/front_end/entrypoints/inspector_main/renderingOptions.css +3 -3
- package/front_end/entrypoints/js_app/js_app.ts +25 -9
- package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +5 -5
- package/front_end/entrypoints/node_app/node_app.ts +1 -1
- package/front_end/generated/ARIAProperties.ts +39 -1
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.ts +60 -119
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +12 -2
- package/front_end/models/ai_assistance/AiAgent2.ts +13 -7
- package/front_end/models/ai_assistance/AiConversation.ts +8 -17
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +2 -2
- package/front_end/models/ai_assistance/AiUtils.ts +16 -0
- package/front_end/models/ai_assistance/EvaluateAction.ts +1 -1
- package/front_end/models/ai_assistance/README.md +1 -1
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -3
- package/front_end/models/ai_assistance/agents/AiAgent.ts +29 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -3
- package/front_end/models/ai_assistance/agents/FileAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +7 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -7
- package/front_end/models/ai_assistance/ai_assistance.ts +8 -0
- package/front_end/models/ai_assistance/contexts/AccessibilityContext.ts +16 -1
- package/front_end/models/ai_assistance/contexts/FileContext.ts +6 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +150 -325
- package/front_end/models/ai_assistance/injected.ts +5 -3
- package/front_end/models/ai_assistance/performance/AIContext.ts +1 -1
- package/front_end/models/ai_assistance/skills/README.md +1 -1
- package/front_end/models/ai_assistance/skills/accessibility.md +19 -10
- package/front_end/models/ai_assistance/skills/network.md +13 -7
- package/front_end/models/ai_assistance/skills/performance.md +22 -16
- package/front_end/models/ai_assistance/skills/sources.md +13 -7
- package/front_end/models/ai_assistance/skills/storage.md +19 -18
- package/front_end/models/ai_assistance/skills/styling.md +30 -37
- package/front_end/models/ai_assistance/tools/CookieUtils.ts +120 -0
- package/front_end/models/ai_assistance/tools/DOMStorageUtils.ts +53 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +8 -32
- package/front_end/models/ai_assistance/tools/GetCookieValues.ts +146 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +11 -9
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +17 -5
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +12 -11
- package/front_end/models/ai_assistance/tools/GetInsightDetails.ts +11 -11
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +12 -12
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +3 -2
- package/front_end/models/ai_assistance/tools/GetStorageBreakdown.ts +132 -0
- package/front_end/models/ai_assistance/tools/GetStorageValues.ts +17 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +3 -3
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +13 -14
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +12 -10
- package/front_end/models/ai_assistance/tools/ListCookies.ts +93 -0
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +15 -6
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +3 -3
- package/front_end/models/ai_assistance/tools/ListSources.ts +5 -3
- package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +16 -4
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +3 -2
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +4 -3
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +9 -9
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +9 -8
- package/front_end/models/ai_assistance/tools/Tool.ts +21 -11
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +41 -8
- package/front_end/models/badges/AiExplorerBadge.ts +3 -3
- package/front_end/models/badges/CodeWhispererBadge.ts +2 -2
- package/front_end/models/badges/DOMDetectiveBadge.ts +3 -3
- package/front_end/models/badges/SpeedsterBadge.ts +3 -3
- package/front_end/models/badges/StarterBadge.ts +4 -4
- package/front_end/models/bindings/CompilerScriptMapping.ts +11 -2
- package/front_end/models/bindings/ContentProviderBasedProject.ts +3 -2
- package/front_end/models/breakpoints/BreakpointManager.ts +1 -1
- package/front_end/models/emulation/EmulatedDevices.ts +2 -2
- package/front_end/models/formatter/FormatterWorkerPool.ts +2 -2
- package/front_end/models/formatter/ScriptFormatter.ts +1 -2
- package/front_end/models/geometry/GeometryImpl.ts +2 -2
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +1 -1
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +3 -2
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/GenericIssue.ts +18 -18
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +1 -1
- package/front_end/models/javascript_metadata/{NativeFunctions.js → NativeFunctions.ts} +25 -9
- package/front_end/models/live-metrics/LiveMetrics.ts +9 -3
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +58 -6
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +2 -62
- package/front_end/models/network_time_calculator/RequestTimeRanges.ts +2 -2
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +35 -6
- package/front_end/models/stack_trace/StackTraceImpl.ts +2 -2
- package/front_end/models/trace/LanternComputationData.ts +2 -3
- package/front_end/models/trace/extras/StackTraceForEvent.ts +3 -2
- package/front_end/models/trace/extras/ThirdParties.ts +9 -9
- package/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +7 -4
- package/front_end/models/trace/handlers/FramesHandler.ts +3 -3
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/handlers/SamplesHandler.ts +4 -2
- package/front_end/models/trace/handlers/UserInteractionsHandler.ts +1 -1
- package/front_end/models/trace/handlers/WarningsHandler.ts +2 -2
- package/front_end/models/trace/helpers/Network.ts +3 -3
- package/front_end/models/trace/helpers/Trace.ts +1 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
- package/front_end/models/trace/insights/Cache.ts +3 -1
- package/front_end/models/trace/insights/CharacterSet.ts +3 -1
- package/front_end/models/trace/insights/DOMSize.ts +3 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -1
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -1
- package/front_end/models/trace/insights/FontDisplay.ts +2 -1
- package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +3 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +3 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +3 -1
- package/front_end/models/trace/insights/LegacyJavaScript.ts +3 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +5 -4
- package/front_end/models/trace/insights/SlowCSSSelector.ts +3 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -3
- package/front_end/models/trace/insights/Viewport.ts +2 -1
- package/front_end/models/trace/lantern/simulation/Constants.ts +34 -2
- package/front_end/models/trace/lantern/simulation/DNSCache.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +8 -3
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -1
- package/front_end/models/workspace/WorkspaceImpl.ts +18 -2
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +686 -2
- package/front_end/panels/accessibility/accessibilityNode.css +4 -4
- package/front_end/panels/accessibility/accessibilityProperties.css +1 -1
- package/front_end/panels/accessibility/accessibilitySidebarView.css +2 -2
- package/front_end/panels/accessibility/axBreadcrumbs.css +13 -13
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +14 -14
- package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -1
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/chatInput.css +12 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +16 -16
- package/front_end/panels/ai_assistance/components/chatView.css +2 -2
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -1
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +4 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +6 -6
- package/front_end/panels/animation/animationTimeline.css +62 -62
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -1
- package/front_end/panels/application/BackgroundServiceView.ts +290 -252
- package/front_end/panels/application/WebMCPView.ts +15 -7
- package/front_end/panels/application/appManifestView.css +5 -5
- package/front_end/panels/application/backgroundServiceView.css +18 -2
- package/front_end/panels/application/components/AdsView.ts +100 -4
- package/front_end/panels/application/components/adsView.css +8 -5
- package/front_end/panels/application/components/backForwardCacheView.css +5 -5
- package/front_end/panels/application/components/bounceTrackingMitigationsView.css +1 -1
- package/front_end/panels/application/components/endpointsGrid.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/components/protocolHandlersView.css +6 -6
- package/front_end/panels/application/components/reportsGrid.css +1 -1
- package/front_end/panels/application/components/serviceWorkerRouterView.css +4 -4
- package/front_end/panels/application/components/trustTokensView.css +7 -7
- package/front_end/panels/application/cookieItemsView.css +3 -3
- package/front_end/panels/application/deviceBoundSessionsView.css +3 -3
- package/front_end/panels/application/frameDetailsReportView.css +11 -11
- package/front_end/panels/application/indexedDBViews.css +7 -7
- package/front_end/panels/application/originTrialTokenRows.css +2 -2
- package/front_end/panels/application/originTrialTreeView.css +3 -3
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +1 -1
- package/front_end/panels/application/preloading/components/preloadingDisabledInfobar.css +2 -2
- package/front_end/panels/application/preloading/components/preloadingGrid.css +2 -2
- package/front_end/panels/application/preloading/components/usedPreloadingView.css +7 -7
- package/front_end/panels/application/preloading/preloadingView.css +1 -1
- package/front_end/panels/application/preloading/preloadingViewDropDown.css +3 -3
- package/front_end/panels/application/serviceWorkerCacheViews.css +5 -5
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +12 -12
- package/front_end/panels/application/serviceWorkersView.css +15 -16
- package/front_end/panels/application/storageView.css +5 -5
- package/front_end/panels/application/webMCPView.css +9 -9
- package/front_end/panels/autofill/autofillView.css +4 -4
- package/front_end/panels/browser_debugger/categorizedBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/browser_debugger/domBreakpointsSidebarPane.css +5 -3
- package/front_end/panels/browser_debugger/xhrBreakpointsSidebarPane.css +4 -4
- package/front_end/panels/changes/changesSidebar.css +1 -1
- package/front_end/panels/changes/changesView.css +1 -1
- package/front_end/panels/changes/combinedDiffView.css +1 -1
- package/front_end/panels/common/CPUThrottlingOption.ts +5 -10
- package/front_end/panels/common/badgeNotification.css +2 -2
- package/front_end/panels/common/domLinkifier.css +1 -1
- package/front_end/panels/common/gdpSignUpDialog.css +3 -3
- package/front_end/panels/common/geminiRebrandPromoDialog.css +1 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -3
- package/front_end/panels/console/ConsoleView.ts +6 -3
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -1
- package/front_end/panels/console/console-meta.ts +5 -24
- package/front_end/panels/console/consoleContextSelector.css +2 -2
- package/front_end/panels/console/consolePinPane.css +9 -9
- package/front_end/panels/console/consolePrompt.css +5 -5
- package/front_end/panels/console/consoleView.css +39 -39
- package/front_end/panels/coverage/coverageListView.css +2 -2
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +34 -34
- package/front_end/panels/css_overview/cssOverviewProcessingView.css +5 -5
- package/front_end/panels/css_overview/cssOverviewSidebarPanel.css +1 -1
- package/front_end/panels/css_overview/cssOverviewStartView.css +17 -17
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +209 -62
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +4 -4
- package/front_end/panels/elements/DOMTreeContextMenu.ts +59 -54
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +130 -94
- package/front_end/panels/elements/ElementsTreeOutline.ts +1751 -363
- package/front_end/panels/elements/ShortcutTreeElement.ts +6 -3
- package/front_end/panels/elements/StylePropertiesSection.ts +65 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +143 -8
- package/front_end/panels/elements/classesPaneWidget.css +6 -6
- package/front_end/panels/elements/components/stylePropertyEditor.css +7 -7
- package/front_end/panels/elements/computedStyleWidget.css +1 -1
- package/front_end/panels/elements/elementStatePaneWidget.css +8 -8
- package/front_end/panels/elements/elements-meta.ts +14 -0
- package/front_end/panels/elements/elementsPanel.css +4 -4
- package/front_end/panels/elements/elementsTreeOutline.css +222 -38
- package/front_end/panels/elements/layersWidget.css +4 -4
- package/front_end/panels/elements/layoutPane.css +18 -18
- package/front_end/panels/elements/metricsSidebarPane.css +11 -11
- package/front_end/panels/elements/platformFontsWidget.css +5 -5
- package/front_end/panels/elements/propertiesWidget.css +2 -2
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +20 -20
- package/front_end/panels/elements/stylesSidebarPane.css +37 -20
- package/front_end/panels/emulation/deviceModeView.css +49 -49
- package/front_end/panels/emulation/mediaQueryInspector.css +18 -18
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +29 -29
- package/front_end/panels/issues/components/elementsPanelLink.css +2 -2
- package/front_end/panels/issues/components/hideIssuesMenu.css +1 -1
- package/front_end/panels/issues/issuesPane.css +2 -2
- package/front_end/panels/issues/issuesTree.css +50 -50
- package/front_end/panels/layer_viewer/Layers3DView.ts +9 -10
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +2 -2
- package/front_end/panels/layer_viewer/layers3DView.css +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +1 -1
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/media/playerListView.css +9 -9
- package/front_end/panels/media/playerMessagesView.css +8 -8
- package/front_end/panels/media/playerPropertiesView.css +6 -6
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +9 -9
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -0
- package/front_end/panels/network/NetworkPanel.ts +9 -4
- package/front_end/panels/network/RequestConditionsDrawer.ts +12 -12
- package/front_end/panels/network/RequestPayloadView.ts +78 -26
- package/front_end/panels/network/binaryResourceView.css +1 -1
- package/front_end/panels/network/components/EditableSpan.css +3 -3
- package/front_end/panels/network/components/HeaderSectionRow.css +14 -14
- package/front_end/panels/network/components/RequestHeaderSection.css +7 -7
- package/front_end/panels/network/components/RequestHeadersView.css +18 -18
- package/front_end/panels/network/components/RequestTrustTokensView.css +1 -1
- package/front_end/panels/network/network-meta.ts +9 -9
- package/front_end/panels/network/networkConfigView.css +11 -11
- package/front_end/panels/network/networkLogView.css +35 -35
- package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
- package/front_end/panels/network/networkPanel.css +7 -7
- package/front_end/panels/network/networkTimingTable.css +13 -13
- package/front_end/panels/network/requestConditionsDrawer.css +4 -4
- package/front_end/panels/network/requestCookiesView.css +5 -5
- package/front_end/panels/network/requestDeviceBoundSessionsView.css +1 -1
- package/front_end/panels/network/requestHTMLView.css +1 -1
- package/front_end/panels/network/requestHeadersTree.css +19 -19
- package/front_end/panels/network/requestInitiatorView.css +1 -1
- package/front_end/panels/network/requestInitiatorViewTree.css +3 -3
- package/front_end/panels/network/requestPayloadTree.css +5 -5
- package/front_end/panels/network/requestPayloadView.css +1 -1
- package/front_end/panels/network/resourceChunkView.css +3 -3
- package/front_end/panels/network/signedExchangeInfoTree.css +6 -6
- package/front_end/panels/profiler/heapProfiler.css +15 -15
- package/front_end/panels/profiler/profileLauncherView.css +10 -10
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/StepEditor.ts +86 -7
- package/front_end/panels/recorder/TimelineSection.ts +2 -1
- package/front_end/panels/recorder/createRecordingView.css +17 -17
- package/front_end/panels/recorder/extensionView.css +5 -5
- package/front_end/panels/recorder/injected/RecordingClient.ts +1 -1
- package/front_end/panels/recorder/models/SchemaUtils.ts +2 -2
- package/front_end/panels/recorder/models/ScreenshotStorage.ts +1 -1
- package/front_end/panels/recorder/recorderPanel.css +7 -7
- package/front_end/panels/recorder/recordingListView.css +12 -12
- package/front_end/panels/recorder/recordingView.css +47 -47
- package/front_end/panels/recorder/stepEditor.css +2 -2
- package/front_end/panels/recorder/stepView.css +20 -20
- package/front_end/panels/recorder/timelineSection.css +9 -9
- package/front_end/panels/screencast/screencastView.css +12 -12
- package/front_end/panels/search/searchResultsPane.css +10 -10
- package/front_end/panels/search/searchView.css +9 -9
- package/front_end/panels/security/SecurityPanel.ts +84 -54
- package/front_end/panels/security/mainView.css +26 -26
- package/front_end/panels/security/originView.css +15 -15
- package/front_end/panels/sensors/locationsSettingsTab.css +6 -6
- package/front_end/panels/sensors/sensors.css +28 -28
- package/front_end/panels/settings/components/syncSection.css +5 -5
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +13 -13
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +16 -16
- package/front_end/panels/settings/frameworkIgnoreListSettingsTab.css +2 -2
- package/front_end/panels/settings/keybindsSettingsTab.css +2 -2
- package/front_end/panels/settings/settingsScreen.css +5 -5
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
- package/front_end/panels/sources/breakpointEditDialog.css +9 -9
- package/front_end/panels/sources/breakpointsView.css +25 -25
- package/front_end/panels/sources/callStackSidebarPane.css +10 -10
- package/front_end/panels/sources/components/HeadersView.css +6 -6
- package/front_end/panels/sources/debuggerPausedMessage.css +4 -4
- package/front_end/panels/sources/dialog.css +2 -2
- package/front_end/panels/sources/navigatorTree.css +2 -2
- package/front_end/panels/sources/navigatorView.css +2 -2
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/sources/sourcesNavigator.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/sources/sourcesView.css +1 -1
- package/front_end/panels/sources/threadsSidebarPane.css +5 -5
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +8 -8
- package/front_end/panels/timeline/TimelineDetailsView.ts +9 -21
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -5
- package/front_end/panels/timeline/TimelineMiniMap.ts +3 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/breadcrumbsUI.css +3 -3
- package/front_end/panels/timeline/components/exportTraceOptions.css +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +13 -13
- package/front_end/panels/timeline/components/ignoreListSetting.css +3 -3
- package/front_end/panels/timeline/components/liveMetricsView.css +39 -39
- package/front_end/panels/timeline/components/metricCard.css +20 -20
- package/front_end/panels/timeline/components/networkRequestDetails.css +9 -9
- package/front_end/panels/timeline/components/networkRequestTooltip.css +14 -14
- package/front_end/panels/timeline/components/networkTrackWidget.css +2 -2
- package/front_end/panels/timeline/components/originMap.css +4 -4
- package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +5 -5
- package/front_end/panels/timeline/components/sidebarSingleInsightSet.css +1 -1
- package/front_end/panels/timeline/components/timelineSummary.css +4 -4
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -4
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +6 -6
- package/front_end/panels/timeline/overlays/components/TimeRangeOverlay.ts +1 -1
- package/front_end/panels/timeline/thirdPartyTreeView.css +5 -5
- package/front_end/panels/timeline/timeline-meta.ts +0 -6
- package/front_end/panels/timeline/timelineDetailsView.css +11 -11
- package/front_end/panels/timeline/timelinePanel.css +20 -20
- package/front_end/panels/timeline/timelineTreeView.css +8 -8
- package/front_end/panels/webauthn/webauthnPane.css +6 -6
- package/front_end/panels/whats_new/ReleaseNoteText.ts +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +42 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +15 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +14 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +23 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js +77 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/Poller.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +15 -1
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +16 -2
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +36 -1
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/Poller.ts +86 -6
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +22 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +6 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +30 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +14 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +19 -13
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/doubleRAF.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +3 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +15 -1
- package/front_end/third_party/web-vitals/package/package.json +1 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +9 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +36 -5
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +21 -15
- package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +16 -1
- package/front_end/third_party/web-vitals/rebuild.sh +3 -3
- package/front_end/ui/comments/CommentAnchorResolver.ts +15 -4
- package/front_end/ui/comments/commentsOverlay.css +6 -5
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/adorners/adorner.css +6 -6
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/buttons/button.css +9 -9
- package/front_end/ui/components/buttons/floatingButton.css +2 -2
- package/front_end/ui/components/buttons/textButton.css +12 -12
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/dialog.css +1 -1
- package/front_end/ui/components/diff_view/diffView.css +3 -3
- package/front_end/ui/components/expandable_list/expandableList.css +9 -9
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +4 -0
- package/front_end/ui/components/icon_button/iconButton.css +2 -2
- package/front_end/ui/components/input/checkbox.css +8 -8
- package/front_end/ui/components/input/textInput.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/linkifier/linkifierImpl.css +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +1 -1
- package/front_end/ui/components/markdown_view/codeBlock.css +2 -2
- package/front_end/ui/components/markdown_view/markdownView.css +7 -7
- package/front_end/ui/components/menus/menuGroup.css +2 -2
- package/front_end/ui/components/menus/menuItem.css +2 -2
- package/front_end/ui/components/menus/selectMenu.css +2 -2
- package/front_end/ui/components/menus/selectMenuButton.css +4 -4
- package/front_end/ui/components/panel_feedback/panelFeedback.css +15 -15
- package/front_end/ui/components/panel_feedback/previewToggle.css +2 -2
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +7 -7
- package/front_end/ui/components/report_view/report.css +3 -3
- package/front_end/ui/components/report_view/reportSectionDivider.css +1 -1
- package/front_end/ui/components/report_view/reportValue.css +1 -1
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/settings/settingCheckbox.css +6 -6
- package/front_end/ui/components/text_editor/TextEditor.ts +3 -1
- package/front_end/ui/components/text_editor/config.ts +16 -4
- package/front_end/ui/kit/icons/icon.css +4 -4
- package/front_end/ui/kit/link/link.css +1 -1
- package/front_end/ui/legacy/ActionRegistration.ts +23 -23
- package/front_end/ui/legacy/Dialog.ts +1 -1
- package/front_end/ui/legacy/DockController.ts +3 -3
- package/front_end/ui/legacy/EmptyWidget.ts +13 -34
- package/front_end/ui/legacy/FilterBar.ts +4 -4
- package/front_end/ui/legacy/Infobar.ts +2 -2
- package/front_end/ui/legacy/InspectorDrawerView.ts +6 -6
- package/front_end/ui/legacy/InspectorView.ts +19 -26
- package/front_end/ui/legacy/ListWidget.ts +7 -7
- package/front_end/ui/legacy/PlusButton.ts +1 -3
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +6 -6
- package/front_end/ui/legacy/SearchableView.ts +16 -16
- package/front_end/ui/legacy/SoftContextMenu.ts +8 -8
- package/front_end/ui/legacy/SoftDropDown.ts +1 -1
- package/front_end/ui/legacy/SuggestBox.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +10 -10
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -2
- package/front_end/ui/legacy/Toolbar.ts +5 -5
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +80 -20
- package/front_end/ui/legacy/ViewManager.ts +1 -1
- package/front_end/ui/legacy/ViewRegistration.ts +7 -7
- package/front_end/ui/legacy/Widget.ts +5 -5
- package/front_end/ui/legacy/checkboxTextLabel.css +3 -3
- package/front_end/ui/legacy/components/color_picker/ColorFormatSpec.ts +16 -0
- package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +1 -0
- package/front_end/ui/legacy/components/color_picker/spectrum.css +90 -90
- package/front_end/ui/legacy/components/cookie_table/cookiesTable.css +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +26 -28
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +3 -7
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +13 -13
- package/front_end/ui/legacy/components/inline_editor/colorSwatch.css +7 -7
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +5 -5
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +18 -18
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +104 -86
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +8 -6
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +4 -4
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +28 -11
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +0 -4
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +4 -4
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +7 -7
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -11
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +6 -6
- package/front_end/ui/legacy/components/perf_ui/timelineGrid.css +5 -5
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +3 -3
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/jsonView.css +1 -1
- package/front_end/ui/legacy/components/source_frame/resourceSourceFrame.css +1 -1
- package/front_end/ui/legacy/components/source_frame/xmlTree.css +3 -3
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- package/front_end/ui/legacy/components/utils/jsUtils.css +10 -10
- package/front_end/ui/legacy/dropTarget.css +2 -2
- package/front_end/ui/legacy/emptyWidget.css +6 -0
- package/front_end/ui/legacy/filter.css +19 -19
- package/front_end/ui/legacy/infobar.css +2 -2
- package/front_end/ui/legacy/inspectorCommon.css +67 -67
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +5 -5
- package/front_end/ui/legacy/progressIndicator.css +4 -4
- package/front_end/ui/legacy/reportView.css +7 -7
- package/front_end/ui/legacy/searchableView.css +5 -5
- package/front_end/ui/legacy/smallBubble.css +3 -3
- package/front_end/ui/legacy/softContextMenu.css +4 -4
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/splitWidget.css +9 -31
- package/front_end/ui/legacy/suggestBox.css +4 -4
- package/front_end/ui/legacy/tabbedPane.css +17 -17
- package/front_end/ui/legacy/textPrompt.css +2 -2
- package/front_end/ui/legacy/toolbar.css +4 -4
- package/front_end/ui/legacy/treeoutline.css +14 -14
- package/front_end/ui/legacy/viewContainers.css +6 -6
- package/front_end/ui/settings/ConsoleSettings.ts +34 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +12 -0
- package/inspector_overlay/common.ts +12 -12
- package/inspector_overlay/css_grid_label_helpers.ts +16 -17
- package/inspector_overlay/drag_resize_handler.ts +2 -2
- package/inspector_overlay/highlight_common.ts +11 -13
- package/inspector_overlay/highlight_container_query.ts +2 -2
- package/inspector_overlay/highlight_flex_common.ts +6 -7
- package/inspector_overlay/highlight_grid_common.ts +3 -3
- package/inspector_overlay/highlight_isolated_element.ts +12 -3
- package/inspector_overlay/highlight_scroll_snap.ts +2 -2
- package/inspector_overlay/loadCSS.rollup.js +0 -1
- package/inspector_overlay/testing/InspectorOverlayHelpers.ts +13 -13
- package/inspector_overlay/tool_green_dev_anchors.ts +3 -3
- package/inspector_overlay/tool_highlight.ts +9 -9
- package/inspector_overlay/tool_paused.ts +4 -4
- package/inspector_overlay/tool_persistent.ts +11 -11
- package/inspector_overlay/tool_screenshot.ts +7 -7
- package/inspector_overlay/tool_source_order.ts +4 -4
- package/inspector_overlay/tool_viewport_size.ts +3 -3
- package/inspector_overlay/tool_window_controls.ts +4 -4
- package/mcp/mcp.ts +1 -0
- package/package.json +2 -2
- package/front_end/generated/protocol-tsconfig.json +0 -10
- package/front_end/panels/js_timeline/DIR_METADATA +0 -3
- package/front_end/panels/js_timeline/js_timeline-meta.ts +0 -193
- package/front_end/panels/js_timeline/js_timeline.ts +0 -1
- /package/front_end/entrypoints/{formatter_worker/FormatterActions.ts → formatter_actions/formatter_actions.ts} +0 -0
|
@@ -5,6 +5,33 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { assert } from '../util/assert.js';
|
|
7
7
|
import { Deferred } from '../util/Deferred.js';
|
|
8
|
+
const MUTATION_OBSERVER_OPTIONS = {
|
|
9
|
+
childList: true,
|
|
10
|
+
subtree: true,
|
|
11
|
+
attributes: true,
|
|
12
|
+
};
|
|
13
|
+
function canHostShadowRoots(node) {
|
|
14
|
+
return (node.nodeType === Node.ELEMENT_NODE ||
|
|
15
|
+
node.nodeType === Node.DOCUMENT_FRAGMENT_NODE);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A shadow root has no parent, so the walk up continues through its host to
|
|
19
|
+
* stay inside the tree the node was added to.
|
|
20
|
+
*/
|
|
21
|
+
function parentOf(node) {
|
|
22
|
+
return node.parentNode ?? node.host ?? null;
|
|
23
|
+
}
|
|
24
|
+
function hasAncestorIn(node, nodes) {
|
|
25
|
+
let current = node;
|
|
26
|
+
let parent;
|
|
27
|
+
while ((parent = parentOf(current))) {
|
|
28
|
+
if (nodes.has(parent)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
current = parent;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
8
35
|
/**
|
|
9
36
|
* @internal
|
|
10
37
|
*/
|
|
@@ -12,6 +39,7 @@ export class MutationPoller {
|
|
|
12
39
|
#fn;
|
|
13
40
|
#root;
|
|
14
41
|
#observer;
|
|
42
|
+
#observedRoots = new WeakSet();
|
|
15
43
|
#deferred;
|
|
16
44
|
constructor(fn, root) {
|
|
17
45
|
this.#fn = fn;
|
|
@@ -24,7 +52,9 @@ export class MutationPoller {
|
|
|
24
52
|
deferred.resolve(result);
|
|
25
53
|
return;
|
|
26
54
|
}
|
|
27
|
-
this.#
|
|
55
|
+
this.#observedRoots = new WeakSet();
|
|
56
|
+
this.#observer = new MutationObserver(async (mutations) => {
|
|
57
|
+
this.#observeAddedShadowRoots(mutations);
|
|
28
58
|
const result = await this.#fn();
|
|
29
59
|
if (!result) {
|
|
30
60
|
return;
|
|
@@ -32,11 +62,52 @@ export class MutationPoller {
|
|
|
32
62
|
deferred.resolve(result);
|
|
33
63
|
await this.stop();
|
|
34
64
|
});
|
|
35
|
-
this.#
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
65
|
+
this.#observe(this.#root);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A `subtree` observation does not cross shadow boundaries, so every shadow
|
|
69
|
+
* root needs to be observed on its own.
|
|
70
|
+
*/
|
|
71
|
+
#observe(root) {
|
|
72
|
+
if (!this.#observer || this.#observedRoots.has(root)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.#observedRoots.add(root);
|
|
76
|
+
this.#observer.observe(root, MUTATION_OBSERVER_OPTIONS);
|
|
77
|
+
this.#observeShadowRoots(root);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A batch can report a subtree and nodes inside it, so the added nodes are
|
|
81
|
+
* pruned to the top-most ones and each tree is walked once.
|
|
82
|
+
*/
|
|
83
|
+
#observeAddedShadowRoots(mutations) {
|
|
84
|
+
const addedNodes = new Set();
|
|
85
|
+
for (const mutation of mutations) {
|
|
86
|
+
for (const node of mutation.addedNodes) {
|
|
87
|
+
if (!canHostShadowRoots(node)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
addedNodes.add(node);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const node of addedNodes) {
|
|
94
|
+
if (!hasAncestorIn(node, addedNodes)) {
|
|
95
|
+
this.#observeShadowRoots(node);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Attaching a shadow root does not emit a mutation, so shadow roots are
|
|
101
|
+
* instead picked up from the trees they arrive in.
|
|
102
|
+
*/
|
|
103
|
+
#observeShadowRoots(root) {
|
|
104
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
105
|
+
do {
|
|
106
|
+
const { shadowRoot } = walker.currentNode;
|
|
107
|
+
if (shadowRoot) {
|
|
108
|
+
this.#observe(shadowRoot);
|
|
109
|
+
}
|
|
110
|
+
} while (walker.nextNode());
|
|
40
111
|
}
|
|
41
112
|
async stop() {
|
|
42
113
|
assert(this.#deferred, 'Polling never started.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Poller.js","sourceRoot":"","sources":["../../../src/injected/Poller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAC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AAC;QAChC,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YAChC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO;YACT,CAAC;YACD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACzB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;YAC/B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export declare const PUPPETEER_REVISIONS: Readonly<{
|
|
10
|
-
chrome: "152.0.7977.
|
|
11
|
-
'chrome-headless-shell': "152.0.7977.
|
|
12
|
-
firefox: "
|
|
10
|
+
chrome: "152.0.7977.54";
|
|
11
|
+
'chrome-headless-shell': "152.0.7977.54";
|
|
12
|
+
firefox: "stable_154.0";
|
|
13
13
|
}>;
|
|
14
14
|
//# sourceMappingURL=revisions.d.ts.map
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
10
|
-
chrome: '152.0.7977.
|
|
11
|
-
'chrome-headless-shell': '152.0.7977.
|
|
12
|
-
firefox: '
|
|
10
|
+
chrome: '152.0.7977.54',
|
|
11
|
+
'chrome-headless-shell': '152.0.7977.54',
|
|
12
|
+
firefox: 'stable_154.0',
|
|
13
13
|
});
|
|
14
14
|
//# sourceMappingURL=revisions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revisions.js","sourceRoot":"","sources":["../../src/revisions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,eAAe;IACvB,uBAAuB,EAAE,eAAe;IACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"revisions.js","sourceRoot":"","sources":["../../src/revisions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,eAAe;IACvB,uBAAuB,EAAE,eAAe;IACxC,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC"}
|
|
@@ -8519,6 +8519,7 @@ declare namespace Puppeteer_2 {
|
|
|
8519
8519
|
NetworkConditions,
|
|
8520
8520
|
InternalNetworkConditions,
|
|
8521
8521
|
TracingOptions,
|
|
8522
|
+
WebMCPToolExecuteOptions,
|
|
8522
8523
|
WebMCPToolsAddedEvent,
|
|
8523
8524
|
WebMCPToolsRemovedEvent,
|
|
8524
8525
|
WebMCPToolCallResult,
|
|
@@ -9936,7 +9937,10 @@ export declare class WebMCPTool extends EventEmitter<{
|
|
|
9936
9937
|
/**
|
|
9937
9938
|
* Executes tool with input parameters, matching tool's `inputSchema`.
|
|
9938
9939
|
*/
|
|
9939
|
-
execute(
|
|
9940
|
+
execute(
|
|
9941
|
+
input?: object,
|
|
9942
|
+
options?: WebMCPToolExecuteOptions,
|
|
9943
|
+
): Promise<WebMCPToolCallResult>;
|
|
9940
9944
|
}
|
|
9941
9945
|
|
|
9942
9946
|
/**
|
|
@@ -9989,6 +9993,16 @@ export declare interface WebMCPToolCallResult {
|
|
|
9989
9993
|
exception?: Protocol.Runtime.RemoteObject;
|
|
9990
9994
|
}
|
|
9991
9995
|
|
|
9996
|
+
/**
|
|
9997
|
+
* @public
|
|
9998
|
+
*/
|
|
9999
|
+
export declare interface WebMCPToolExecuteOptions {
|
|
10000
|
+
/**
|
|
10001
|
+
* A signal object that allows you to cancel the tool execution.
|
|
10002
|
+
*/
|
|
10003
|
+
signal?: AbortSignal;
|
|
10004
|
+
}
|
|
10005
|
+
|
|
9992
10006
|
/**
|
|
9993
10007
|
* @public
|
|
9994
10008
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "puppeteer-core",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.9.0",
|
|
4
4
|
"description": "A high-level API to control headless Chrome over the DevTools Protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"puppeteer",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"devtools-protocol": "0.0.1666840",
|
|
154
154
|
"typed-query-selector": "^2.12.2",
|
|
155
155
|
"webdriver-bidi-protocol": "0.4.2",
|
|
156
|
-
"ws": "^8.21.
|
|
156
|
+
"ws": "^8.21.3"
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
159
|
"@types/chrome": "0.2.5",
|
|
@@ -295,8 +295,9 @@ export class CdpFrame extends Frame {
|
|
|
295
295
|
timeout = this._frameManager.timeoutSettings.navigationTimeout(),
|
|
296
296
|
} = options;
|
|
297
297
|
|
|
298
|
-
// We rely upon the fact that document
|
|
299
|
-
// lifecycle
|
|
298
|
+
// We rely upon the fact that the document is reopened, which resets the
|
|
299
|
+
// frame lifecycle with an "init" lifecycle event.
|
|
300
|
+
// @see https://crrev.com/608658
|
|
300
301
|
await this.setFrameContent(html);
|
|
301
302
|
|
|
302
303
|
const watcher = new LifecycleWatcher(
|
|
@@ -315,6 +316,19 @@ export class CdpFrame extends Frame {
|
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
318
|
|
|
319
|
+
/**
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
override async setFrameContent(content: string): Promise<void> {
|
|
323
|
+
// Writing the content from the page would go through document.write, which
|
|
324
|
+
// makes Chrome treat parser-blocking cross-site scripts in it as an
|
|
325
|
+
// intervention candidate and may block them outright.
|
|
326
|
+
await this.#client.send('Page.setDocumentContent', {
|
|
327
|
+
frameId: this._id,
|
|
328
|
+
html: content,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
|
|
318
332
|
override url(): string {
|
|
319
333
|
return this.#url;
|
|
320
334
|
}
|
|
@@ -105,20 +105,42 @@ export class WebMCPTool extends EventEmitter<{
|
|
|
105
105
|
/**
|
|
106
106
|
* Executes tool with input parameters, matching tool's `inputSchema`.
|
|
107
107
|
*/
|
|
108
|
-
async execute(
|
|
108
|
+
async execute(
|
|
109
|
+
input: object = {},
|
|
110
|
+
options: WebMCPToolExecuteOptions = {},
|
|
111
|
+
): Promise<WebMCPToolCallResult> {
|
|
109
112
|
const {invocationId} = await this.#webmcp.invokeTool(this, input);
|
|
110
113
|
return await new Promise<WebMCPToolCallResult>(resolve => {
|
|
114
|
+
const onAbort = () => {
|
|
115
|
+
void this.#webmcp.cancelInvocation(invocationId);
|
|
116
|
+
};
|
|
111
117
|
const handler = (event: WebMCPToolCallResult) => {
|
|
112
118
|
if (event.id === invocationId) {
|
|
119
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
113
120
|
this.#webmcp.off('toolresponded', handler);
|
|
114
121
|
resolve(event);
|
|
115
122
|
}
|
|
116
123
|
};
|
|
117
124
|
this.#webmcp.on('toolresponded', handler);
|
|
125
|
+
if (options.signal?.aborted) {
|
|
126
|
+
onAbort();
|
|
127
|
+
} else {
|
|
128
|
+
options.signal?.addEventListener('abort', onAbort, {once: true});
|
|
129
|
+
}
|
|
118
130
|
});
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
export interface WebMCPToolExecuteOptions {
|
|
138
|
+
/**
|
|
139
|
+
* A signal object that allows you to cancel the tool execution.
|
|
140
|
+
*/
|
|
141
|
+
signal?: AbortSignal;
|
|
142
|
+
}
|
|
143
|
+
|
|
122
144
|
/**
|
|
123
145
|
* @public
|
|
124
146
|
*/
|
|
@@ -366,6 +388,19 @@ export class WebMCP extends EventEmitter<{
|
|
|
366
388
|
});
|
|
367
389
|
}
|
|
368
390
|
|
|
391
|
+
/**
|
|
392
|
+
* @internal
|
|
393
|
+
*/
|
|
394
|
+
async cancelInvocation(invocationId: string): Promise<void> {
|
|
395
|
+
return await this.#client
|
|
396
|
+
.send('WebMCP.cancelInvocation', {
|
|
397
|
+
invocationId,
|
|
398
|
+
})
|
|
399
|
+
.catch(err => {
|
|
400
|
+
this.#logger?.(DEBUG_PREFIXES.error)?.(err);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
369
404
|
/**
|
|
370
405
|
* Gets all WebMCP tools defined by the page.
|
|
371
406
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export const source = "\"use strict\";var N=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)N(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of Y(e))!G.call(t,n)&&n!==r&&N(t,n,{get:()=>e[n],enumerable:!(o=B(e,n))||o.enumerable});return t};var z=t=>J(N({},\"__esModule\",{value:!0}),t);var ye={};l(ye,{default:()=>pe});module.exports=z(ye);var b=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends b{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(n=>n instanceof t?(n.#n&&r.add(n),n.valueOrThrow()):n);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error(\"Timeout cleared\"))}}#e=!1;#r=!1;#o;#t;#a=new Promise(e=>{this.#t=e});#n;#i;constructor(e){e&&e.timeout>0&&(this.#i=new p(e.message),this.#n=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#n),this.#o=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#o}#s;valueOrThrow(){return this.#s||(this.#s=(async()=>{if(await this.#a,this.#r)throw this.#o;return this.#o})()),this.#s}};var W=new Map,j=t=>{let e=W.get(t);return e||(e=new Function(`return ${t}`)(),W.set(t,e),e)};var v={};l(v,{ariaQuerySelector:()=>K,ariaQuerySelectorAll:()=>x});var K=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var E={};l(E,{cssQuerySelector:()=>Z,cssQuerySelectorAll:()=>ee});var Z=(t,e)=>t.querySelector(e),ee=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{CustomQuerySelectorRegistry:()=>y,customQuerySelectors:()=>P});var y=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(n,i)=>{for(let s of o(n,i))return s;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(n,i)=>{let s=o(n,i);return s?[s]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error(\"At least one query method must be defined.\");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new y;var R={};l(R,{pierceQuerySelector:()=>te,pierceQuerySelectorAll:()=>re});var te=(t,e)=>{let r=null,o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&!r&&s.matches(e)&&(r=s)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},re=(t,e)=>{let r=[],o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&s.matches(e)&&r.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var w=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new MutationObserver(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())}),this.#o.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(this.#o.disconnect(),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}},T=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let n=await this.#e();if(!n){window.requestAnimationFrame(o);return}e.resolve(n),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,\"Polling never started.\"),this.#r.finished()||this.#r.reject(new Error(\"Polling stopped\"))}result(){return u(this.#r,\"Polling never started.\"),this.#r.valueOrThrow()}},S=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(clearInterval(this.#o),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}};var L={};l(L,{PCombinator:()=>U,pQuerySelector:()=>me,pQuerySelectorAll:()=>X});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var O={};l(O,{textQuerySelectorAll:()=>m});var oe=new Set([\"checkbox\",\"image\",\"radio\"]),ne=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!oe.has(t.type),se=new Set([\"SCRIPT\",\"STYLE\"]),f=t=>!se.has(t.nodeName)&&!document.head?.contains(t),C=new WeakMap,V=t=>{for(;t;)C.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},F=new WeakSet,I,ie=()=>{let t=globalThis.MutationObserver;if(!t)throw new Error(\"MutationObserver is not available in this environment.\");return I||(I=new t(e=>{for(let r of e)V(r.target)})),I},d=t=>{let e=C.get(t);if(e||(e={full:\"\",immediate:[]},!f(t)))return e;let r=\"\";if(ne(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener(\"input\",o=>{V(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??\"\",r+=o.nodeValue??\"\";continue}r&&e.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),F.has(t)||(ie().observe(t,{childList:!0,characterData:!0,subtree:!0}),F.add(t))}return C.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let n;o.shadowRoot?n=m(o.shadowRoot,e):n=m(o,e);for(let i of n)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var M={};l(M,{checkVisibility:()=>ae,pierce:()=>g,pierceAll:()=>k});var le=[\"hidden\",\"collapse\"],ae=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(!r)return e===!1;let o=window.getComputedStyle(r),n=o&&!le.includes(o.visibility)&&!ce(r);return e===n?t:!1};function ce(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var ue=t=>\"shadowRoot\"in t&&t.shadowRoot instanceof ShadowRoot;function*g(t){ue(t)?yield t.shadowRoot:yield t}function*k(t){t=g(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var D={};l(D,{xpathQuerySelectorAll:()=>q});var q=function*(t,e,r=-1){let n=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=n.iterateNext())&&(i.push(s),!(r&&i.length===r)););for(let h=0;h<i.length;h++)s=i[h],yield s,i[h]=null};var de=/[-\\w\\P{ASCII}*]/u,U=(r=>(r.Descendent=\">>>\",r.Child=\">>>>\",r))(U||{}),H=t=>\"querySelectorAll\"in t,Q=class{#e;#r=[];#o=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#t()}async run(){for(typeof this.#o==\"string\"&&this.#o.trimStart()===\":scope\"&&this.#t();this.#o!==void 0;this.#t()){let e=this.#o;typeof e==\"string\"?e[0]&&de.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){H(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!H(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let n of r.parentElement.children)if(++o,n===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case\"text\":yield*m(r,e.value);break;case\"xpath\":yield*q(r,e.value);break;case\"aria\":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#t(){if(this.#r.length!==0){this.#o=this.#r.shift();return}if(this.#e.length===0){this.#o=void 0;return}let e=this.#e.shift();switch(e){case\">>>>\":{this.elements=a.flatMap(this.elements,g),this.#t();break}case\">>>\":{this.elements=a.flatMap(this.elements,k),this.#t();break}default:this.#r=e,this.#t();break}}},_=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let n=0;for(let s=e.previousSibling;s;s=s.previousSibling)++n;let i=this.calculate(e.parentNode,[n]);return this.#e.set(e,i),[...i,...r]}},$=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[n=-1,...i]=e;return r===n?$(o,i):r<n?-1:1},fe=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new _;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,n])=>$(o,n)).map(([o])=>o)},X=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let n=0;return o.some(i=>(typeof i==\"string\"?++n:n=0,n>1))}))throw new Error(\"Multiple deep combinators found in sequence.\");return fe(a.flatMap(r,o=>{let n=new Q(t,o);return n.run(),n.elements}))},me=async function(t,e){for await(let r of X(t,e))return r;return null};var he=Object.freeze({...v,...A,...R,...L,...O,...M,...D,...E,Deferred:c,createFunction:j,createTextContent:d,IntervalPoller:S,isSuitableNodeForTextMatching:f,MutationPoller:w,RAFPoller:T}),pe=he;\n";
|
|
8
|
+
export const source = "\"use strict\";var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of Y(e))!G.call(t,n)&&n!==r&&g(t,n,{get:()=>e[n],enumerable:!(o=X(e,n))||o.enumerable});return t};var z=t=>J(g({},\"__esModule\",{value:!0}),t);var Se={};l(Se,{default:()=>Te});module.exports=z(Se);var b=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends b{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(n=>n instanceof t?(n.#s&&r.add(n),n.valueOrThrow()):n);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error(\"Timeout cleared\"))}}#e=!1;#r=!1;#t;#o;#n=new Promise(e=>{this.#o=e});#s;#l;constructor(e){e&&e.timeout>0&&(this.#l=new p(e.message),this.#s=setTimeout(()=>{this.reject(this.#l)},e.timeout))}#i(e){clearTimeout(this.#s),this.#t=e,this.#o()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#i(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#i(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#t}#a;valueOrThrow(){return this.#a||(this.#a=(async()=>{if(await this.#n,this.#r)throw this.#t;return this.#t})()),this.#a}};var W=new Map,F=t=>{let e=W.get(t);return e||(e=new Function(`return ${t}`)(),W.set(t,e),e)};var E={};l(E,{ariaQuerySelector:()=>K,ariaQuerySelectorAll:()=>x});var K=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var v={};l(v,{cssQuerySelector:()=>Z,cssQuerySelectorAll:()=>ee});var Z=(t,e)=>t.querySelector(e),ee=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{CustomQuerySelectorRegistry:()=>y,customQuerySelectors:()=>P});var y=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(n,i)=>{for(let s of o(n,i))return s;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(n,i)=>{let s=o(n,i);return s?[s]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error(\"At least one query method must be defined.\");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new y;var R={};l(R,{pierceQuerySelector:()=>te,pierceQuerySelectorAll:()=>re});var te=(t,e)=>{let r=null,o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&!r&&s.matches(e)&&(r=s)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},re=(t,e)=>{let r=[],o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&s.matches(e)&&r.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var oe={childList:!0,subtree:!0,attributes:!0};function ne(t){return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function se(t){return t.parentNode??t.host??null}function ie(t,e){let r=t,o;for(;o=se(r);){if(e.has(o))return!0;r=o}return!1}var w=class{#e;#r;#t;#o=new WeakSet;#n;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#n=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new WeakSet,this.#t=new MutationObserver(async o=>{this.#l(o);let n=await this.#e();n&&(e.resolve(n),await this.stop())}),this.#s(this.#r)}#s(e){!this.#t||this.#o.has(e)||(this.#o.add(e),this.#t.observe(e,oe),this.#i(e))}#l(e){let r=new Set;for(let o of e)for(let n of o.addedNodes)ne(n)&&r.add(n);for(let o of r)ie(o,r)||this.#i(o)}#i(e){let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);do{let{shadowRoot:o}=r.currentNode;o&&this.#s(o)}while(r.nextNode())}async stop(){u(this.#n,\"Polling never started.\"),this.#n.finished()||this.#n.reject(new Error(\"Polling stopped\")),this.#t&&(this.#t.disconnect(),this.#t=void 0)}result(){return u(this.#n,\"Polling never started.\"),this.#n.valueOrThrow()}},N=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let n=await this.#e();if(!n){window.requestAnimationFrame(o);return}e.resolve(n),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,\"Polling never started.\"),this.#r.finished()||this.#r.reject(new Error(\"Polling stopped\"))}result(){return u(this.#r,\"Polling never started.\"),this.#r.valueOrThrow()}},T=class{#e;#r;#t;#o;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#o=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#t=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#o,\"Polling never started.\"),this.#o.finished()||this.#o.reject(new Error(\"Polling stopped\")),this.#t&&(clearInterval(this.#t),this.#t=void 0)}result(){return u(this.#o,\"Polling never started.\"),this.#o.valueOrThrow()}};var L={};l(L,{PCombinator:()=>V,pQuerySelector:()=>we,pQuerySelectorAll:()=>B});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var C={};l(C,{textQuerySelectorAll:()=>m});var le=new Set([\"checkbox\",\"image\",\"radio\"]),ae=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!le.has(t.type),ce=new Set([\"SCRIPT\",\"STYLE\"]),f=t=>!ce.has(t.nodeName)&&!document.head?.contains(t),O=new WeakMap,H=t=>{for(;t;)O.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},j=new WeakSet,I,ue=()=>{let t=globalThis.MutationObserver;if(!t)throw new Error(\"MutationObserver is not available in this environment.\");return I||(I=new t(e=>{for(let r of e)H(r.target)})),I},d=t=>{let e=O.get(t);if(e||(e={full:\"\",immediate:[]},!f(t)))return e;let r=\"\";if(ae(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener(\"input\",o=>{H(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??\"\",r+=o.nodeValue??\"\";continue}r&&e.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),j.has(t)||(ue().observe(t,{childList:!0,characterData:!0,subtree:!0}),j.add(t))}return O.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let n;o.shadowRoot?n=m(o.shadowRoot,e):n=m(o,e);for(let i of n)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var k={};l(k,{checkVisibility:()=>fe,pierce:()=>S,pierceAll:()=>M});var de=[\"hidden\",\"collapse\"],fe=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(!r)return e===!1;let o=window.getComputedStyle(r),n=o&&!de.includes(o.visibility)&&!me(r);return e===n?t:!1};function me(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var he=t=>\"shadowRoot\"in t&&t.shadowRoot instanceof ShadowRoot;function*S(t){he(t)?yield t.shadowRoot:yield t}function*M(t){t=S(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var _={};l(_,{xpathQuerySelectorAll:()=>D});var D=function*(t,e,r=-1){let n=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=n.iterateNext())&&(i.push(s),!(r&&i.length===r)););for(let h=0;h<i.length;h++)s=i[h],yield s,i[h]=null};var pe=/[-\\w\\P{ASCII}*]/u,V=(r=>(r.Descendent=\">>>\",r.Child=\">>>>\",r))(V||{}),U=t=>\"querySelectorAll\"in t,q=class{#e;#r=[];#t=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#o()}async run(){for(typeof this.#t==\"string\"&&this.#t.trimStart()===\":scope\"&&this.#o();this.#t!==void 0;this.#o()){let e=this.#t;typeof e==\"string\"?e[0]&&pe.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){U(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!U(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let n of r.parentElement.children)if(++o,n===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case\"text\":yield*m(r,e.value);break;case\"xpath\":yield*D(r,e.value);break;case\"aria\":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#o(){if(this.#r.length!==0){this.#t=this.#r.shift();return}if(this.#e.length===0){this.#t=void 0;return}let e=this.#e.shift();switch(e){case\">>>>\":{this.elements=a.flatMap(this.elements,S),this.#o();break}case\">>>\":{this.elements=a.flatMap(this.elements,M),this.#o();break}default:this.#r=e,this.#o();break}}},Q=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let n=0;for(let s=e.previousSibling;s;s=s.previousSibling)++n;let i=this.calculate(e.parentNode,[n]);return this.#e.set(e,i),[...i,...r]}},$=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[n=-1,...i]=e;return r===n?$(o,i):r<n?-1:1},ye=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new Q;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,n])=>$(o,n)).map(([o])=>o)},B=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let n=0;return o.some(i=>(typeof i==\"string\"?++n:n=0,n>1))}))throw new Error(\"Multiple deep combinators found in sequence.\");return ye(a.flatMap(r,o=>{let n=new q(t,o);return n.run(),n.elements}))},we=async function(t,e){for await(let r of B(t,e))return r;return null};var Ne=Object.freeze({...E,...A,...R,...L,...C,...k,..._,...v,Deferred:c,createFunction:F,createTextContent:d,IntervalPoller:T,isSuitableNodeForTextMatching:f,MutationPoller:w,RAFPoller:N}),Te=Ne;\n";
|
|
@@ -16,6 +16,39 @@ export interface Poller<T> {
|
|
|
16
16
|
result(): Promise<T>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
const MUTATION_OBSERVER_OPTIONS: MutationObserverInit = {
|
|
20
|
+
childList: true,
|
|
21
|
+
subtree: true,
|
|
22
|
+
attributes: true,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function canHostShadowRoots(node: Node): boolean {
|
|
26
|
+
return (
|
|
27
|
+
node.nodeType === Node.ELEMENT_NODE ||
|
|
28
|
+
node.nodeType === Node.DOCUMENT_FRAGMENT_NODE
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A shadow root has no parent, so the walk up continues through its host to
|
|
34
|
+
* stay inside the tree the node was added to.
|
|
35
|
+
*/
|
|
36
|
+
function parentOf(node: Node): Node | null {
|
|
37
|
+
return node.parentNode ?? (node as ShadowRoot).host ?? null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function hasAncestorIn(node: Node, nodes: Set<Node>): boolean {
|
|
41
|
+
let current = node;
|
|
42
|
+
let parent: Node | null;
|
|
43
|
+
while ((parent = parentOf(current))) {
|
|
44
|
+
if (nodes.has(parent)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
current = parent;
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
19
52
|
/**
|
|
20
53
|
* @internal
|
|
21
54
|
*/
|
|
@@ -25,6 +58,7 @@ export class MutationPoller<T> implements Poller<T> {
|
|
|
25
58
|
#root: Node;
|
|
26
59
|
|
|
27
60
|
#observer?: MutationObserver;
|
|
61
|
+
#observedRoots = new WeakSet<Node>();
|
|
28
62
|
#deferred?: Deferred<T>;
|
|
29
63
|
constructor(fn: () => Promise<T>, root: Node) {
|
|
30
64
|
this.#fn = fn;
|
|
@@ -39,7 +73,9 @@ export class MutationPoller<T> implements Poller<T> {
|
|
|
39
73
|
return;
|
|
40
74
|
}
|
|
41
75
|
|
|
42
|
-
this.#
|
|
76
|
+
this.#observedRoots = new WeakSet();
|
|
77
|
+
this.#observer = new MutationObserver(async mutations => {
|
|
78
|
+
this.#observeAddedShadowRoots(mutations);
|
|
43
79
|
const result = await this.#fn();
|
|
44
80
|
if (!result) {
|
|
45
81
|
return;
|
|
@@ -47,11 +83,55 @@ export class MutationPoller<T> implements Poller<T> {
|
|
|
47
83
|
deferred.resolve(result);
|
|
48
84
|
await this.stop();
|
|
49
85
|
});
|
|
50
|
-
this.#
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
86
|
+
this.#observe(this.#root);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A `subtree` observation does not cross shadow boundaries, so every shadow
|
|
91
|
+
* root needs to be observed on its own.
|
|
92
|
+
*/
|
|
93
|
+
#observe(root: Node): void {
|
|
94
|
+
if (!this.#observer || this.#observedRoots.has(root)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.#observedRoots.add(root);
|
|
98
|
+
this.#observer.observe(root, MUTATION_OBSERVER_OPTIONS);
|
|
99
|
+
this.#observeShadowRoots(root);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A batch can report a subtree and nodes inside it, so the added nodes are
|
|
104
|
+
* pruned to the top-most ones and each tree is walked once.
|
|
105
|
+
*/
|
|
106
|
+
#observeAddedShadowRoots(mutations: MutationRecord[]): void {
|
|
107
|
+
const addedNodes = new Set<Node>();
|
|
108
|
+
for (const mutation of mutations) {
|
|
109
|
+
for (const node of mutation.addedNodes) {
|
|
110
|
+
if (!canHostShadowRoots(node)) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
addedNodes.add(node);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
for (const node of addedNodes) {
|
|
117
|
+
if (!hasAncestorIn(node, addedNodes)) {
|
|
118
|
+
this.#observeShadowRoots(node);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Attaching a shadow root does not emit a mutation, so shadow roots are
|
|
125
|
+
* instead picked up from the trees they arrive in.
|
|
126
|
+
*/
|
|
127
|
+
#observeShadowRoots(root: Node): void {
|
|
128
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);
|
|
129
|
+
do {
|
|
130
|
+
const {shadowRoot} = walker.currentNode as Element;
|
|
131
|
+
if (shadowRoot) {
|
|
132
|
+
this.#observe(shadowRoot);
|
|
133
|
+
}
|
|
134
|
+
} while (walker.nextNode());
|
|
55
135
|
}
|
|
56
136
|
|
|
57
137
|
async stop(): Promise<void> {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '152.0.7977.
|
|
12
|
-
'chrome-headless-shell': '152.0.7977.
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '152.0.7977.54',
|
|
12
|
+
'chrome-headless-shell': '152.0.7977.54',
|
|
13
|
+
firefox: 'stable_154.0',
|
|
14
14
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Name: Web Vitals
|
|
2
2
|
Short Name: Web Vitals
|
|
3
3
|
URL: https://github.com/GoogleChrome/web-vitals
|
|
4
|
-
Version: 6.
|
|
4
|
+
Version: 6.2.1
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License File: package/LICENSE
|
|
7
|
-
Revision:
|
|
7
|
+
Revision: 582ee7450ca5c60a947edbfd95ad53e135ca5dde
|
|
8
8
|
Update Mechanism: Manual
|
|
9
9
|
Security Critical: no
|
|
10
10
|
Shipped: yes
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
- [Basic usage](#basic-usage)
|
|
9
9
|
- [Report the value on every change](#report-the-value-on-every-change)
|
|
10
10
|
- [Report only the delta of changes](#report-only-the-delta-of-changes)
|
|
11
|
+
- [Report metrics for soft navigations](#report-metrics-for-soft-navigations)
|
|
11
12
|
- [Send the results to an analytics endpoint](#send-the-results-to-an-analytics-endpoint)
|
|
12
13
|
- [Send the results to Google Analytics](#send-the-results-to-google-analytics)
|
|
13
14
|
- [Send the results to Google Tag Manager](#send-the-results-to-google-tag-manager)
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
|
|
29
30
|
## Overview
|
|
30
31
|
|
|
31
|
-
The `web-vitals` library is a tiny (~3K, brotli'd), modular library for measuring all the [Web Vitals](https://web.dev/articles/vitals) metrics on real users, in a way that accurately matches how they're measured by Chrome and reported to other Google tools (e.g. [Chrome User Experience Report](https://
|
|
32
|
+
The `web-vitals` library is a tiny (~3K, brotli'd), modular library for measuring all the [Web Vitals](https://web.dev/articles/vitals) metrics on real users, in a way that accurately matches how they're measured by Chrome and reported to other Google tools (e.g. [Chrome User Experience Report](https://developer.chrome.com/docs/crux/), [Page Speed Insights](https://pagespeed.web.dev/), [Search Console's Speed Report](https://support.google.com/webmasters/answer/9205520?hl=en)).
|
|
32
33
|
|
|
33
34
|
The library supports all of the [Core Web Vitals](https://web.dev/articles/vitals#core_web_vitals) as well as a number of other metrics that are useful in diagnosing [real-user](https://web.dev/articles/user-centric-performance-metrics) performance issues.
|
|
34
35
|
|
|
@@ -479,7 +480,7 @@ addEventListener('visibilitychange', () => {
|
|
|
479
480
|
```
|
|
480
481
|
|
|
481
482
|
> [!NOTE]
|
|
482
|
-
> See [the Page Lifecycle guide](https://
|
|
483
|
+
> See [the Page Lifecycle guide](https://developer.chrome.com/docs/web-platform/page-lifecycle-api#legacy_lifecycle_apis_to_avoid) for an explanation of why `visibilitychange` is recommended over events like `beforeunload` and `unload`.
|
|
483
484
|
|
|
484
485
|
<a name="bundle-versions"></a>
|
|
485
486
|
|
|
@@ -551,7 +552,7 @@ Most developers will generally want to use "standard" build (via either the ES m
|
|
|
551
552
|
|
|
552
553
|
However, if you'd like to collect additional debug information to help you diagnose performance bottlenecks based on real-user issues, use the ["attribution" build](#attribution-build).
|
|
553
554
|
|
|
554
|
-
For guidance on how to collect and use real-user data to debug performance issues, see [Debug performance in the field](https://web.dev/debug-performance-in-the-field
|
|
555
|
+
For guidance on how to collect and use real-user data to debug performance issues, see [Debug performance in the field](https://web.dev/articles/debug-performance-in-the-field).
|
|
555
556
|
|
|
556
557
|
## API
|
|
557
558
|
|
|
@@ -723,6 +724,7 @@ _See also [Rating Thresholds](#rating-thresholds)._
|
|
|
723
724
|
```ts
|
|
724
725
|
interface ReportOpts {
|
|
725
726
|
reportAllChanges?: boolean;
|
|
727
|
+
reportSoftNavs?: boolean;
|
|
726
728
|
}
|
|
727
729
|
```
|
|
728
730
|
|
|
@@ -754,7 +756,14 @@ Metric-specific subclasses:
|
|
|
754
756
|
interface INPAttributionReportOpts extends AttributionReportOpts {
|
|
755
757
|
durationThreshold?: number;
|
|
756
758
|
includeProcessedEventEntries?: boolean;
|
|
757
|
-
|
|
759
|
+
}
|
|
760
|
+
```
|
|
761
|
+
|
|
762
|
+
##### `LCPAttributionReportOpts`
|
|
763
|
+
|
|
764
|
+
```ts
|
|
765
|
+
interface LCPAttributionReportOpts extends AttributionReportOpts {
|
|
766
|
+
resourceBufferSize?: number;
|
|
758
767
|
}
|
|
759
768
|
```
|
|
760
769
|
|
|
@@ -859,9 +868,6 @@ onTTFB((metric) => {
|
|
|
859
868
|
});
|
|
860
869
|
```
|
|
861
870
|
|
|
862
|
-
> [!NOTE]
|
|
863
|
-
> Browsers that do not support `navigation` entries will fall back to using `performance.timing` (with the timestamps converted from epoch time to [`DOMHighResTimeStamp`](https://developer.mozilla.org/docs/Web/API/DOMHighResTimeStamp)). This ensures code referencing these values (like in the example above) will work the same in all browsers.
|
|
864
|
-
|
|
865
871
|
### Rating Thresholds:
|
|
866
872
|
|
|
867
873
|
The thresholds of each metric's "good", "needs improvement", and "poor" ratings are available as [`MetricRatingThresholds`](#metricratingthresholds).
|
|
@@ -916,6 +922,15 @@ interface INPAttributionReportOpts extends AttributionReportOpts {
|
|
|
916
922
|
}
|
|
917
923
|
```
|
|
918
924
|
|
|
925
|
+
3. The `onLCP` `AttributionReportOpts` supports an additional, optional, `resourceBufferSize` configuration option defaulting to `50`. This is the maximum number of additional Resource Timing entries to buffer, in addition to the first 250 entries available in the default buffer. This is useful to help attribute media LCPs to a URL and LCP subparts. This can be increased for pages that use a lot of resources, before LCP gets a chance to emit, particularly for soft navigations, at the cost of using more memory to buffer these.
|
|
926
|
+
|
|
927
|
+
```ts
|
|
928
|
+
interface INPAttributionReportOpts extends AttributionReportOpts {
|
|
929
|
+
durationThreshold?: number;
|
|
930
|
+
includeProcessedEventEntries?: boolean;
|
|
931
|
+
}
|
|
932
|
+
```
|
|
933
|
+
|
|
919
934
|
The next sections document the shape of the `attribution` object for each of the metrics:
|
|
920
935
|
|
|
921
936
|
#### `CLSAttribution`
|
|
@@ -157,7 +157,7 @@ export const onINP = (onReport, opts = {}) => {
|
|
|
157
157
|
pendingEntriesGroups.push(group);
|
|
158
158
|
}
|
|
159
159
|
// Store the grouped render time for this entry for reference later.
|
|
160
|
-
if (entry.interactionId
|
|
160
|
+
if (entry.interactionId) {
|
|
161
161
|
entryToEntriesGroupMap.set(entry, group);
|
|
162
162
|
}
|
|
163
163
|
queueCleanup();
|
|
@@ -355,7 +355,11 @@ export const onINP = (onReport, opts = {}) => {
|
|
|
355
355
|
}
|
|
356
356
|
const firstEntry = metric.entries[0];
|
|
357
357
|
const group = entryToEntriesGroupMap.get(firstEntry);
|
|
358
|
-
|
|
358
|
+
// `group.processingStart` is the earliest processing start across *all*
|
|
359
|
+
// events presented in this frame, which can predate this interaction's
|
|
360
|
+
// `startTime` (e.g. a long `pointerover` handler that was still running
|
|
361
|
+
// when the user clicked). Clamp so `inputDelay` is never negative.
|
|
362
|
+
const processingStart = Math.max(group.processingStart, firstEntry.startTime);
|
|
359
363
|
// Due to the fact that durations can be rounded down to the nearest 8ms,
|
|
360
364
|
// we have to clamp `nextPaintTime` so it doesn't appear to occur before
|
|
361
365
|
// processing starts. Note: we can't use `processingEnd` since processing
|