From 8fd5137d5963d4597c74e0d793522286a0736d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Fri, 1 Sep 2023 10:10:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20INP=20support=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Firefox 88, `PerformanceObserver.supportedEntryTypes` includes `'event'`, but `PerformanceEventTiming` is not implemented. --- .../view/viewMetrics/trackInteractionToNextPaint.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/rum-core/src/domain/rumEventsCollection/view/viewMetrics/trackInteractionToNextPaint.ts b/packages/rum-core/src/domain/rumEventsCollection/view/viewMetrics/trackInteractionToNextPaint.ts index 1898b9c353..4196ba9f99 100644 --- a/packages/rum-core/src/domain/rumEventsCollection/view/viewMetrics/trackInteractionToNextPaint.ts +++ b/packages/rum-core/src/domain/rumEventsCollection/view/viewMetrics/trackInteractionToNextPaint.ts @@ -110,5 +110,9 @@ export function trackViewInteractionCount(viewLoadingType: ViewLoadingType) { } export function isInteractionToNextPaintSupported() { - return supportPerformanceTimingEvent('event') && 'interactionId' in PerformanceEventTiming.prototype + return ( + supportPerformanceTimingEvent('event') && + window.PerformanceEventTiming && + 'interactionId' in PerformanceEventTiming.prototype + ) }