-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Lower the installable-manifest icon requirement to 144px, add audits for A2HS in other browsers #6700
Comments
I noted some of the following on the Chrome bug:
|
Thanks for bringing this up @ayumihamsaki, and thanks @dominickng for sharing those details. Seems that the docs @ayumihamsaki linked to (and the failing audit text) is misleading - a 512x icon is not required for a splash screen. I think it is selected in the same manner as the PWA icon - is that correct @dominickng? |
@hoten Thanks for weighing in! It's correct that a 512px icon is not required for a splash screen in Chrome. If a large icon is present, a different splash template suitable for the bigger icon is used, but we still generate a splash screen if there's only a 144px icon. |
See #291 for how we arrived at the 512 recommendation. Since it's part of the pwa optimized group and not part of installable, it seems ok to stick to that recommendation (maybe we want to tweak the failure title...e.g. "not configured for a good custom splash screen" :) |
I agree that the recommendation is incorrect. SVG icons are supported by Chrome. And work fine. For example this is fine for Chrome, but Lighthouse claims that there are no suitable icons in the manifest (both for icon and splash screen): "icons": [
{
"src": "/ico/apple-touch-icon-72-precomposed.png",
"type": "image/png",
"sizes": "72x72"
},
{
"src": "/ico/apple-touch-icon-114-precomposed.png",
"type": "image/png",
"sizes": "114x114"
},
{
"src": "/ico/apple-touch-icon-144-precomposed.png",
"type": "image/png",
"sizes": "144x144"
},
{
"src": "/ico/catalogue_online.svg",
"sizes": "145x145 192x192 512x512"
}
], |
@Eccenux The recommendation against SVG is correct. Chrome currently does not support SVG icons for PWAs primary icons. You can only supply PNGs. Part of this limitation is because the underlying platforms don't really support SVG as launcher icons, e.g. Android requires that SVGs are converted to a different format to use as home screen shortcuts. The other part is that rendering an SVG needs to happen in Chrome's renderer process, and there's some complexity in plumbing (this is the reason why Chrome doesn't support SVG favicons yet). However, you are right in pointing out that your manifest should be supported. Chrome's current requirement is a minimum 144x144px PNG icon (which is present), not a 192x192px icon. |
@dominickng Well SVG works fine for me on Chrome 71, Android 8.1.0. I'm also almost sure it worked fine last time I checked (both for Chrome and Firefox Mobile). Maybe Chrome generates PNG internally, but it does work. And also what happens internally is not really a developers problem (PNG would also need to be converted to bitmap in the end). Some screens. This the same manifest I pasted above. App install popup: App icon on desktop/launcher: |
@Eccenux Your site works in Chrome because you have a 144x144px PNG icon in your manifest. If you remove that, you'll find that it no longer works, since we haven't yet implemented SVG manifest icon support. |
So, to summarize:
This seems like WAI for now from a Lighthouse perspective, we can't claim SVG (or any non-PNG format) is valid in Chrome because it is not, and we landed on 512px for optimum image size after a lengthy discussion in the past. |
Hm... That's weird. I didn't expect Chrome not to conform with the standard. So I guess the recommendation is correct for Chrome for Android for now. Hopefully not for long ;-). The message in Lighthouse could still be more clear though... Could say that a smaller PNG would be used for an icon and might be blurry. I would also like to note that it's not nice to remove comments... They didn't seem to be out of line for me. Ayumi Hamasaki did provide some valid points in her comments. It would be wise to also consider other browsers and not just Chrome when auditing websites/applications. Would make Lighthouse more useful for developers. |
Moving the 512px requirement to a warning could be a feasible alternative, IMO. The motivation and discussion in #291 for 512 was for minimizing downloading of extra icons and preventing unpleasant auto-scaling artifacts, but it certainly doesn't stop being a PWA because the icon is a bit fuzzy. The discussion took place before warnings were a thing, and 2 years is a decent time window to re-evaluate 👍 @ayumihamsaki you're not deleting your own comments are you? I've never been able to see them on the issue, just in the email thread. It's only been a few hours since them when it was ~4am on a Sunday for the core team I'm sure it wasn't us unless some credentials have gone rogue :) This is definitely constructive conversation and hardly the worst criticism we've received 😉 |
@patrickhulce Yes I deleted my comment as I saw this issue was closed. I will re-write my comment back here. I personally disagree with the conclusion, because I thought Lighthouse was Best Practices for all Browsers and not Google Chrome Best Practices. Github Issue here # 291 was dated two years ago and at that time only Google Chrome officially used Manifest. Now in 2018 four Major browsers officially use Manifest and so Lighthouse should reflect that. Another 2 Major Browsers have manifest under review and that would bring the total to 6. My point is that to pass all four browsers you need the following set of icons: 144px and Google Chrome suggests 512px Therefore I feel Lighthouse should change their recommendation to reflect all Browsers and not just Google Chrome. Also in the near future when Safari adds manifest how is a 512px png file meant to scale down to work on the Apple Watch 3+ for example, I don't think that would work. |
I think there are three aspects to this issue that we should separate:
|
So I think the actions we'll want here:
|
@charlymz Looks like your service worker is not installing. |
but ir requests a 192 and a 512 PNG in the manifest and they are there, also it was requiring a theme_color it was added and the warning disapeared, why not disapear the PNG warning if the icons exists |
Soo, I need to add a 512px png next to the following icons:
I need all the Can we please all agree on a |
We fixed this in Jan 2020 in #10175 And then in LH 7, we use Chrome's installability criteria, so this will always be matching now. |
Lighthouse suggest to Developers to use 512px by 512px .png files for the icons in the manifest file. You can see the following information recommendation by Lighthouse found here: https://developers.google.com/web/tools/lighthouse/audits/custom-splash-screen#recommendations
This seems to be a complete waste of file size space and will give a negative performance to PWA's and use up people's Data Plans on Mobile networks.
Though I am not suggesting to not use 512px by 512px icons and maybe in the future we end up having 1024 x 1024 with Mobile devices getting better screen displays as time goes by.
I'm suggesting that using the
.png
format is not a good idea at all. In fact it would be better to use.jpg
(for reduced file size) or the next gen image format.webp
(for even better reduced file size and quality) or a vector such as.svg
which would have the best quality displaying various icon sizes.Please note I have filed an issue with the Google Chrome team found here: https://bugs.chromium.org/p/chromium/issues/detail?id=910880
I would like to see both Google Chrome and Lighthouse work together to create a solution by allowing Developers to use 512px by 512px icon sizes and better image formats
.jpg
or.webp
or.svg
thus saving Users Data and Speeding up the loading of a PWA.The text was updated successfully, but these errors were encountered: