Comments (6)
Awesome, thanks for your work @philipwalton!
from web-vitals.
Interesting, @npm1 can you speak to Chrome's kUserScroll
and kCompositorScroll
usage here? Could there be some scroll events that addEventListener('scroll')
would catch but wouldn't end LCP observation?
from web-vitals.
We should stop on scrolling caused by user, which is not the case here. Does the listener check that the event has isTrusted set?
from web-vitals.
Although window.scroll()
does create a trusted event despite not being caused by the user so that seems insufficient. @flackr do you know if there's a reliable way to detect user-initiated scrolls?
from web-vitals.
Ping @flackr
Unless we find a better way to detect only user-initiated scrolls, we'll likely have to drop this check and only listen for keypress
and click
. Ignoring scroll
events won't affect the reliability of the results, but it will likely affect how soon tools like the Web Vitals Chrome Extension can report the metric as "final" (cc: @addyosmani)
from web-vitals.
There is currently no reliable way to detect user-initiated scrolls. This is because the scroll event itself is an observation of the scroll position having change rather than a direct event causing it.
You could however try to observe all possible user initiated scroll sources (mousewheel, pointerdown / pointermove, down arrow / page down / space bar?) in combination with a scrollable page.
Could you explain more the rationale around no longer observing LCP after the user scrolls? This doesn't seem like it would be guaranteed IMO.
from web-vitals.
Related Issues (20)
- Webpack Module is undefined HOT 2
- iOS Chrome Support HOT 1
- differences in TTFB in safari vs chromium based browsers HOT 1
- LCP value setting to 0 intermittently HOT 7
- Add INP breakdown entries to the attribution build HOT 3
- User consent policy HOT 1
- Firefox LCP tests failing
- Bug: LCP attribution can include `resourceLoadDelay` attribution timings far greater than the LCP value in cases where `onTTFB` discards the navigation data HOT 1
- FCP and TTFB are triggered multiple times HOT 7
- contributing LoAF basesd code that idenifies LoAF, INF and JS long tasks data HOT 1
- Capturing metadata with events HOT 2
- Allow to reset the INP calculation HOT 2
- v4 giving undefined TypeError HOT 1
- INP: Probably a bad measurement metric for web vitals - even with simple HTML structure pages with no CSS will cause bad value. HOT 1
- Expose INP target element as first class citizen in attribution HOT 2
- Expose ability to reset internal state of metrics (specifically INP) HOT 2
- v4 INP attribution ending processingEnd time in the wrong animation frame HOT 8
- CDN JS - Web server is returning an unknown error HOT 4
- CLS and INP are being calculated incorrectly HOT 2
- Suggestion to track all attributions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-vitals.