The manifest for web applications is a W3C standard to define, via a JSON file (usually
manifest.json), how our web site behaves when acting as a web application.
Until now our option was to rely on the
<title> tag for the application title and a bunch of
msapplication, etc.) tags to manage icons at different resolutions. When a user added our website to the home screen of their mobile phone, it appeared using this title and icons depending on the platform the user had. This technique was not very developer friendly and did not offer flexibility or ease of maintenance of these guidelines.
The W3C got to work and now we can make use of the manifest for web applications.
To create our manifest we will use a
.json file, which can be called whatever we want (usually
manifest.json). More or less a basic example would be the following:
These properties come to say the following:
|This is the short name of the application and will be used by default.|
|The long version of the name.|
|Specifies a list of images to be used depending on the device.|
|Specifies the address to load when opening the web application.|
|The display mode that our application will get when opened. It can be |
|The orientation that our application acquires when opened. It can be |
You can check the rest of the properties in the official standard.
To use the manifest just include a reference in the header of our HTML code:
And that’s it, by making use of functions such as ”Add to home screen” of the Chrome browser for Android, users will use our website as if it were a native application.