Require manifest to specify the web site/app name

Require manifest to specify the web site/app name (manifest-app-name)

manifest-app-name warns against not specifying the web site/app’s name.

Why is this important?

Browsers that have support for the web app manifest file will use name member (or the short_name, when there is insufficient space) to display the name of the site/app in situations such as: amongst a list of other applications, as a label for an icon, etc.

If these members are not defined, browsers will try to get the name from other sources such as the value of the application-name meta tag, <title>, or just default to a specific value (e.g.: Untitled). This can lead to bad user experience, as the web site/app name may be truncated or just wrong.

In general it is recommended to specify and have the name member under 30 character, and if it’s over 12 characters also have a short_name member that is at most 12 characters.

Notes:

  • If the name is under or 12 characters, there isn’t a need to specify short_name as browsers can just use name.

  • The 12 character limit is used to ensure that for most cases the value won’t be truncated. However depending on other things, such as:

    • what font the user is using
    • what characters the web site/app name includes (e.g. i occupies less space then W)

    the text may still be truncated even if it’s under 12 characters.

  • The 30 character limit is used in order to be consistent with the native OSes/app stores limits/recommendations.

What does the rule check?

The rule checks if a non-empty name member was specified and it’s value is under 30 characters.

If the name member is over 12 characters, or short_name is specified, the rule will also check if short_name has a non-empty value that is under 12 characters.

Examples that trigger the rule

Manifest is specified without name and short_name:

{
...
}

Manifest is specified with a name longer than 12 characters and no short_name:

{
"name": "Baldwin Museum of Science",
...
}

Manifest is specified with a name longer than 30 characters:

{
"name": "Baldwin Museum of Science - visit today!",
"short_name": "Baldwin"
...
}

Manifest is specified with short_name longer than 12 characters:

{
"name": "Baldwin Museum of Science",
"short_name": "Baldwin Museum"
...
}

Examples that pass the rule

Manifest is specified with a name shorter than 30 characters and a short_name shorter than 12 characters:

{
"name": "Baldwin Museum of Science",
"short_name": "Baldwin"
...
}

Note: Not specifying a manifest file, or having an invalid one are covered by other rules, so those cases won’t make this rule fail.

Further Reading