Closed ekremney closed 3 months ago
The one w3 document I assume is the Event Timing spec?
Chrome has implemented this feature, but it is still behind a feature flag in Stable (or via experimental web platform features). We expect to ship it in stable.
eventCounts
is not possible to use as a way to estimate interactionCount (and its the reason Event Timing added interactionCount). (You can also find lots of discussion in the Web Perf WG for this feature).
The single biggest flaw of eventCount is that it does not differentiate when e.g. pointer events actually become a scroll, or how keyboard events might trigger clicks, or how accessibility or IME interfaces might dispatch events in different orders...
You could try to approximate interactionCount
but using something like the count of clicks - count of pointerCancel, and an earlier version of web-vitals.js actually tried that (especially since this is supported on Firefox). Unfortunately it was off and unreliable on all browsers.
that's a very clear explanation, thanks @mmocny!
I couldn't find any reference to
performance.interactionCount
on web (except one W3 document). Also, both Google Chrome and Firefox don't seem to have it -> both returnsundefined
.Suggesting to use the performance.eventCounts property instead of
interactionCount
togetInteractionCount
.