Commit c294ad0a authored by Christopher Snyder's avatar Christopher Snyder Committed by Joe Haddad

Fix missing quotes around `in` operator check for PerformanceObserver (#10018)

* Fix missing quotes around `in` operator check for PerformanceObserver

* Always call `getEntriesByType()` even if performance observer is supported.
Co-authored-by: 's avatarJoe Haddad <timer150@gmail.com>
parent 3dc4a687
......@@ -294,11 +294,15 @@ function renderReactElement(reactEl, domEl) {
}
if (onPerfEntry && ST) {
if (!(PerformanceObserver in window)) {
if (!('PerformanceObserver' in window)) {
window.addEventListener('load', () => {
performance.getEntriesByType('paint').forEach(onPerfEntry)
})
} else {
performance.getEntriesByType('paint').forEach(onPerfEntry)
// Start an observer to catch any paint metrics which may fire _after_
// the load event is fired on the window
const observer = new PerformanceObserver(list => {
list.getEntries().forEach(onPerfEntry)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment