File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -292,19 +292,19 @@ function renderReactElement(reactEl, domEl) {
292
292
}
293
293
294
294
if ( onPerfEntry && ST ) {
295
- if ( ! ( 'PerformanceObserver' in window ) ) {
296
- window . addEventListener ( 'load' , ( ) => {
297
- performance . getEntriesByType ( 'paint' ) . forEach ( onPerfEntry )
298
- } )
299
- } else {
300
- performance . getEntriesByType ( 'paint' ) . forEach ( onPerfEntry )
301
-
302
- // Start an observer to catch any paint metrics which may fire _after_
303
- // the load event is fired on the window
295
+ try {
304
296
const observer = new PerformanceObserver ( list => {
305
297
list . getEntries ( ) . forEach ( onPerfEntry )
306
298
} )
307
- observer . observe ( { entryTypes : [ 'paint' ] } )
299
+ // Start observing paint entry types.
300
+ observer . observe ( {
301
+ type : 'paint' ,
302
+ buffered : true ,
303
+ } )
304
+ } catch ( e ) {
305
+ window . addEventListener ( 'load' , ( ) => {
306
+ performance . getEntriesByType ( 'paint' ) . forEach ( onPerfEntry )
307
+ } )
308
308
}
309
309
}
310
310
}
You can’t perform that action at this time.
0 commit comments