Skip to content
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

Look for fetchPriority instead of importance #103

Open
fariasf opened this issue Jul 19, 2023 · 1 comment
Open

Look for fetchPriority instead of importance #103

fariasf opened this issue Jul 19, 2023 · 1 comment

Comments

@fariasf
Copy link

fariasf commented Jul 19, 2023

In https://github.com/sitespeedio/coach-core/blob/aa2654879533af3ec0381acaf9e7f0b1bfe84c30/lib/dom/performance/largestContentfulPaint.js#L44C1-L49 The Coach will take 5 points if the LCP element is an img and it misses the importance="high" attribute.

According to https://web.dev/fetch-priority/#history, this attribute is now fetchPriority:

Fetch Priority was first experimented with in Chrome as an origin trial in 2018 and then again in 2021 using the importance attribute. At that time it was known as Priority Hints. The interface has since changed to fetchpriority for HTML and priority for JavaScript's Fetch API as part of the web standards process. To reduce confusion we now refer to this API as Fetch Priority.

I've tried adding both attributes to get a perfect score there, but I think doesn't work in recent versions of Chrome as it already moved to fetchPriority (testing manually in the JS console, markup for lcp_image is <img importance="high" fetchpriority="high" src=...):

lcp_image.importance
undefined
lcp_image.fetchPriority
'high'
@soulgalore
Copy link
Member

Thanks I'll have look before the next release.

soulgalore added a commit that referenced this issue Jul 25, 2023
soulgalore added a commit that referenced this issue Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants