Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for window.performance.mark, may fix #2812 #2813

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Check for window.performance.mark
For compatibility with test environments that replace window.performance
  • Loading branch information
spicemix authored May 4, 2021
commit 68609880aff704c114ae1ae79a817196bb7922cc
2 changes: 1 addition & 1 deletion src/performance/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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}]`;
Expand Down