File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export const platformSupport = {
4343 'duckPlayer' ,
4444 'duckPlayerNative' ,
4545 'brokerProtection' ,
46+ 'breakageReporting' ,
4647 'performanceMetrics' ,
4748 'clickToLoad' ,
4849 'messageBridge' ,
Original file line number Diff line number Diff line change @@ -14,17 +14,27 @@ export default class PerformanceMetrics extends ContentFeature {
1414
1515 // If the feature is enabled, we want to collect expanded performance metrics
1616 if ( this . getFeatureSettingEnabled ( 'expandedPerformanceMetricsOnLoad' , 'enabled' ) ) {
17- this . waitForPageLoad ( ( ) => {
17+ this . waitForAfterPageLoad ( ( ) => {
1818 this . triggerExpandedPerformanceMetrics ( ) ;
1919 } ) ;
2020 }
2121 }
2222
23- waitForPageLoad ( callback ) {
23+ waitForNextTask ( callback ) {
24+ setTimeout ( callback , 0 ) ;
25+ }
26+
27+ waitForAfterPageLoad ( callback ) {
2428 if ( document . readyState === 'complete' ) {
25- callback ( ) ;
29+ this . waitForNextTask ( callback ) ;
2630 } else {
27- window . addEventListener ( 'load' , callback , { once : true } ) ;
31+ window . addEventListener (
32+ 'load' ,
33+ ( ) => {
34+ this . waitForNextTask ( callback ) ;
35+ } ,
36+ { once : true } ,
37+ ) ;
2838 }
2939 }
3040
You can’t perform that action at this time.
0 commit comments