@@ -5,15 +5,13 @@ import {
55 getCurrentScope ,
66 getRootSpan ,
77 htmlTreeAsString ,
8- isBrowser ,
98 SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME ,
109 SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT ,
1110 SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE ,
1211 SEMANTIC_ATTRIBUTE_SENTRY_OP ,
1312 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
1413 spanToJSON ,
1514} from '@sentry/core' ;
16- import { WINDOW } from '../types' ;
1715import type { InstrumentationHandlerCallback } from './instrument' ;
1816import {
1917 addInpInstrumentationHandler ,
@@ -161,9 +159,11 @@ export const _onInp: InstrumentationHandlerCallback = ({ metric }) => {
161159export function registerInpInteractionListener ( ) : void {
162160 // Listen for all interaction events that could contribute to INP
163161 const interactionEvents = Object . keys ( INP_ENTRY_MAP ) ;
164- if ( isBrowser ( ) ) {
162+ // eslint-disable-next-line no-restricted-globals
163+ if ( typeof window !== 'undefined' ) {
165164 interactionEvents . forEach ( eventType => {
166- WINDOW . addEventListener ( eventType , captureElementFromEvent , { capture : true , passive : true } ) ;
165+ // eslint-disable-next-line no-restricted-globals
166+ window . addEventListener ( eventType , captureElementFromEvent , { capture : true , passive : true } ) ;
167167 } ) ;
168168 }
169169
0 commit comments