w3c / manifest-app-info

Web App Manifest - Application Information
https://w3c.github.io/manifest-app-info/
Other
28 stars 13 forks source link

How to deal with screenshots with a missing `form_factor` field? #62

Closed jespertheend closed 1 year ago

jespertheend commented 1 year ago

What should happen if a screenshot is missing the "form_factor" field? My initial understanding was that screenshots with no form_factor would be shown on all platforms that support screenshots at all. But it seems like on Chrome desktop this is not the case. I have opend up https://crbug.com/1434316 for this but it was marked as working as intended.

It might be worth adding some clarification to the spec about this.

The spec already states

User agents might show as many (or as few) screenshots as they choose

But I feel like this is mostly targeting user agents that wish to either show no screenshots at all, or set a limit to the amount of screenshots being shown. Not the omission of screenshots with a missing form_factor field.

Otherwise, I'm having a hard time thinking of a reason why a developer would want to omit this field. Maybe if some user agents hide these screenshots, sure, but what if all user agents do this?

aarongustafson commented 1 year ago

Fair point. Without a form_factor a user agent should assume the screenshot was intended for universal usage.

This field is also a relatively new one, which is why some screenshots items won't have it. We try not to be overly prescriptive about how this information gets used or considered unless it's really critical. The form_factor key is an extra bit of detail that a user agent could use, if they are so inclined. Same goes for a digital storefront that might choose to consume information from a Manifest.

Also, a bit maddeningly, all properties of a Web App Manifest are technically optional.

jespertheend commented 1 year ago

@aarongustafson Thanks for the clarification. Do you think the spec could use some extra details to mention this specific case, or is it already clear enough as it is? I could submit a PR if you like.

Either way, I can forward this conversation to the chromium issue and hopefully change their mind.

aarongustafson commented 1 year ago

Yeah, the response to the bug (and Chrome’s approach) seems to be overly touchy. Based on how it was spec’d (and how it reads), the following should be true:

form_factor Narrow Context (e.g., mobile install) Wide Context (e.g., tablet or desktop install)
undefined included included
"narrow" included excluded
"wide" excluded included

Note: a UA (or other Manifest parser) might choose to make additional inferences based on MIME type, platform, or sizes information.