Skip to content

Commit

Permalink
Merge pull request #5849 from guardian/mxdvl/safe-get-entries-by-type
Browse files Browse the repository at this point in the history
fix: safe `performance.getEntriesByType`
  • Loading branch information
mxdvl committed Aug 25, 2022
2 parents b18a4a7 + a64ff08 commit 6d2e355
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dotcom-rendering/src/web/browser/islands/doHydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const doHydration = (
return { clientOnly, timeTaken };
})
.then(({ clientOnly, timeTaken }) => {
if (!('getEntriesByType' in window.performance)) return;

// Log performance info
const { duration: download = -1 } =
window.performance
Expand Down

0 comments on commit 6d2e355

Please sign in to comment.