-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Reconsider Web App Manifest "theme_color" requirement #3891
Comments
Currently we require that you supply both the Could you clarify what you mean by 'recognize'? Is there information you feel is missing from the documentation? |
@patrickhulce why would there be a reason to require both? Currently only Chrome and Firefox behind flag I think documentation must be fixed to and require only one of properties, and also mention that valid Can you fix it? |
@patrickhulce does #3891 still |
@laukstein meta tag should enable the coloring of the address bar on first load before the manifest has been loaded, so it seems reasonable to include it on PWA entry pages when the assumption is the user is visiting on a mobile connection where network contention may delay a low priority request such as the manifest (if you see evidence to the contrary we'd love some examples!). Even though it overrides the manifest value, it still makes sense to have a sensible default of a theme color that applies to the entire web app when the meta tag is not specified on every single page (ones that are assumed to be visited after the manifest has been loaded). I hope this helps explain the current rationale for the policy, but we appreciate the feedback! cc @vinamratasingal @tjsavage for FYI of feedback to take into account for PWA checklist |
Looking at the chromium source now, the earliest the manifest is fetched on a new site is after onload. It also won't fetch the manifest unless the site has sufficient engagement. The meta tag allows the browser to color the address bar earlier than that point. So it does seem to be correct that we still require this meta tag. |
@paulirish @jakearchibald why to delay manifest download until page onload, etc.? Why not async - load manifest immediately when detected in HTML without blocking continuous HTML and its content? When Webapp is on homescreen/desktop, is manifest fetched from cache or from website blocking the website load, or else? Maybe when Webapp is on homescreen/desktop, Lighthouse mustn't require |
I'm not sure I understand your current proposal @laukstein.
Lighthouse and users visit the page before it's been put on the homescreen, in this scenario, you'd want the Since this is a PWA audit and you're already serving a manifest in the PWA case, you'd want the same If your entire application is a SPA that never visits any other page then the manifest version will be superfluous, but I don't see why we'd want to not enforce the meta tag which seems to be your primary argument. Maybe I'm misunderstanding? |
@patrickhulce, hi! The issue I think is how manifest download is handled,
and till it changes, likely |
I see, so you do not have an issue with requiring both theme-color in meta and manifest anymore then? Is it just that you would like the behavior for when the web app manifest is downloaded by Chrome to change? If this is the case, you can file a bug with Chromium detailing your use case and why the behavior should be different though as Chrome is following the advice in the spec, I'm not sure it's likely to change.
If I still misunderstood, perhaps a thorough read of the web app manifest spec might prove helpful to you since it details the need for an improvement on meta tags (and why we recommend putting |
Sounds like this isn't necessarily a Lighthouse bug, and is more of an issue with how browsers treat the two theme colors. If you're still seeing a problem with Lighthouse's behavior, though, please comment and we can reopen. |
I think the requirement should be removed or tweaked to wait until the For a real example, I have a prerender script that runs before the page renders (in
In the code example, I'm using pure black and white, but it could easily be dark blue and light blue, etc. On a side-note, I've already added color scheme support with the background by using Edit: Lighthouse reads transparent as not configured for |
@clshortfuse which requirement are you referring to? I'm not sure how either are failing to wait for the load event. In fact, the discussion above is based around frustration that they're not firing earlier than the load event. The example you've shown should absolutely be respected by the
It very well might be a bug, would be willing to file a separate bug with a repro URL? |
I think @clshortfuse is referring to spec issue w3c/manifest#758
|
@laukstein That's for the icons, but I'm focusing on I had understood that it's an automatic failure if it's not in the manifest, but it looks like it should pass if I set the |
Oh, it is a requirement to set |
@patrickhulce Okay, let's just clarify this. I'm getting:
Under that, the failure says:
But I am setting it on I'm also getting which may or not be related:
Even though |
That page is setting a tl;dr - you want the OS theme color in app switchers, etc to match that of your theme-color established by the For your specific situation, it's not a hard requirement for them to match though so you can put the OS-specific value in here if you want and rely on the
This does indeed seem like a bug in our version of color parser :) (FWIW, it's just being a little too strict |
Thanks for taking a look. So I guess I'd agree with reducing the requirement. The title states: "Does not set an address-bar theme color" when it does, so the language is confusing off the bat. It is being set, just not via the manifest. I can understand that browsers shouldn't be required to execute some JS in order to find out what theme-color to use. And, as I stated, I intentionally want to browser to provide its own preference if that is the case, so there could be valid reason to not provide a value in the manifest. But even so, on the latest Android Q beta with Chrome, changing from Dark Mode to Light Mode on the OS changes the app switcher will update the color as well. So Chrome is reading the meta tag. I don't see a use case for For my purposes I reason that it's better to use the meta tag, so I think it would be better if a warning (not failure) was emitted if one of the two are missing, rather than a failure if only one is missing. I could probably add the And then there's use case to consider. Suppose you you don't want to provide any color and let the browser provide one. I do this for So, I'm using If, on the other hand, W3C were to incorporate support for specific value to say "system-default" then I can see Lighthouse considering it as a failure. (Maybe they can add"transparent" as default in the spec.) But then again, I can easily see them say, if you want the default, don't set one. |
These are all good points. I'm inclined to reduce the requirement to Does anyone else on LH disagree? |
I think I'd be ok with this, but mostly because I personally don't think omnibox colors are that important to a PWA experience :) But I think several of us may be biased that way, so we might need to invoke the ⚡🧙PWA checklist council 🧙⚡to make a real ruling (the possibility for change is higher since this is on the polished list and not the base PWA requirements). I believe the reasoning was something about a flash of unstyled omnibox before the html loads when launched as an installed app? If the goal is a good startup experience (and dynamically changing the theme-color later is out of scope), another option is to go back to the check of the meta
There may also be webapp manifest spec changes that could be made to deal with changes in the ecosystem, e.g. ability to specify light/dark modes (w3c/manifest#779 and w3c/manifest#758), a default color (the spec-defined default |
FYI, Chrome canary (https://bugs.chromium.org/p/chromium/issues/detail?id=578122) supports now
Tested on desktop. |
Why is this a requirement? |
Who is it that feels the need to dictate to the entire population of web designers that their PWA must override their users' OS window color to match some imagined PWA theme? If designers want to, by all means, but it seems ridiculous for Lighthouse to be reporting your PWA is not a valid PWA because you haven't yet smothered the Chrome address bar with some brand color. Please remove this arbitrary requirement from the PWA validation checks. |
This framing is definitely a stronger assertion than what we intend with our report, given it's in the I think we should consider doing what Brendan laid out here: #3891 (comment) only check for the problematic flash-of-colors when the PWA manifest and the meta element theme colors disagree. |
As per Chrome’s updated Installability Criteria, Lighthouse will be deprecating the PWA category in the next upcoming release. For future PWA testing, users will be directed to use the updated PWA documentation. Marking this as closed! |
Fallow the spec and recognize Web App Manifest
theme_color
parameter.Currently showing error
Is related to #2466.
Spec https://w3c.github.io/manifest/#theme_color-member
Landed in Chrome 46 https://developers.google.com/web/updates/2015/08/using-manifest-to-set-sitewide-theme-color
The text was updated successfully, but these errors were encountered: