diff --git a/src/compat/performance/performance.service.ts b/src/compat/performance/performance.service.ts index 94c532884..edc1861d2 100644 --- a/src/compat/performance/performance.service.ts +++ b/src/compat/performance/performance.service.ts @@ -6,7 +6,7 @@ const IS_STABLE_START_MARK = '_isStableStart'; const IS_STABLE_END_MARK = '_isStableEnd'; function markStarts() { - if (typeof(window) !== 'undefined' && window.performance) { + if (typeof(window) !== 'undefined' && window.performance && window.performance.mark) { window.performance.mark(IS_STABLE_START_MARK); return true; } else { @@ -22,7 +22,7 @@ export class PerformanceMonitoringService implements OnDestroy { private disposable: Subscription|undefined; constructor(appRef: ApplicationRef) { - if (started) { + if (started && window.performance.mark) { this.disposable = appRef.isStable.pipe( first(it => it), tap(() => { diff --git a/src/compat/performance/performance.ts b/src/compat/performance/performance.ts index fda50b918..b9b083f19 100644 --- a/src/compat/performance/performance.ts +++ b/src/compat/performance/performance.ts @@ -52,7 +52,7 @@ export class AngularFirePerformance { } const trace$ = (traceId: string) => { - if (typeof window !== 'undefined' && window.performance) { + if (typeof window !== 'undefined' && window.performance && window.performance.mark) { const entries = window.performance.getEntriesByName(traceId, 'measure') || []; const startMarkName = `_${traceId}Start[${entries.length}]`; const endMarkName = `_${traceId}End[${entries.length}]`;