chrome-devtools-frontend 1.0.1616061 → 1.0.1621064
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/AUTHORS +1 -0
- package/docs/checklist/README.md +8 -7
- package/eslint.config.mjs +7 -0
- package/front_end/core/common/Object.ts +11 -2
- package/front_end/core/dom_extension/DOMExtension.ts +11 -8
- package/front_end/core/host/AidaClient.ts +8 -0
- package/front_end/core/host/AidaGcaTranslation.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/platform/api/HostRuntime.ts +2 -2
- package/front_end/core/platform/browser/HostRuntime.ts +4 -2
- package/front_end/core/platform/node/HostRuntime.ts +2 -2
- package/front_end/core/root/ExperimentNames.ts +0 -1
- package/front_end/core/sdk/NetworkManager.ts +30 -4
- package/front_end/core/sdk/NetworkRequest.ts +2 -10
- package/front_end/core/sdk/Resource.ts +2 -1
- package/front_end/core/sdk/ServerSentEventsProtocol.ts +1 -1
- package/front_end/core/sdk/TraceObject.ts +7 -2
- package/front_end/entrypoint_template.html +1 -2
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +119 -15
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +43 -33
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +2 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +9 -6
- package/front_end/entrypoints/main/MainImpl.ts +0 -2
- package/front_end/generated/InspectorBackendCommands.ts +8 -7
- package/front_end/generated/SupportedCSSProperties.js +119 -100
- package/front_end/generated/protocol-mapping.d.ts +1 -9
- package/front_end/generated/protocol-proxy-api.d.ts +1 -9
- package/front_end/generated/protocol.ts +24 -1
- package/front_end/legacy/legacy-defs.d.ts +1 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +39 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -0
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +28 -16
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +512 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +112 -145
- package/front_end/models/ai_assistance/agents/README.md +0 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +9 -16
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +19 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +48 -13
- package/front_end/models/bindings/SymbolizedError.ts +95 -8
- package/front_end/models/emulation/DeviceModeModel.ts +42 -13
- package/front_end/models/emulation/EmulatedDevices.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +13 -6
- package/front_end/models/issues_manager/IssuesManagerEvents.ts +1 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +1 -0
- package/front_end/models/stack_trace/DetailedErrorStackParser.ts +49 -10
- package/front_end/models/stack_trace/ErrorStackParser.ts +18 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +5 -1
- package/front_end/models/text_utils/ContentData.ts +71 -10
- package/front_end/models/trace/types/File.ts +8 -1
- package/front_end/models/web_mcp/WebMCPModel.ts +22 -0
- package/front_end/models/workspace/UISourceCode.ts +4 -4
- package/front_end/panels/accessibility/ARIAAttributesView.ts +4 -4
- package/front_end/panels/accessibility/AccessibilitySubPane.ts +3 -2
- package/front_end/panels/accessibility/SourceOrderView.ts +4 -4
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatInput.ts +66 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +144 -21
- package/front_end/panels/ai_assistance/components/ChatView.ts +43 -8
- package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +1 -0
- package/front_end/panels/ai_assistance/components/WalkthroughUtils.ts +74 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +34 -5
- package/front_end/panels/ai_assistance/components/chatMessage.css +11 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +7 -0
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +8 -9
- package/front_end/panels/application/DOMStorageItemsView.ts +3 -3
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +7 -0
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +21 -0
- package/front_end/panels/application/DeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/application/ExtensionStorageItemsView.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +32 -14
- package/front_end/panels/application/ResourcesPanel.ts +5 -5
- package/front_end/panels/application/StorageItemsToolbar.ts +0 -19
- package/front_end/panels/application/WebMCPView.ts +285 -86
- package/front_end/panels/application/components/BounceTrackingMitigationsView.ts +4 -4
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +4 -4
- package/front_end/panels/application/webMCPView.css +261 -182
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +9 -5
- package/front_end/panels/changes/ChangesSidebar.ts +2 -2
- package/front_end/panels/changes/ChangesView.ts +9 -14
- package/front_end/panels/console/ConsolePanel.ts +10 -3
- package/front_end/panels/console/ConsoleSidebar.ts +5 -5
- package/front_end/panels/console/ConsoleView.ts +11 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -19
- package/front_end/panels/coverage/CoverageView.ts +4 -5
- package/front_end/panels/elements/ElementsPanel.ts +9 -12
- package/front_end/panels/elements/ElementsSidebarPane.ts +4 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +61 -0
- package/front_end/panels/elements/ElementsTreeOutline.ts +46 -0
- package/front_end/panels/elements/LayersWidget.ts +2 -2
- package/front_end/panels/elements/MetricsSidebarPane.ts +5 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +11 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -1
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +19 -20
- package/front_end/panels/elements/components/ElementsBreadcrumbsUtils.ts +29 -29
- package/front_end/panels/elements/components/QueryContainer.ts +5 -6
- package/front_end/panels/elements/components/components.ts +0 -2
- package/front_end/panels/emulation/MediaQueryInspector.ts +4 -7
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -7
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +2 -2
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +47 -66
- package/front_end/panels/network/NetworkConfigView.ts +11 -11
- package/front_end/panels/network/RequestConditionsDrawer.ts +6 -4
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestDeviceBoundSessionsView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +4 -5
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +6 -9
- package/front_end/panels/profiler/HeapProfileView.ts +29 -4
- package/front_end/panels/profiler/ProfilesPanel.ts +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.css +8 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +7 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +6 -4
- package/front_end/panels/recorder/components/ControlButton.ts +4 -4
- package/front_end/panels/recorder/components/StepView.ts +6 -6
- package/front_end/panels/search/SearchView.ts +4 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +18 -22
- package/front_end/panels/sources/SourcesView.ts +1 -1
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -2
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +24 -20
- package/front_end/panels/timeline/StatusDialog.ts +5 -8
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +10 -0
- package/front_end/panels/timeline/TimelineLoader.ts +3 -4
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +2 -2
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +2 -0
- package/front_end/panels/timeline/components/TimelineSummary.ts +9 -1
- package/front_end/panels/timeline/components/timelineSummary.css +4 -0
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +2 -2
- package/front_end/panels/timeline/thirdPartyTreeView.css +8 -1
- package/front_end/panels/web_audio/WebAudioView.ts +5 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
- package/front_end/panels/whats_new/resources/WNDT.md +9 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +41 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js +21 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +52 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/urlpattern-polyfill/urlpattern-polyfill.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/third_party/urlpattern-polyfill/urlpattern-polyfill.js +853 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +91 -11
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +1046 -33
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +41 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts +13 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js +21 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +52 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/urlpattern-polyfill/urlpattern-polyfill.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/third_party/urlpattern-polyfill/urlpattern-polyfill.js +805 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +91 -11
- package/front_end/third_party/puppeteer/package/package.json +3 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +53 -11
- package/front_end/third_party/puppeteer/package/src/api/Extension.ts +29 -1
- package/front_end/third_party/puppeteer/package/src/bidi/ElementHandle.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +9 -2
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +59 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +6 -1
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +26 -0
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +2 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +21 -10
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +2 -4
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +44 -39
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +25 -19
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +1 -2
- 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/getActivationStart.js +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +16 -18
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +2 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenActivated.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +11 -7
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +1 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
- package/front_end/third_party/web-vitals/package/package.json +24 -27
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +2 -7
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +49 -43
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +27 -24
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/lib/doubleRAF.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -2
- package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +21 -20
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +2 -3
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +2 -4
- package/front_end/third_party/web-vitals/package/src/lib/whenActivated.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +13 -7
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +4 -0
- package/front_end/third_party/web-vitals/package/src/types.ts +1 -2
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +13 -74
- package/front_end/third_party/web-vitals/rebuild.sh +3 -3
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +0 -1
- package/front_end/ui/components/icon_button/iconButton.css +1 -0
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +6 -6
- package/front_end/ui/components/lists/list.css +4 -0
- package/front_end/ui/legacy/Dialog.ts +21 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +3 -3
- package/front_end/ui/legacy/SplitWidget.ts +9 -9
- package/front_end/ui/legacy/TabbedPane.ts +12 -12
- package/front_end/ui/legacy/View.ts +24 -22
- package/front_end/ui/legacy/ViewManager.ts +12 -12
- package/front_end/ui/legacy/ViewRegistration.ts +2 -2
- package/front_end/ui/legacy/Widget.ts +165 -119
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +10 -5
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +9 -6
- package/front_end/ui/legacy/components/utils/Linkifier.ts +37 -11
- package/front_end/ui/legacy/components/utils/jsUtils.css +1 -0
- package/front_end/ui/legacy/inspectorCommon.css +0 -6
- package/front_end/ui/lit/render.ts +11 -9
- package/front_end/ui/visual_logging/KnownContextValues.ts +36 -0
- package/package.json +1 -1
- package/front_end/Images/src/dots-circle.svg +0 -10
- package/front_end/panels/elements/components/Helper.ts +0 -35
- package/front_end/third_party/web-vitals/package/dist/modules/types/polyfills.d.ts +0 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types/polyfills.js +0 -16
- package/front_end/third_party/web-vitals/package/src/types/polyfills.ts +0 -24
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-vitals",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Easily measure performance metrics in JavaScript",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
5
8
|
"type": "module",
|
|
6
9
|
"typings": "dist/modules/index.d.ts",
|
|
7
10
|
"main": "dist/web-vitals.umd.cjs",
|
|
@@ -88,7 +91,7 @@
|
|
|
88
91
|
"release:beta": "npm version prerelease --preid=beta -m 'Release v%s' && npm publish --tag next",
|
|
89
92
|
"release:rc": "npm version prerelease --preid=rc -m 'Release v%s' && npm publish --tag next",
|
|
90
93
|
"test": "npm-run-all build test:unit -p -r test:e2e test:server",
|
|
91
|
-
"test:e2e": "wdio
|
|
94
|
+
"test:e2e": "wdio",
|
|
92
95
|
"test:server": "node test/server.js",
|
|
93
96
|
"test:unit": "node --test test/unit/*test.js",
|
|
94
97
|
"start": "run-s build:ts test:server watch",
|
|
@@ -96,7 +99,7 @@
|
|
|
96
99
|
"watch:ts": "tsc -b -w",
|
|
97
100
|
"watch:js": "rollup -c -w",
|
|
98
101
|
"version": "run-s build",
|
|
99
|
-
"prepare": "husky
|
|
102
|
+
"prepare": "husky"
|
|
100
103
|
},
|
|
101
104
|
"keywords": [
|
|
102
105
|
"crux",
|
|
@@ -134,35 +137,29 @@
|
|
|
134
137
|
"singleQuote": true
|
|
135
138
|
},
|
|
136
139
|
"devDependencies": {
|
|
137
|
-
"@babel/core": "^7.
|
|
138
|
-
"@babel/preset-env": "^7.
|
|
139
|
-
"@rollup/plugin-babel": "^6.0
|
|
140
|
-
"@rollup/plugin-replace": "^5.0.5",
|
|
140
|
+
"@babel/core": "^7.28.5",
|
|
141
|
+
"@babel/preset-env": "^7.28.5",
|
|
142
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
141
143
|
"@rollup/plugin-terser": "^0.4.4",
|
|
142
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
143
|
-
"@typescript-eslint/parser": "^
|
|
144
|
-
"@wdio/cli": "^
|
|
145
|
-
"@wdio/local-runner": "^
|
|
146
|
-
"@wdio/mocha-framework": "^
|
|
147
|
-
"@wdio/spec-reporter": "^
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"fs-extra": "^11.2.0",
|
|
153
|
-
"husky": "^8.0.3",
|
|
154
|
-
"lint-staged": "^15.2.0",
|
|
144
|
+
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
145
|
+
"@typescript-eslint/parser": "^8.52.0",
|
|
146
|
+
"@wdio/cli": "^9.23.0",
|
|
147
|
+
"@wdio/local-runner": "^9.25.0",
|
|
148
|
+
"@wdio/mocha-framework": "^9.25.0",
|
|
149
|
+
"@wdio/spec-reporter": "^9.25.0",
|
|
150
|
+
"eslint": "^9.39.2",
|
|
151
|
+
"fs-extra": "^11.3.3",
|
|
152
|
+
"husky": "^9.1.7",
|
|
153
|
+
"lint-staged": "^16.2.7",
|
|
155
154
|
"npm-run-all": "^4.1.5",
|
|
156
155
|
"nunjucks": "^3.2.4",
|
|
157
|
-
"prettier": "^3.
|
|
158
|
-
"rollup": "^4.
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"wdio-chromedriver-service": "^8.1.1",
|
|
162
|
-
"yargs": "^17.7.2"
|
|
156
|
+
"prettier": "^3.7.4",
|
|
157
|
+
"rollup": "^4.55.1",
|
|
158
|
+
"typescript": "^5.9.3",
|
|
159
|
+
"yargs": "^18.0.0"
|
|
163
160
|
},
|
|
164
161
|
"lint-staged": {
|
|
165
|
-
"**/*.{js,ts}": "eslint --fix
|
|
162
|
+
"**/*.{js,ts}": "eslint --fix",
|
|
166
163
|
"**/*.{cjs,css,html,js,json,html,md,ts,yml,yaml}": "prettier --write --ignore-path .gitignore"
|
|
167
164
|
}
|
|
168
165
|
}
|
|
@@ -104,15 +104,10 @@ export const onCLS = (
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// Use `Object.assign()` to ensure the original metric object is returned.
|
|
107
|
-
|
|
108
|
-
metric,
|
|
109
|
-
{attribution},
|
|
110
|
-
);
|
|
111
|
-
return metricWithAttribution;
|
|
107
|
+
return Object.assign(metric, {attribution});
|
|
112
108
|
};
|
|
113
109
|
|
|
114
110
|
unattributedOnCLS((metric: CLSMetric) => {
|
|
115
|
-
|
|
116
|
-
onReport(metricWithAttribution);
|
|
111
|
+
onReport(attributeCLS(metric));
|
|
117
112
|
}, opts);
|
|
118
113
|
};
|
|
@@ -43,8 +43,8 @@ interface pendingEntriesGroup {
|
|
|
43
43
|
// frame data is needed to determine various bits of INP attribution once all
|
|
44
44
|
// the frame-related data has come in.
|
|
45
45
|
// In most cases this out-of-order data is only off by a frame or two, so
|
|
46
|
-
// keeping the most recent
|
|
47
|
-
const
|
|
46
|
+
// keeping the most recent 10 should be more than sufficient.
|
|
47
|
+
const MAX_PENDING_FRAMES = 10;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Calculates the [INP](https://web.dev/articles/inp) value for the current
|
|
@@ -61,6 +61,10 @@ const MAX_PREVIOUS_FRAMES = 50;
|
|
|
61
61
|
* less than 40 (well below the recommended
|
|
62
62
|
* [good](https://web.dev/articles/inp#what_is_a_good_inp_score) threshold).
|
|
63
63
|
*
|
|
64
|
+
* A custom `includeProcessedEventEntries` configuration option can optionally
|
|
65
|
+
* be passed to control whether the `processedEventEntries` array in the
|
|
66
|
+
* attribution object is populated. The default value is `true`.
|
|
67
|
+
*
|
|
64
68
|
* If the `reportAllChanges` configuration option is set to `true`, the
|
|
65
69
|
* `callback` function will be called as soon as the value is initially
|
|
66
70
|
* determined as well as any time the value changes throughout the page
|
|
@@ -146,6 +150,8 @@ export const onINP = (
|
|
|
146
150
|
const renderTime = entry.startTime + entry.duration;
|
|
147
151
|
let group;
|
|
148
152
|
|
|
153
|
+
// Update `latestProcessingEnd` to correspond to the `processingEnd`
|
|
154
|
+
// value of the most recently dispatched `event` entry.
|
|
149
155
|
latestProcessingEnd = Math.max(latestProcessingEnd, entry.processingEnd);
|
|
150
156
|
|
|
151
157
|
// Iterate over all previous render times in reverse order to find a match.
|
|
@@ -166,11 +172,11 @@ export const onINP = (
|
|
|
166
172
|
entry.processingEnd,
|
|
167
173
|
group.processingEnd,
|
|
168
174
|
);
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
// processedEventEntries can be quite large, so only include them if
|
|
176
|
+
// the user explicitly requests them (default is to include).
|
|
177
|
+
if (opts.includeProcessedEventEntries !== false) {
|
|
178
|
+
group.entries.push(entry);
|
|
179
|
+
}
|
|
174
180
|
|
|
175
181
|
break;
|
|
176
182
|
}
|
|
@@ -183,12 +189,9 @@ export const onINP = (
|
|
|
183
189
|
processingStart: entry.processingStart,
|
|
184
190
|
processingEnd: entry.processingEnd,
|
|
185
191
|
renderTime,
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
|
|
189
|
-
// See https://crbug.com/484342204
|
|
190
|
-
// entries: [entry],
|
|
191
|
-
entries: [],
|
|
192
|
+
// processedEventEntries can be quite large, so only include them if
|
|
193
|
+
// the user explicitly requests them (default is to include).
|
|
194
|
+
entries: opts.includeProcessedEventEntries !== false ? [entry] : [],
|
|
192
195
|
};
|
|
193
196
|
|
|
194
197
|
pendingEntriesGroups.push(group);
|
|
@@ -211,39 +214,47 @@ export const onINP = (
|
|
|
211
214
|
};
|
|
212
215
|
|
|
213
216
|
const cleanupEntries = () => {
|
|
214
|
-
//
|
|
215
|
-
//
|
|
216
|
-
const longestInteractionGroups =
|
|
217
|
+
// Create a set of entries groups that are part of the longest
|
|
218
|
+
// interactions (for faster lookup below).
|
|
219
|
+
const longestInteractionGroups = new Set(
|
|
217
220
|
interactionManager._longestInteractionList.map((i) => {
|
|
218
221
|
return entryToEntriesGroupMap.get(i.entries[0]);
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
}),
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
// Clean up the `pendingEntriesGroups` list so it doesn't grow endlessly.
|
|
226
|
+
// Keep any groups that:
|
|
227
|
+
// 1) Correspond to one of the current longest interactions, OR
|
|
228
|
+
// 2) Are part of one of the most recent set of frames (which is
|
|
229
|
+
// determined by checking if the index in the group is within
|
|
230
|
+
// `MAX_PENDING_FRAMES` of the group's length).
|
|
231
|
+
const minIndexToKeep = pendingEntriesGroups.length - MAX_PENDING_FRAMES;
|
|
232
|
+
pendingEntriesGroups = pendingEntriesGroups.filter((group, i) => {
|
|
233
|
+
// Check index first because it's faster.
|
|
234
|
+
return i >= minIndexToKeep || longestInteractionGroups.has(group);
|
|
224
235
|
});
|
|
225
236
|
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
237
|
+
// Create a set of LoAF entries that intersect with entries in the newly
|
|
238
|
+
// cleaned up `pendingEntriesGroups` (for faster lookup below).
|
|
239
|
+
const intersectingLoAFs: Set<PerformanceLongAnimationFrameTiming> =
|
|
240
|
+
new Set();
|
|
241
|
+
|
|
230
242
|
for (const group of pendingEntriesGroups) {
|
|
231
243
|
const loafs = getIntersectingLoAFs(group.startTime, group.processingEnd);
|
|
232
244
|
for (const loaf of loafs) {
|
|
233
|
-
|
|
245
|
+
intersectingLoAFs.add(loaf);
|
|
234
246
|
}
|
|
235
247
|
}
|
|
236
|
-
const prevFrameIndexCutoff = pendingLoAFs.length - 1 - MAX_PREVIOUS_FRAMES;
|
|
237
|
-
// Filter `pendingLoAFs` to preserve LoAF order.
|
|
238
|
-
pendingLoAFs = pendingLoAFs.filter((loaf, index) => {
|
|
239
|
-
if (
|
|
240
|
-
loaf.startTime > latestProcessingEnd &&
|
|
241
|
-
index > prevFrameIndexCutoff
|
|
242
|
-
) {
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
248
|
|
|
246
|
-
|
|
249
|
+
// Clean up the `pendingLoAFs` list so it doesn't grow endlessly.
|
|
250
|
+
// Keep all LoAFs that either:
|
|
251
|
+
// 1) Intersect with one of the above pending entries groups, OR
|
|
252
|
+
// 2) Occurred more recently than the most recently process event entry.
|
|
253
|
+
pendingLoAFs = pendingLoAFs.filter((loaf) => {
|
|
254
|
+
return (
|
|
255
|
+
// Compare times first because it's faster.
|
|
256
|
+
loaf.startTime > latestProcessingEnd || intersectingLoAFs.has(loaf)
|
|
257
|
+
);
|
|
247
258
|
});
|
|
248
259
|
|
|
249
260
|
cleanupPending = false;
|
|
@@ -454,18 +465,13 @@ export const onINP = (
|
|
|
454
465
|
attributeLoAFDetails(attribution);
|
|
455
466
|
|
|
456
467
|
// Use `Object.assign()` to ensure the original metric object is returned.
|
|
457
|
-
|
|
458
|
-
metric,
|
|
459
|
-
{attribution},
|
|
460
|
-
);
|
|
461
|
-
return metricWithAttribution;
|
|
468
|
+
return Object.assign(metric, {attribution});
|
|
462
469
|
};
|
|
463
470
|
|
|
464
471
|
// Start observing LoAF entries for attribution.
|
|
465
472
|
observe('long-animation-frame', handleLoAFEntries);
|
|
466
473
|
|
|
467
474
|
unattributedOnINP((metric: INPMetric) => {
|
|
468
|
-
|
|
469
|
-
onReport(metricWithAttribution);
|
|
475
|
+
onReport(attributeINP(metric));
|
|
470
476
|
}, opts);
|
|
471
477
|
};
|
|
@@ -57,6 +57,10 @@ export const onLCP = (
|
|
|
57
57
|
if (node) {
|
|
58
58
|
const customTarget = opts.generateTarget?.(node) ?? getSelector(node);
|
|
59
59
|
lcpTargetMap.set(entry, customTarget);
|
|
60
|
+
} else if (entry.id) {
|
|
61
|
+
// Use the LargestContentfulPaint.id property when the element has been
|
|
62
|
+
// removed from the DOM (and so node is null), but still has an ID.
|
|
63
|
+
lcpTargetMap.set(entry, `#${entry.id}`);
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
|
|
@@ -70,16 +74,29 @@ export const onLCP = (
|
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
if (metric.entries.length) {
|
|
77
|
+
// The `metric.entries.length` check ensures there will be an entry.
|
|
78
|
+
const lcpEntry = metric.entries.at(-1)!;
|
|
79
|
+
const lcpResourceEntry =
|
|
80
|
+
lcpEntry.url &&
|
|
81
|
+
performance
|
|
82
|
+
.getEntriesByType('resource')
|
|
83
|
+
.find((e) => e.name === lcpEntry.url);
|
|
84
|
+
|
|
85
|
+
attribution.target = lcpTargetMap.get(lcpEntry);
|
|
86
|
+
attribution.lcpEntry = lcpEntry;
|
|
87
|
+
// Only attribute the URL and resource entry if they exist.
|
|
88
|
+
if (lcpEntry.url) {
|
|
89
|
+
attribution.url = lcpEntry.url;
|
|
90
|
+
}
|
|
91
|
+
if (lcpResourceEntry) {
|
|
92
|
+
attribution.lcpResourceEntry = lcpResourceEntry;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Get subparts from navigation entry. Do this last as occasionally
|
|
96
|
+
// Safari seems to fail to find a navigation entry.
|
|
73
97
|
const navigationEntry = getNavigationEntry();
|
|
74
98
|
if (navigationEntry) {
|
|
75
99
|
const activationStart = navigationEntry.activationStart || 0;
|
|
76
|
-
// The `metric.entries.length` check ensures there will be an entry.
|
|
77
|
-
const lcpEntry = metric.entries.at(-1)!;
|
|
78
|
-
const lcpResourceEntry =
|
|
79
|
-
lcpEntry.url &&
|
|
80
|
-
performance
|
|
81
|
-
.getEntriesByType('resource')
|
|
82
|
-
.filter((e) => e.name === lcpEntry.url)[0];
|
|
83
100
|
|
|
84
101
|
const ttfb = Math.max(
|
|
85
102
|
0,
|
|
@@ -106,35 +123,21 @@ export const onLCP = (
|
|
|
106
123
|
);
|
|
107
124
|
|
|
108
125
|
attribution = {
|
|
109
|
-
|
|
126
|
+
...attribution,
|
|
110
127
|
timeToFirstByte: ttfb,
|
|
111
128
|
resourceLoadDelay: lcpRequestStart - ttfb,
|
|
112
129
|
resourceLoadDuration: lcpResponseEnd - lcpRequestStart,
|
|
113
130
|
elementRenderDelay: metric.value - lcpResponseEnd,
|
|
114
131
|
navigationEntry,
|
|
115
|
-
lcpEntry,
|
|
116
132
|
};
|
|
117
|
-
|
|
118
|
-
// Only attribute the URL and resource entry if they exist.
|
|
119
|
-
if (lcpEntry.url) {
|
|
120
|
-
attribution.url = lcpEntry.url;
|
|
121
|
-
}
|
|
122
|
-
if (lcpResourceEntry) {
|
|
123
|
-
attribution.lcpResourceEntry = lcpResourceEntry;
|
|
124
|
-
}
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
135
|
|
|
128
136
|
// Use `Object.assign()` to ensure the original metric object is returned.
|
|
129
|
-
|
|
130
|
-
metric,
|
|
131
|
-
{attribution},
|
|
132
|
-
);
|
|
133
|
-
return metricWithAttribution;
|
|
137
|
+
return Object.assign(metric, {attribution});
|
|
134
138
|
};
|
|
135
139
|
|
|
136
140
|
unattributedOnLCP((metric: LCPMetric) => {
|
|
137
|
-
|
|
138
|
-
onReport(metricWithAttribution);
|
|
141
|
+
onReport(attributeLCP(metric));
|
|
139
142
|
}, opts);
|
|
140
143
|
};
|
|
@@ -101,7 +101,6 @@ export const onTTFB = (
|
|
|
101
101
|
opts: AttributionReportOpts = {},
|
|
102
102
|
) => {
|
|
103
103
|
unattributedOnTTFB((metric: TTFBMetric) => {
|
|
104
|
-
|
|
105
|
-
onReport(metricWithAttribution);
|
|
104
|
+
onReport(attributeTTFB(metric));
|
|
106
105
|
}, opts);
|
|
107
106
|
};
|
|
@@ -22,26 +22,27 @@ export const getLoadState = (timestamp: number): LoadState => {
|
|
|
22
22
|
// If the `readyState` is 'loading' there's no need to look at timestamps
|
|
23
23
|
// since the timestamp has to be the current time or earlier.
|
|
24
24
|
return 'loading';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
}
|
|
26
|
+
const navigationEntry = getNavigationEntry();
|
|
27
|
+
if (navigationEntry) {
|
|
28
|
+
if (timestamp < navigationEntry.domInteractive) {
|
|
29
|
+
return 'loading';
|
|
30
|
+
}
|
|
31
|
+
if (
|
|
32
|
+
navigationEntry.domContentLoadedEventStart === 0 ||
|
|
33
|
+
timestamp < navigationEntry.domContentLoadedEventStart
|
|
34
|
+
) {
|
|
35
|
+
// If the `domContentLoadedEventStart` timestamp has not yet been
|
|
36
|
+
// set, or if the given timestamp is less than that value.
|
|
37
|
+
return 'dom-interactive';
|
|
38
|
+
}
|
|
39
|
+
if (
|
|
40
|
+
navigationEntry.domComplete === 0 ||
|
|
41
|
+
timestamp < navigationEntry.domComplete
|
|
42
|
+
) {
|
|
43
|
+
// If the `domComplete` timestamp has not yet been
|
|
44
|
+
// set, or if the given timestamp is less than that value.
|
|
45
|
+
return 'dom-content-loaded';
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
// If any of the above fail, default to loaded. This could really only
|
|
@@ -68,9 +68,8 @@ export const getVisibilityWatcher = () => {
|
|
|
68
68
|
const firstVisibilityStateHiddenTime = !document.prerendering
|
|
69
69
|
? globalThis.performance
|
|
70
70
|
.getEntriesByType('visibility-state')
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
)[0]?.startTime
|
|
71
|
+
.find((e) => e.name === 'hidden' && e.startTime >= activationStart)
|
|
72
|
+
?.startTime
|
|
74
73
|
: undefined;
|
|
75
74
|
/* eslint-enable indent */
|
|
76
75
|
|
|
@@ -44,7 +44,7 @@ export const observe = <K extends keyof PerformanceEntryMap>(
|
|
|
44
44
|
// Delay by a microtask to workaround a bug in Safari where the
|
|
45
45
|
// callback is invoked immediately, rather than in a separate task.
|
|
46
46
|
// See: https://github.com/GoogleChrome/web-vitals/issues/277
|
|
47
|
-
|
|
47
|
+
queueMicrotask(() => {
|
|
48
48
|
callback(list.getEntries() as PerformanceEntryMap[K]);
|
|
49
49
|
});
|
|
50
50
|
});
|
package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {observe} from '../observe.js';
|
|
|
18
18
|
|
|
19
19
|
declare global {
|
|
20
20
|
interface Performance {
|
|
21
|
-
interactionCount: number;
|
|
21
|
+
readonly interactionCount: number;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -52,7 +52,7 @@ let po: PerformanceObserver | undefined;
|
|
|
52
52
|
* or the polyfill estimate in this module.
|
|
53
53
|
*/
|
|
54
54
|
export const getInteractionCount = () => {
|
|
55
|
-
return po ? interactionCountEstimate : performance.interactionCount ?? 0;
|
|
55
|
+
return po ? interactionCountEstimate : (performance.interactionCount ?? 0);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -62,8 +62,6 @@ export const initInteractionCountPolyfill = () => {
|
|
|
62
62
|
if ('interactionCount' in performance || po) return;
|
|
63
63
|
|
|
64
64
|
po = observe('event', updateEstimate, {
|
|
65
|
-
type: 'event',
|
|
66
|
-
buffered: true,
|
|
67
65
|
durationThreshold: 0,
|
|
68
66
|
} as PerformanceObserverInit);
|
|
69
67
|
};
|
|
@@ -22,19 +22,25 @@ import {runOnce} from './runOnce.js';
|
|
|
22
22
|
*/
|
|
23
23
|
export const whenIdleOrHidden = (cb: () => void) => {
|
|
24
24
|
const rIC = globalThis.requestIdleCallback || setTimeout;
|
|
25
|
+
const cIC = globalThis.cancelIdleCallback || clearTimeout;
|
|
25
26
|
|
|
26
27
|
// If the document is hidden, run the callback immediately, otherwise
|
|
27
28
|
// race an idle callback with the next `visibilitychange` event.
|
|
28
29
|
if (document.visibilityState === 'hidden') {
|
|
29
30
|
cb();
|
|
30
31
|
} else {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const wrappedCb = runOnce(cb);
|
|
33
|
+
|
|
34
|
+
let idleHandle = -1;
|
|
35
|
+
const onHidden = () => {
|
|
36
|
+
cIC(idleHandle);
|
|
37
|
+
wrappedCb();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
addEventListener('visibilitychange', onHidden, {once: true, capture: true});
|
|
41
|
+
idleHandle = rIC(() => {
|
|
42
|
+
removeEventListener('visibilitychange', onHidden, {capture: true});
|
|
43
|
+
wrappedCb();
|
|
38
44
|
});
|
|
39
45
|
}
|
|
40
46
|
};
|
|
@@ -27,6 +27,7 @@ export interface INPReportOpts extends ReportOpts {
|
|
|
27
27
|
|
|
28
28
|
export interface INPAttributionReportOpts extends AttributionReportOpts {
|
|
29
29
|
durationThreshold?: number;
|
|
30
|
+
includeProcessedEventEntries?: boolean;
|
|
30
31
|
onEachInteraction?: (interaction: INPMetricWithAttribution) => void;
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -95,6 +96,9 @@ export interface INPAttribution {
|
|
|
95
96
|
/**
|
|
96
97
|
* An array of Event Timing entries that were processed within the same
|
|
97
98
|
* animation frame as the INP candidate interaction.
|
|
99
|
+
* This array can be quite large so it will be empty if the
|
|
100
|
+
* `includeProcessedEventEntries` configuration option is set to `false` to
|
|
101
|
+
* conserve memory if these entries are not required.
|
|
98
102
|
*/
|
|
99
103
|
processedEventEntries: PerformanceEventTiming[];
|
|
100
104
|
/**
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export * from './types/base.js';
|
|
18
|
-
export * from './types/polyfills.js';
|
|
19
18
|
|
|
20
19
|
export * from './types/cls.js';
|
|
21
20
|
export * from './types/fcp.js';
|
|
@@ -61,7 +60,7 @@ declare global {
|
|
|
61
60
|
// https://wicg.github.io/event-timing/#sec-performance-event-timing
|
|
62
61
|
interface PerformanceEventTiming extends PerformanceEntry {
|
|
63
62
|
duration: DOMHighResTimeStamp;
|
|
64
|
-
interactionId: number;
|
|
63
|
+
readonly interactionId: number;
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
// https://wicg.github.io/layout-instability/#sec-layout-shift-attribution
|