Has web app manifest
User guide
- Getting Started
Api
Concepts
Configurations
Configuring webhint
Connectors
Development flow integration
Extensions
Formatters
Hints
- Avoid CSS limits
- Avoid HTTP redirects
- axe accessibility check
- Babel configuration hint set
- Compatibility of CSS, HTML and JavaScript features
- Correct `Content-Type` header
- Correct manifest extension
- Correct viewport
- Detect CSS Reflows
- Disallowed HTTP headers
- External links disown opener
- Has web app manifest
- Highest document mode
- HTTP cache
- Leading '.' in `classList.add` or `classList.remove`
- Manifest has name
- Minify JavaScript
- Modern DOCTYPE
- No `createElement` with SVG
- No `P3P` headers
- No broken links
- No byte-order mark
- No Inline CSS Styles
- No protocol-relative URLs
- No small error pages
- No vulnerable libraries
- Nu HTML test
- Optimal compression
- Optimize images
- Performance budget
- Prefixed CSS first
- scoped-svg-styles
- Specify button type
- SSL server test
- TypeScript configuration hints set
- Unneeded HTTP headers
- Use `Strict-Transport-Security` header
- Use `X-Content-Type-Options` header
- Use Apple touch icon
- Use charset `utf-8`
- Use HTTPS
- Use subresource integrity
- Valid `Set-Cookie` header
- Valid `theme-color`
- Valid manifest
- webpack configuration hints set
Parsers
Server configurations
Troubleshoot
- Api
- Concepts
- Configurations
- Configuring webhint
- Connectors
- Development flow integration
- Extensions
- Formatters
- Hints
- Parsers
- Server configurations
- Troubleshoot
Has web app manifest (manifest-exists
)
manifest-exists
warns when a web app manifest
file is not provided.
Why is this important?
The web app manifest file constitutes a standard centralized place to put metadata about your web application, and providing it:
informs browsers (and possible others) where to look for information about your web app, information that they may need in different contexts (e.g. what icon and name should be used if your web app is added to the home screen)
is an essential piece in the context of progressive web apps, being one of the signals used by some browsers (e.g. Chrome, Opera, Samsung Internet) in deciding if they will show the add to home screen prompt to users
What does the hint check?
This hint checks if:
The web app manifest file is specified correctly in the page (i.e. the page contains a single, valid declaration such as:
<link rel="manifest" href="site.webmanifest">
)The specified web app manifest file is accessible (i.e. requesting it doesn’t result in a
404
,500
, etc.)
Examples that trigger the hint
The web app manifest file is not specified:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
...
</head>
<body>...</body>
</html> |
The location of the web app manifest file is not specified:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="manifest">
...
</head>
<body>...</body>
</html> |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="manifest" href="">
...
</head>
<body>...</body>
</html> |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="manifest" href="site.webmanifest">
...
</head>
<body>...</body>
</html> |
More than one web app manifest file is specified:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="manifest" href="site.webmanifest">
<link rel="manifest" href="another-site.webmanifest">
...
</head>
<body>...</body>
</html> |
Examples that pass the hint
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>example</title>
<link rel="manifest" href="site.webmanifest">
...
</head>
<body>...</body>
</html> |
How to use this hint?
This package is installed automatically by webhint:
npm install hint --save-dev |
To use it, activate it via the .hintrc
configuration file:
{
"connector": {...},
"formatters": [...],
"hints": {
"manifest-exists": "error",
...
},
"parsers": [...],
...
} |
Note: The recommended way of running webhint is as a devDependency
of
your project.