-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(responsiveness): add better INP fallback for old Chrome versions #13985
Conversation
*/ | ||
static findInteractionEvent(responsivenessEvent, {traceEvents}) { | ||
const candidates = traceEvents.filter(/** @return {evt is EventTimingEvent} */ evt => { | ||
// Examine only beginning/instant EventTiming events. | ||
return evt.name === 'EventTiming' && evt.ph !== 'e'; | ||
}); | ||
|
||
if (candidates.length && !candidates[0].args.data.frame) { | ||
if (candidates.length && !candidates.some(candidate => candidate.args.data?.frame)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should handle the seemingly impossible situation @paulirish was in, a newer Chrome but throwing at this point. AFAIK all EventTiming
'b'
and 'n'
events should have this format, but it's possible some somehow don't (empty string frame
, maybe?).
Instead we just assert at least one candidate could (possibly) pass the frame equality check below.
"score": null, | ||
"scoreDisplayMode": "error", | ||
"errorMessage": "This version of Chrome is too old to support 'detailed EventTiming trace events'. Use a newer version to see full results." | ||
"score": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonus: this works again without the trace update :)
@@ -215,6 +216,13 @@ class WorkDuringInteraction extends Audit { | |||
if (interactionEvent === null) { | |||
return {score: null, notApplicable: true}; | |||
} | |||
// TODO: remove workaround once 103.0.5052.0 is sufficiently released. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make an issue and tag 10.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make an issue and tag 10.0?
yes, but would it be more like 10.2 or something?
part of #13916
This change makes INP not error in Chrome < 103.0.5052.0, since it needs just the latency duration, not the rest of the new timing information. It's fine to assume that this audit will land in a DevTools after that version, but puppeteer user flows could easily run on older versions than that.
The work-during-interaction audit will still error, however, since it requires the new timing information.