cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Passive event listener ?

AymericM
Participant

Hello,

 

another question from our dev team : their performance audit tool detected that there is 1 active event listener in the JS file injected with the tag.

The tool is suggesting to use only passive listeners to improve scrolling performance.

Is their a way to configure that ?

3 REPLIES 3

simon_schatka
Dynatrace Helper
Dynatrace Helper

Hi

 

All listeners should be registered as passive. Because we are wrapping some functions, we might be showing up as the culprit, when we actually are not.

If you are sure this is caused by us, can you please go ahead and create a Zendesk ticket and provide some more information, so we can take a closer look at this?

 

Simon

simon_schatka
Dynatrace Helper
Dynatrace Helper

Hi again

 

We have received your question via Zendesk and will answer on that ticket as well, but I thought this can also be interesting for others, so I will also answer here.

The passive listener is not actually registered by us, we are just wrapping a function and forwarding the call from another javascript file on your page. 

In the ticket you mentioned "GTMETRIX", but you can actually also run the same test on your local machine using Chrome Developer Tools and Lighthouse.

It will show the same error (interestingly it shows line 272, GTMETRIX is showing line 271, but that seems to be a bug): 

simon_schatka_0-1648047145447.png

It is then possible to use "Network request blocking" to block the <id>_complete.js file from loading:

simon_schatka_1-1648047239553.png

Running Lighthouse again then gives this result:

simon_schatka_2-1648047328235.png

And upon clicking on the link, it takes you to the real location where this happens:

simon_schatka_3-1648047362157.png


Hope this helps

Simon

Thanks I'll share this to the dev team right away 

Featured Posts